{
  "schemaVersion": 1,
  "operation": {
    "operationId": "search",
    "method": "GET",
    "path": "/api/v1/search",
    "summary": "Search accessible product objects",
    "description": "",
    "tags": [
      "Search"
    ],
    "effect": "read",
    "confirmation": "never",
    "authorization": {
      "mode": "privilege",
      "privilege": "VIEW_ITEM"
    },
    "parameters": [
      {
        "name": "q",
        "in": "query",
        "required": false,
        "description": "",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "workspace",
        "in": "query",
        "required": false,
        "description": "",
        "schema": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      {
        "name": "type",
        "in": "query",
        "required": false,
        "description": "",
        "schema": {
          "items": {
            "$ref": "#/components/schemas/SearchResultType"
          },
          "type": "array"
        }
      },
      {
        "name": "contextWorkspace",
        "in": "query",
        "required": false,
        "description": "",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "contextDashboard",
        "in": "query",
        "required": false,
        "description": "",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "contextPage",
        "in": "query",
        "required": false,
        "description": "",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "limit",
        "in": "query",
        "required": false,
        "description": "",
        "schema": {
          "format": "int32",
          "maximum": 200,
          "minimum": 1,
          "type": "integer"
        }
      },
      {
        "name": "pageToken",
        "in": "query",
        "required": false,
        "description": "",
        "schema": {
          "maxLength": 2048,
          "minLength": 1,
          "type": "string"
        }
      }
    ],
    "responses": [
      {
        "status": "200",
        "description": "The request has succeeded.",
        "content": [
          {
            "contentType": "application/json",
            "schema": {
              "$ref": "#/components/schemas/SearchResponse"
            }
          }
        ]
      },
      {
        "status": "400",
        "description": "The server could not understand the request due to invalid syntax.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "401",
        "description": "Access is unauthorized.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "403",
        "description": "Access is forbidden.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "404",
        "description": "The server cannot find the requested resource.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "409",
        "description": "The request conflicts with the current state of the server.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "412",
        "description": "Precondition failed.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "413",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "415",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "422",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "429",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "500",
        "description": "Server error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "502",
        "description": "Server error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "503",
        "description": "Service unavailable.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      }
    ]
  },
  "schemas": {
    "PageInfo": {
      "example": {
        "nextCursor": "example"
      },
      "properties": {
        "nextCursor": {
          "example": "example",
          "type": "string"
        }
      },
      "type": "object"
    },
    "ProblemDetails": {
      "example": {
        "code": "example",
        "detail": "example",
        "errors": [
          {
            "code": "example",
            "detail": "example",
            "field": "example"
          }
        ],
        "instance": "example",
        "requestId": "example",
        "status": 1,
        "title": "example",
        "type": "example"
      },
      "properties": {
        "code": {
          "example": "example",
          "type": "string"
        },
        "detail": {
          "example": "example",
          "type": "string"
        },
        "errors": {
          "example": [
            {
              "code": "example",
              "detail": "example",
              "field": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/ProblemFieldError"
          },
          "type": "array"
        },
        "instance": {
          "example": "example",
          "type": "string"
        },
        "requestId": {
          "example": "example",
          "type": "string"
        },
        "status": {
          "example": 1,
          "format": "int32",
          "type": "integer"
        },
        "title": {
          "example": "example",
          "type": "string"
        },
        "type": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "type",
        "title",
        "status",
        "detail",
        "instance",
        "code",
        "requestId",
        "errors"
      ],
      "type": "object"
    },
    "ProblemFieldError": {
      "example": {
        "code": "example",
        "detail": "example",
        "field": "example"
      },
      "properties": {
        "code": {
          "example": "example",
          "type": "string"
        },
        "detail": {
          "example": "example",
          "type": "string"
        },
        "field": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "field",
        "code",
        "detail"
      ],
      "type": "object"
    },
    "SearchContextTag": {
      "enum": [
        "current_page",
        "current_dashboard",
        "current_workspace"
      ],
      "example": "current_page",
      "type": "string"
    },
    "SearchLocation": {
      "example": {
        "dashboardId": "example",
        "dashboardName": "example",
        "href": "example",
        "pageId": "example",
        "pageName": "example"
      },
      "properties": {
        "dashboardId": {
          "example": "example",
          "type": "string"
        },
        "dashboardName": {
          "example": "example",
          "type": "string"
        },
        "href": {
          "example": "example",
          "type": "string"
        },
        "pageId": {
          "example": "example",
          "type": "string"
        },
        "pageName": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "href"
      ],
      "type": "object"
    },
    "SearchReference": {
      "example": {
        "id": "example",
        "type": "workspace",
        "workspaceId": "example"
      },
      "properties": {
        "id": {
          "example": "example",
          "type": "string"
        },
        "type": {
          "$ref": "#/components/schemas/SearchResultType"
        },
        "workspaceId": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "workspaceId",
        "type",
        "id"
      ],
      "type": "object"
    },
    "SearchResponse": {
      "example": {
        "items": [
          {
            "context": [
              "current_page"
            ],
            "description": "example",
            "href": "example",
            "locations": [
              {
                "dashboardId": "example",
                "dashboardName": "example",
                "href": "example",
                "pageId": "example",
                "pageName": "example"
              }
            ],
            "name": "example",
            "reference": {
              "id": "example",
              "type": "workspace",
              "workspaceId": "example"
            },
            "visualType": "example",
            "workspace": {
              "id": "example",
              "name": "example"
            }
          }
        ],
        "page": {
          "nextCursor": "example"
        }
      },
      "properties": {
        "items": {
          "example": [
            {
              "context": [
                "current_page"
              ],
              "description": "example",
              "href": "example",
              "locations": [
                {
                  "dashboardId": "example",
                  "dashboardName": "example",
                  "href": "example",
                  "pageId": "example",
                  "pageName": "example"
                }
              ],
              "name": "example",
              "reference": {
                "id": "example",
                "type": "workspace",
                "workspaceId": "example"
              },
              "visualType": "example",
              "workspace": {
                "id": "example",
                "name": "example"
              }
            }
          ],
          "items": {
            "$ref": "#/components/schemas/SearchResult"
          },
          "type": "array"
        },
        "page": {
          "$ref": "#/components/schemas/PageInfo"
        }
      },
      "required": [
        "items",
        "page"
      ],
      "type": "object"
    },
    "SearchResult": {
      "example": {
        "context": [
          "current_page"
        ],
        "description": "example",
        "href": "example",
        "locations": [
          {
            "dashboardId": "example",
            "dashboardName": "example",
            "href": "example",
            "pageId": "example",
            "pageName": "example"
          }
        ],
        "name": "example",
        "reference": {
          "id": "example",
          "type": "workspace",
          "workspaceId": "example"
        },
        "visualType": "example",
        "workspace": {
          "id": "example",
          "name": "example"
        }
      },
      "properties": {
        "context": {
          "example": [
            "current_page"
          ],
          "items": {
            "$ref": "#/components/schemas/SearchContextTag"
          },
          "type": "array"
        },
        "description": {
          "example": "example",
          "type": "string"
        },
        "href": {
          "example": "example",
          "type": "string"
        },
        "locations": {
          "example": [
            {
              "dashboardId": "example",
              "dashboardName": "example",
              "href": "example",
              "pageId": "example",
              "pageName": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/SearchLocation"
          },
          "type": "array"
        },
        "name": {
          "example": "example",
          "type": "string"
        },
        "reference": {
          "$ref": "#/components/schemas/SearchReference"
        },
        "visualType": {
          "example": "example",
          "type": "string"
        },
        "workspace": {
          "$ref": "#/components/schemas/SearchWorkspaceSummary"
        }
      },
      "required": [
        "reference",
        "name",
        "workspace",
        "href",
        "locations",
        "context"
      ],
      "type": "object"
    },
    "SearchResultType": {
      "enum": [
        "workspace",
        "connection",
        "source",
        "model_table",
        "semantic_model",
        "semantic_table",
        "field",
        "measure",
        "dashboard",
        "page",
        "visual",
        "filter",
        "refresh_pipeline"
      ],
      "example": "workspace",
      "type": "string"
    },
    "SearchWorkspaceSummary": {
      "example": {
        "id": "example",
        "name": "example"
      },
      "properties": {
        "id": {
          "example": "example",
          "type": "string"
        },
        "name": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "type": "object"
    }
  }
}
