---
title: Search document
slug: test-mdx-pdf/search-document
docTags: 
createdAt: 2026-07-21T14:09:11.897Z
---

{
  "id": "oN6LpHLEnjkp-axl1aPtw",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.archbee.com/api/public-api/docs/search",
    "servers": [
      {
        "url": "https://api.archbee.com/api/public-api/docs/search",
        "description": "Archbee API Server"
      }
    ],
    "name": "Search document",
    "description": "<p>Search Archbee documents in docSpace. Can perform one of the 3 types of search:</p>\n<ol>\n<li><strong>ai-chat</strong> to return ai generative answer accompanied by source docs;</li>\n<li><strong>ai-retrieval</strong> to return just similar docs with the query;</li>\n<li><strong>words</strong> to perform normal search aka. \"word-based\"; use empty query to return all docs</li>\n<li><strong>single-doc</strong> to return document info by id</li>\n</ol>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Content-Type",
          "type": "string",
          "example": "application/json",
          "description": ""
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "schema": [
            {
              "name": "query",
              "kind": "required",
              "type": "string",
              "description": "<p>Filter text, question or document title</p>"
            },
            {
              "name": "searchOnlyTitle",
              "kind": "optional",
              "type": "boolean",
              "description": "OPTIONAL. Search only by title"
            },
            {
              "name": "persistSearch",
              "kind": "optional",
              "type": "boolean",
              "description": "OPTIONAL. Wether to keep a SearchSession in our database and return its id."
            },
            {
              "name": "searchSessionId",
              "kind": "optional",
              "type": "string",
              "description": "OPTIONAL. id for the SearchSession object to update. More useful for AI chat."
            },
            {
              "name": "docId",
              "kind": "optional",
              "type": "string",
              "description": "<p>OPTIONAL. Return only one document with this id, if there is one</p>",
              "example": "21-character__string0"
            },
            {
              "name": "dataTextFormat",
              "kind": "optional",
              "type": "string<markdown | html>",
              "description": "OPTIONAL. Return documents with dataText in this format",
              "enum": [
                "markdown",
                "html"
              ]
            },
            {
              "name": "parentDocId",
              "kind": "optional",
              "type": "string",
              "description": "<p>OPTIONAL. Return only child documents of the doc with this id, if there are any. Can be \"null\" for retrieving the root docs.</p>",
              "example": "21-character__string0"
            },
            {
              "name": "type",
              "kind": "optional",
              "type": "string<words | ai-chat | ai-retrieval>",
              "description": "<p>OPTIONAL. which type of search to use; default is word-based</p>",
              "enum": [
                "words",
                "ai-chat",
                "ai-retrieval"
              ]
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "bearerAuth",
          "name": "bearerAuth",
          "kind": "optional",
          "type": "http",
          "description": "<p>Requires the <code>Authorization</code> header in the form <code>Authorization: Bearer {base64(docSpaceId~apiKey)}</code> Where the token is base64 encoding of docSpaceId, tilde, and apiKey.</p>",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Process status",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Process status",
            "schema": [
              {
                "name": "status",
                "kind": "optional",
                "type": "string<OK>",
                "description": "Response Status",
                "enum": [
                  "OK"
                ]
              },
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "Response Data",
                "example": "",
                "schema": [
                  {
                    "name": "searchSessionId",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>Search session id, can be used as input for next search calls.</p>"
                  },
                  {
                    "name": "docs",
                    "kind": "optional",
                    "type": "array",
                    "description": "Array of Doc responses",
                    "modelRef": "#/components/schemas/DocResponse",
                    "customType": "DocResponse[]",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>Archbee id, used for private access</p>"
                      },
                      {
                        "name": "name",
                        "kind": "optional",
                        "type": "string",
                        "description": "name of document"
                      },
                      {
                        "name": "urlKey",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>url of public document, used for public access (if published)</p>"
                      },
                      {
                        "name": "urlAlias",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>In case you are migrating from another platform and you’d like to get a redirecting url to your current url, you can use this url path.</p>"
                      },
                      {
                        "name": "hidden",
                        "kind": "optional",
                        "type": "boolean",
                        "description": "indicates if document is hidden"
                      },
                      {
                        "name": "privacy",
                        "kind": "optional",
                        "type": "string<private | shared with team | public-via-link | public>",
                        "description": "<p>describes how to access the document via public url (if published)</p>",
                        "enum": [
                          "private",
                          "shared with team",
                          "public-via-link",
                          "public"
                        ]
                      },
                      {
                        "name": "highlight",
                        "kind": "optional",
                        "type": "object",
                        "description": "<p>text from document, similar with query (word-based search only)</p>",
                        "example": "",
                        "schema": []
                      }
                    ]
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Response400",
            "schema": [
              {
                "name": "status",
                "kind": "optional",
                "type": "string<OK | Not OK>",
                "description": "Response Status",
                "example": "Not OK",
                "enum": [
                  "OK",
                  "Not OK"
                ]
              },
              {
                "name": "messages",
                "kind": "optional",
                "type": "array",
                "description": "Array of messages",
                "example": "[\"Some error message\"]",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "Some error message",
                "itemDefault": ""
              }
            ],
            "modelRef": "#/components/schemas/Response400",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "v58TGafXWEpNLJXfVACy5",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.archbee.com/api/public-api/docs/search \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"query\": \"\"\n     }'"
        },
        {
          "id": "6378oS4r4PKbSD8eP0Sef",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"query\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.archbee.com/api/public-api/docs/search\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "Q65gNnunBn0_zpdYzmVhD",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.archbee.com/api/public-api/docs/search\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"query\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "GdtcxPQAphObUc5NZAcXV",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.archbee.com/api/public-api/docs/search\"\n\npayload = json.dumps({\n   \"query\": \"\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "v58TGafXWEpNLJXfVACy5"
    },
    "results": {
      "languages": [
        {
          "id": "L-_VfTLMpCpShfeAhyWTr",
          "language": "200",
          "code": "// Process status\n{\n  \"status\": \"\",\n  \"data\": {\n    \"searchSessionId\": \"\",\n    \"docs\": [\n      {\n        \"id\": \"\",\n        \"name\": \"\",\n        \"urlKey\": \"\",\n        \"urlAlias\": \"\",\n        \"hidden\": false,\n        \"privacy\": \"\",\n        \"highlight\": {}\n      }\n    ]\n  }\n}"
        },
        {
          "id": "xYJNyjBoOLODz8AcIQUSb",
          "language": "400",
          "code": "// Invalid request\n{\n  \"status\": \"Not OK\",\n  \"messages\": [\n    \"Some error message\"\n  ]\n}"
        }
      ],
      "selectedLanguageId": "L-_VfTLMpCpShfeAhyWTr"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}