curl --request POST \
  --url https://{domain}-be.glean.com/rest/api/v1/ask \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "detectOnly": true,
  "AskExperimentalMetadata": {
    "QueryHasMentions": true,
    "QueryIsLengthAppropriate": true,
    "QueryIsAnswerable": true
  },
  "searchRequest": {
    "trackingToken": "trackingToken",
    "query": "vacation policy",
    "pageSize": 10,
    "requestOptions": {
      "facetFilters": [
        {
          "fieldName": "type",
          "values": [
            {
              "value": "article",
              "relationType": "EQUALS"
            },
            {
              "value": "document",
              "relationType": "EQUALS"
            }
          ]
        },
        {
          "fieldName": "department",
          "values": [
            {
              "value": "engineering",
              "relationType": "EQUALS"
            }
          ]
        }
      ]
    }
  },
  "excludedDocumentSpecs": [
    {
      "url": "<string>"
    }
  ],
  "operators": "<string>",
  "backend": "SEARCH",
  "chatApplicationId": "<string>",
  "inclusions": {
    "containerSpecs": [
      {
        "url": "<string>"
      }
    ],
    "documentSpecs": [
      {
        "url": "<string>"
      }
    ],
    "datasourceInstances": [
      "<string>"
    ]
  },
  "exclusions": {
    "containerSpecs": [
      {
        "url": "<string>"
      }
    ],
    "documentSpecs": [
      {
        "url": "<string>"
      }
    ],
    "datasourceInstances": [
      "<string>"
    ]
  }
}'
{
  "isQuestion": true,
  "question": "<string>",
  "searchResponse": {
    "trackingToken": "trackingToken",
    "suggestedSpellCorrectedQuery": "suggestedSpellCorrectedQuery",
    "hasMoreResults": true,
    "errorInfo": {
      "errorMessages": [
        {
          "source": "gmail",
          "errorMessage": "invalid token"
        },
        {
          "source": "slack",
          "errorMessage": "expired token"
        }
      ]
    },
    "requestID": "5e345ae500ff0befa2b9d1a3ba0001737e7363696f312d323535323137000171756572792d656e64706f696e743a323032303031333074313830343032000100",
    "results": [
      {
        "snippets": [
          {
            "snippet": "snippet",
            "mimeType": "mimeType"
          }
        ],
        "metadata": {
          "container": "container",
          "createTime": "2000-01-23T04:56:07.000Z",
          "datasource": "datasource",
          "author": {
            "name": "name"
          },
          "documentId": "documentId",
          "updateTime": "2000-01-23T04:56:07.000Z",
          "mimeType": "mimeType",
          "objectType": "objectType"
        },
        "title": "title",
        "url": "https://www.example.com/"
      },
      {
        "snippets": [
          {
            "snippet": "snippet",
            "mimeType": "mimeType"
          }
        ],
        "metadata": {
          "container": "container",
          "createTime": "2000-01-23T04:56:07.000Z",
          "datasource": "datasource",
          "author": {
            "name": "name"
          },
          "documentId": "documentId",
          "updateTime": "2000-01-23T04:56:07.000Z",
          "mimeType": "mimeType",
          "objectType": "objectType"
        },
        "title": "title",
        "url": "https://www.example.com/"
      }
    ],
    "facetResults": [
      {
        "buckets": [
          {
            "percentage": 5,
            "count": 1,
            "value": {
              "stringValue": "stringValue",
              "integerValue": 5
            }
          },
          {
            "percentage": 5,
            "count": 1,
            "value": {
              "stringValue": "stringValue",
              "integerValue": 5
            }
          }
        ],
        "sourceName": "sourceName",
        "operatorName": "operatorName",
        "objectType": "objectType"
      },
      {
        "buckets": [
          {
            "percentage": 5,
            "count": 1,
            "value": {
              "stringValue": "stringValue",
              "integerValue": 5
            }
          },
          {
            "percentage": 5,
            "count": 1,
            "value": {
              "stringValue": "stringValue",
              "integerValue": 5
            }
          }
        ],
        "sourceName": "sourceName",
        "operatorName": "operatorName",
        "objectType": "objectType"
      }
    ],
    "rewrittenQuery": "rewrittenQuery",
    "rewrittenFacetFilters": [
      {
        "fieldName": "fieldName",
        "values": [
          "fieldValues",
          "fieldValues"
        ]
      },
      {
        "fieldName": "fieldName",
        "values": [
          "fieldValues",
          "fieldValues"
        ]
      }
    ]
  },
  "chatResponse": {
    "messages": [
      {
        "agentConfig": {
          "agent": "DEFAULT",
          "mode": "DEFAULT"
        },
        "author": "USER",
        "citations": [
          {
            "trackingToken": "<string>",
            "sourceDocument": {
              "id": "<string>",
              "datasource": "<string>",
              "connectorType": "API_CRAWL",
              "docType": "<string>",
              "content": {
                "fullTextList": [
                  "<string>"
                ]
              },
              "containerDocument": {},
              "parentDocument": {},
              "title": "<string>",
              "url": "<string>",
              "metadata": {
                "container": "container",
                "parentId": "JIRA_EN-1337",
                "createTime": "2000-01-23T04:56:07.000Z",
                "datasource": "datasource",
                "author": {
                  "name": "name"
                },
                "documentId": "documentId",
                "updateTime": "2000-01-23T04:56:07.000Z",
                "mimeType": "mimeType",
                "objectType": "Feature Request",
                "components": [
                  "Backend",
                  "Networking"
                ],
                "status": [
                  "Done"
                ],
                "customData": {
                  "someCustomField": "someCustomValue"
                }
              },
              "sections": [
                {
                  "title": "<string>",
                  "url": "<string>"
                }
              ]
            },
            "sourceFile": {
              "id": "FILE_1234",
              "url": "www.google.com",
              "name": "sample.pdf",
              "metadata": {
                "status": "PROCESSING",
                "uploadTime": 123,
                "processedSize": 123,
                "failureReason": "PARSE_FAILED",
                "mimeType": "<string>"
              }
            },
            "sourcePerson": {
              "name": "George Clooney",
              "obfuscatedId": "abc123"
            },
            "referenceRanges": [
              {
                "textRange": {
                  "startIndex": 123,
                  "endIndex": 123,
                  "type": "BOLD",
                  "url": "<string>",
                  "document": {}
                },
                "snippets": [
                  {
                    "snippet": "snippet",
                    "mimeType": "mimeType"
                  }
                ]
              }
            ]
          }
        ],
        "uploadedFileIds": [
          "<string>"
        ],
        "fragments": [
          {
            "structuredResults": [
              {
                "document": {},
                "person": {
                  "name": "George Clooney",
                  "obfuscatedId": "abc123"
                },
                "customer": {
                  "id": "<string>",
                  "domains": [
                    "<string>"
                  ],
                  "company": {
                    "name": "<string>",
                    "profileUrl": "<string>",
                    "websiteUrls": [
                      "<string>"
                    ],
                    "logoUrl": "<string>",
                    "location": "New York City",
                    "phone": "<string>",
                    "fax": "<string>",
                    "industry": "Finances",
                    "annualRevenue": 123,
                    "numberOfEmployees": 123,
                    "stockSymbol": "<string>",
                    "foundedDate": "2023-12-25",
                    "about": "Financial, software, data, and media company headquartered in Midtown Manhattan, New York City"
                  },
                  "documentCounts": {},
                  "poc": [
                    {
                      "name": "George Clooney",
                      "obfuscatedId": "abc123"
                    }
                  ],
                  "metadata": {
                    "datasourceId": "<string>",
                    "customData": {}
                  },
                  "mergedCustomers": [
                    {}
                  ],
                  "startDate": "2023-12-25",
                  "contractAnnualRevenue": 123,
                  "notes": "CIO is interested in trying out the product."
                },
                "team": {
                  "relatedObjects": {},
                  "permissions": {
                    "write": {
                      "scopeType": "GLOBAL",
                      "create": true,
                      "update": true,
                      "delete": true
                    }
                  },
                  "id": "<string>",
                  "name": "<string>",
                  "description": "<string>",
                  "businessUnit": "<string>",
                  "department": "<string>",
                  "photoUrl": "<string>",
                  "bannerUrl": "<string>",
                  "externalLink": "<string>",
                  "members": [
                    {
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "relationship": "MEMBER",
                      "customRelationshipStr": "<string>",
                      "joinDate": "2023-11-07T05:31:56Z"
                    }
                  ],
                  "memberCount": 123,
                  "emails": [
                    {
                      "email": "jsmith@example.com",
                      "type": "PRIMARY",
                      "isUserGenerated": true
                    }
                  ],
                  "datasourceProfiles": [
                    {
                      "datasource": "github",
                      "handle": "<string>",
                      "url": "<string>",
                      "nativeAppUrl": "<string>",
                      "isUserGenerated": true
                    }
                  ],
                  "datasource": "<string>",
                  "createdFrom": "<string>",
                  "lastUpdatedAt": "2023-11-07T05:31:56Z",
                  "status": "PROCESSED",
                  "canBeDeleted": true,
                  "loggingId": "<string>"
                },
                "customEntity": {
                  "permissions": {
                    "write": {
                      "scopeType": "GLOBAL",
                      "create": true,
                      "update": true,
                      "delete": true
                    }
                  },
                  "id": "<string>",
                  "title": "<string>",
                  "datasource": "<string>",
                  "objectType": "<string>",
                  "metadata": {
                    "customData": {}
                  },
                  "roles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ]
                },
                "answer": {
                  "id": 3,
                  "docId": "ANSWERS_answer_3",
                  "question": "Why is the sky blue?",
                  "questionVariations": [
                    "<string>"
                  ],
                  "bodyText": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
                  "boardId": 123,
                  "audienceFilters": [
                    {
                      "fieldName": "type",
                      "values": [
                        {
                          "value": "Spreadsheet",
                          "relationType": "EQUALS"
                        },
                        {
                          "value": "Presentation",
                          "relationType": "EQUALS"
                        }
                      ]
                    }
                  ],
                  "addedRoles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ],
                  "removedRoles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ],
                  "roles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ],
                  "sourceDocumentSpec": {
                    "url": "<string>"
                  },
                  "sourceType": "DOCUMENT",
                  "permissions": {
                    "write": {
                      "scopeType": "GLOBAL",
                      "create": true,
                      "update": true,
                      "delete": true
                    }
                  },
                  "combinedAnswerText": {
                    "text": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
                    "structuredList": [
                      {
                        "link": "https://en.wikipedia.org/wiki/Diffuse_sky_radiation",
                        "document": {},
                        "text": "Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."
                      }
                    ]
                  },
                  "likes": {
                    "likedBy": [
                      {
                        "user": {
                          "name": "George Clooney",
                          "obfuscatedId": "abc123"
                        },
                        "createTime": "2023-11-07T05:31:56Z"
                      }
                    ],
                    "likedByUser": true,
                    "numLikes": 123
                  },
                  "author": {
                    "name": "George Clooney",
                    "obfuscatedId": "abc123"
                  },
                  "createTime": "2023-11-07T05:31:56Z",
                  "updateTime": "2023-11-07T05:31:56Z",
                  "updatedBy": {
                    "name": "George Clooney",
                    "obfuscatedId": "abc123"
                  },
                  "verification": {
                    "state": "UNVERIFIED",
                    "metadata": {
                      "lastVerifier": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "lastVerificationTs": 123,
                      "expirationTs": 123,
                      "document": {},
                      "reminders": [
                        {
                          "assignee": {
                            "name": "George Clooney",
                            "obfuscatedId": "abc123"
                          },
                          "requestor": {
                            "name": "George Clooney",
                            "obfuscatedId": "abc123"
                          },
                          "remindAt": 123,
                          "createdAt": 123,
                          "reason": "<string>"
                        }
                      ],
                      "lastReminder": {
                        "assignee": {
                          "name": "George Clooney",
                          "obfuscatedId": "abc123"
                        },
                        "requestor": {
                          "name": "George Clooney",
                          "obfuscatedId": "abc123"
                        },
                        "remindAt": 123,
                        "createdAt": 123,
                        "reason": "<string>"
                      },
                      "visitorCount": [
                        {
                          "count": 123,
                          "period": {
                            "minDaysFromNow": 123,
                            "maxDaysFromNow": 123,
                            "start": {
                              "epochSeconds": 123,
                              "daysFromNow": 123
                            },
                            "end": {
                              "epochSeconds": 123,
                              "daysFromNow": 123
                            }
                          },
                          "org": "<string>"
                        }
                      ],
                      "candidateVerifiers": [
                        {
                          "name": "George Clooney",
                          "obfuscatedId": "abc123"
                        }
                      ]
                    }
                  },
                  "board": {
                    "name": "<string>",
                    "description": "<string>",
                    "addedRoles": [
                      {
                        "sourceDocumentSpec": {
                          "url": "<string>"
                        },
                        "person": {
                          "name": "George Clooney",
                          "obfuscatedId": "abc123"
                        },
                        "group": {
                          "type": "DEPARTMENT",
                          "id": "<string>",
                          "name": "<string>"
                        },
                        "role": "OWNER"
                      }
                    ],
                    "removedRoles": [
                      {
                        "sourceDocumentSpec": {
                          "url": "<string>"
                        },
                        "person": {
                          "name": "George Clooney",
                          "obfuscatedId": "abc123"
                        },
                        "group": {
                          "type": "DEPARTMENT",
                          "id": "<string>",
                          "name": "<string>"
                        },
                        "role": "OWNER"
                      }
                    ],
                    "audienceFilters": [
                      {
                        "fieldName": "type",
                        "values": [
                          {
                            "value": "Spreadsheet",
                            "relationType": "EQUALS"
                          },
                          {
                            "value": "Presentation",
                            "relationType": "EQUALS"
                          }
                        ]
                      }
                    ],
                    "permissions": {
                      "write": {
                        "scopeType": "GLOBAL",
                        "create": true,
                        "update": true,
                        "delete": true
                      }
                    },
                    "id": 123,
                    "createTime": "2023-11-07T05:31:56Z",
                    "updateTime": "2023-11-07T05:31:56Z",
                    "creator": {
                      "name": "George Clooney",
                      "obfuscatedId": "abc123"
                    },
                    "updatedBy": {
                      "name": "George Clooney",
                      "obfuscatedId": "abc123"
                    },
                    "itemCount": 123,
                    "roles": [
                      {
                        "sourceDocumentSpec": {
                          "url": "<string>"
                        },
                        "person": {
                          "name": "George Clooney",
                          "obfuscatedId": "abc123"
                        },
                        "group": {
                          "type": "DEPARTMENT",
                          "id": "<string>",
                          "name": "<string>"
                        },
                        "role": "OWNER"
                      }
                    ]
                  },
                  "collections": [
                    {
                      "name": "<string>",
                      "description": "<string>",
                      "addedRoles": [
                        {
                          "sourceDocumentSpec": {
                            "url": "<string>"
                          },
                          "person": {
                            "name": "George Clooney",
                            "obfuscatedId": "abc123"
                          },
                          "group": {
                            "type": "DEPARTMENT",
                            "id": "<string>",
                            "name": "<string>"
                          },
                          "role": "OWNER"
                        }
                      ],
                      "removedRoles": [
                        {
                          "sourceDocumentSpec": {
                            "url": "<string>"
                          },
                          "person": {
                            "name": "George Clooney",
                            "obfuscatedId": "abc123"
                          },
                          "group": {
                            "type": "DEPARTMENT",
                            "id": "<string>",
                            "name": "<string>"
                          },
                          "role": "OWNER"
                        }
                      ],
                      "audienceFilters": [
                        {
                          "fieldName": "type",
                          "values": [
                            {
                              "value": "Spreadsheet",
                              "relationType": "EQUALS"
                            },
                            {
                              "value": "Presentation",
                              "relationType": "EQUALS"
                            }
                          ]
                        }
                      ],
                      "icon": "<string>",
                      "adminLocked": true,
                      "parentId": 123,
                      "thumbnail": {
                        "photoId": "<string>",
                        "url": "<string>"
                      },
                      "allowedDatasource": "<string>",
                      "permissions": {
                        "write": {
                          "scopeType": "GLOBAL",
                          "create": true,
                          "update": true,
                          "delete": true
                        }
                      },
                      "id": 123,
                      "createTime": "2023-11-07T05:31:56Z",
                      "updateTime": "2023-11-07T05:31:56Z",
                      "creator": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "updatedBy": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "itemCount": 123,
                      "childCount": 123,
                      "items": [
                        {
                          "name": "<string>",
                          "description": "<string>",
                          "icon": "<string>",
                          "collectionId": 123,
                          "documentId": "<string>",
                          "url": "<string>",
                          "itemId": "<string>",
                          "createdBy": {
                            "name": "George Clooney",
                            "obfuscatedId": "abc123"
                          },
                          "createdAt": "2023-11-07T05:31:56Z",
                          "document": {},
                          "shortcut": {
                            "id": 123,
                            "inputAlias": "<string>",
                            "destinationUrl": "<string>",
                            "destinationDocumentId": "<string>",
                            "description": "<string>",
                            "unlisted": true,
                            "urlTemplate": "<string>",
                            "addedRoles": [
                              {
                                "sourceDocumentSpec": {
                                  "url": "<string>"
                                },
                                "person": {
                                  "name": "George Clooney",
                                  "obfuscatedId": "abc123"
                                },
                                "group": {
                                  "type": "DEPARTMENT",
                                  "id": "<string>",
                                  "name": "<string>"
                                },
                                "role": "OWNER"
                              }
                            ],
                            "removedRoles": [
                              {
                                "sourceDocumentSpec": {
                                  "url": "<string>"
                                },
                                "person": {
                                  "name": "George Clooney",
                                  "obfuscatedId": "abc123"
                                },
                                "group": {
                                  "type": "DEPARTMENT",
                                  "id": "<string>",
                                  "name": "<string>"
                                },
                                "role": "OWNER"
                              }
                            ],
                            "permissions": {
                              "write": {
                                "scopeType": "GLOBAL",
                                "create": true,
                                "update": true,
                                "delete": true
                              }
                            },
                            "createdBy": {
                              "name": "George Clooney",
                              "obfuscatedId": "abc123"
                            },
                            "createTime": "2023-11-07T05:31:56Z",
                            "updatedBy": {
                              "name": "George Clooney",
                              "obfuscatedId": "abc123"
                            },
                            "updateTime": "2023-11-07T05:31:56Z",
                            "destinationDocument": {},
                            "intermediateUrl": "<string>",
                            "viewPrefix": "<string>",
                            "isExternal": true,
                            "editUrl": "<string>",
                            "alias": "<string>",
                            "title": "<string>",
                            "roles": [
                              {
                                "sourceDocumentSpec": {
                                  "url": "<string>"
                                },
                                "person": {
                                  "name": "George Clooney",
                                  "obfuscatedId": "abc123"
                                },
                                "group": {
                                  "type": "DEPARTMENT",
                                  "id": "<string>",
                                  "name": "<string>"
                                },
                                "role": "OWNER"
                              }
                            ]
                          },
                          "collection": "<any>",
                          "itemType": "DOCUMENT"
                        }
                      ],
                      "pinMetadata": {
                        "existingPins": [
                          {
                            "category": "COMPANY_RESOURCE",
                            "value": "<string>",
                            "target": "RESOURCE_CARD"
                          }
                        ],
                        "eligiblePins": [
                          {
                            "id": 123,
                            "target": {
                              "category": "COMPANY_RESOURCE",
                              "value": "<string>",
                              "target": "RESOURCE_CARD"
                            }
                          }
                        ]
                      },
                      "shortcuts": [
                        "<string>"
                      ],
                      "children": [
                        "<any>"
                      ],
                      "roles": [
                        {
                          "sourceDocumentSpec": {
                            "url": "<string>"
                          },
                          "person": {
                            "name": "George Clooney",
                            "obfuscatedId": "abc123"
                          },
                          "group": {
                            "type": "DEPARTMENT",
                            "id": "<string>",
                            "name": "<string>"
                          },
                          "role": "OWNER"
                        }
                      ]
                    }
                  ],
                  "documentCategory": "<string>",
                  "sourceDocument": {}
                },
                "extractedQnA": {
                  "heading": "<string>",
                  "question": "<string>",
                  "questionResult": "<any>"
                },
                "meeting": {
                  "id": "<string>",
                  "title": "<string>",
                  "description": "<string>",
                  "url": "<string>",
                  "startTime": "2023-11-07T05:31:56Z",
                  "endTime": "2023-11-07T05:31:56Z",
                  "attendees": {
                    "people": [
                      {
                        "isOrganizer": true,
                        "isInGroup": true,
                        "person": {
                          "name": "George Clooney",
                          "obfuscatedId": "abc123"
                        },
                        "groupAttendees": [
                          {}
                        ],
                        "responseStatus": "ACCEPTED"
                      }
                    ],
                    "isLimit": true,
                    "total": 123,
                    "numAccepted": 123,
                    "numDeclined": 123,
                    "numNoResponse": 123,
                    "numTentative": 123
                  }
                },
                "app": {
                  "datasource": "<string>",
                  "docType": "<string>",
                  "mimeType": "<string>",
                  "iconUrl": "<string>"
                },
                "collection": {
                  "name": "<string>",
                  "description": "<string>",
                  "addedRoles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ],
                  "removedRoles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ],
                  "audienceFilters": [
                    {
                      "fieldName": "type",
                      "values": [
                        {
                          "value": "Spreadsheet",
                          "relationType": "EQUALS"
                        },
                        {
                          "value": "Presentation",
                          "relationType": "EQUALS"
                        }
                      ]
                    }
                  ],
                  "icon": "<string>",
                  "adminLocked": true,
                  "parentId": 123,
                  "thumbnail": {
                    "photoId": "<string>",
                    "url": "<string>"
                  },
                  "allowedDatasource": "<string>",
                  "permissions": {
                    "write": {
                      "scopeType": "GLOBAL",
                      "create": true,
                      "update": true,
                      "delete": true
                    }
                  },
                  "id": 123,
                  "createTime": "2023-11-07T05:31:56Z",
                  "updateTime": "2023-11-07T05:31:56Z",
                  "creator": {
                    "name": "George Clooney",
                    "obfuscatedId": "abc123"
                  },
                  "updatedBy": {
                    "name": "George Clooney",
                    "obfuscatedId": "abc123"
                  },
                  "itemCount": 123,
                  "childCount": 123,
                  "items": [
                    {
                      "name": "<string>",
                      "description": "<string>",
                      "icon": "<string>",
                      "collectionId": 123,
                      "documentId": "<string>",
                      "url": "<string>",
                      "itemId": "<string>",
                      "createdBy": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "createdAt": "2023-11-07T05:31:56Z",
                      "document": {},
                      "shortcut": {
                        "id": 123,
                        "inputAlias": "<string>",
                        "destinationUrl": "<string>",
                        "destinationDocumentId": "<string>",
                        "description": "<string>",
                        "unlisted": true,
                        "urlTemplate": "<string>",
                        "addedRoles": [
                          {
                            "sourceDocumentSpec": {
                              "url": "<string>"
                            },
                            "person": {
                              "name": "George Clooney",
                              "obfuscatedId": "abc123"
                            },
                            "group": {
                              "type": "DEPARTMENT",
                              "id": "<string>",
                              "name": "<string>"
                            },
                            "role": "OWNER"
                          }
                        ],
                        "removedRoles": [
                          {
                            "sourceDocumentSpec": {
                              "url": "<string>"
                            },
                            "person": {
                              "name": "George Clooney",
                              "obfuscatedId": "abc123"
                            },
                            "group": {
                              "type": "DEPARTMENT",
                              "id": "<string>",
                              "name": "<string>"
                            },
                            "role": "OWNER"
                          }
                        ],
                        "permissions": {
                          "write": {
                            "scopeType": "GLOBAL",
                            "create": true,
                            "update": true,
                            "delete": true
                          }
                        },
                        "createdBy": {
                          "name": "George Clooney",
                          "obfuscatedId": "abc123"
                        },
                        "createTime": "2023-11-07T05:31:56Z",
                        "updatedBy": {
                          "name": "George Clooney",
                          "obfuscatedId": "abc123"
                        },
                        "updateTime": "2023-11-07T05:31:56Z",
                        "destinationDocument": {},
                        "intermediateUrl": "<string>",
                        "viewPrefix": "<string>",
                        "isExternal": true,
                        "editUrl": "<string>",
                        "alias": "<string>",
                        "title": "<string>",
                        "roles": [
                          {
                            "sourceDocumentSpec": {
                              "url": "<string>"
                            },
                            "person": {
                              "name": "George Clooney",
                              "obfuscatedId": "abc123"
                            },
                            "group": {
                              "type": "DEPARTMENT",
                              "id": "<string>",
                              "name": "<string>"
                            },
                            "role": "OWNER"
                          }
                        ]
                      },
                      "collection": "<any>",
                      "itemType": "DOCUMENT"
                    }
                  ],
                  "pinMetadata": {
                    "existingPins": [
                      {
                        "category": "COMPANY_RESOURCE",
                        "value": "<string>",
                        "target": "RESOURCE_CARD"
                      }
                    ],
                    "eligiblePins": [
                      {
                        "id": 123,
                        "target": {
                          "category": "COMPANY_RESOURCE",
                          "value": "<string>",
                          "target": "RESOURCE_CARD"
                        }
                      }
                    ]
                  },
                  "shortcuts": [
                    "<string>"
                  ],
                  "children": [
                    "<any>"
                  ],
                  "roles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ]
                },
                "answerBoard": {
                  "name": "<string>",
                  "description": "<string>",
                  "addedRoles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ],
                  "removedRoles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ],
                  "audienceFilters": [
                    {
                      "fieldName": "type",
                      "values": [
                        {
                          "value": "Spreadsheet",
                          "relationType": "EQUALS"
                        },
                        {
                          "value": "Presentation",
                          "relationType": "EQUALS"
                        }
                      ]
                    }
                  ],
                  "permissions": {
                    "write": {
                      "scopeType": "GLOBAL",
                      "create": true,
                      "update": true,
                      "delete": true
                    }
                  },
                  "id": 123,
                  "createTime": "2023-11-07T05:31:56Z",
                  "updateTime": "2023-11-07T05:31:56Z",
                  "creator": {
                    "name": "George Clooney",
                    "obfuscatedId": "abc123"
                  },
                  "updatedBy": {
                    "name": "George Clooney",
                    "obfuscatedId": "abc123"
                  },
                  "itemCount": 123,
                  "roles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ]
                },
                "code": {
                  "repoName": "scio",
                  "fileName": "README.md",
                  "matches": [
                    {
                      "lineNumber": 1,
                      "content": "Welcome to the beginning",
                      "ranges": []
                    },
                    {
                      "lineNumber": 2,
                      "content": "Second line of the file",
                      "ranges": []
                    },
                    {
                      "lineNumber": 3,
                      "content": "hello world hello world",
                      "ranges": [
                        {
                          "startindex": 0,
                          "endIndex": 5
                        },
                        {
                          "startIndex": 12,
                          "endIndex": 17
                        }
                      ]
                    }
                  ]
                },
                "shortcut": {
                  "id": 123,
                  "inputAlias": "<string>",
                  "destinationUrl": "<string>",
                  "destinationDocumentId": "<string>",
                  "description": "<string>",
                  "unlisted": true,
                  "urlTemplate": "<string>",
                  "addedRoles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ],
                  "removedRoles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ],
                  "permissions": {
                    "write": {
                      "scopeType": "GLOBAL",
                      "create": true,
                      "update": true,
                      "delete": true
                    }
                  },
                  "createdBy": {
                    "name": "George Clooney",
                    "obfuscatedId": "abc123"
                  },
                  "createTime": "2023-11-07T05:31:56Z",
                  "updatedBy": {
                    "name": "George Clooney",
                    "obfuscatedId": "abc123"
                  },
                  "updateTime": "2023-11-07T05:31:56Z",
                  "destinationDocument": {},
                  "intermediateUrl": "<string>",
                  "viewPrefix": "<string>",
                  "isExternal": true,
                  "editUrl": "<string>",
                  "alias": "<string>",
                  "title": "<string>",
                  "roles": [
                    {
                      "sourceDocumentSpec": {
                        "url": "<string>"
                      },
                      "person": {
                        "name": "George Clooney",
                        "obfuscatedId": "abc123"
                      },
                      "group": {
                        "type": "DEPARTMENT",
                        "id": "<string>",
                        "name": "<string>"
                      },
                      "role": "OWNER"
                    }
                  ]
                },
                "querySuggestions": {
                  "suggestions": [
                    {
                      "query": "app:github type:pull author:mortimer",
                      "label": "Mortimer's PRs",
                      "datasource": "github"
                    }
                  ],
                  "person": {
                    "name": "George Clooney",
                    "obfuscatedId": "abc123"
                  }
                },
                "relatedDocuments": [
                  {}
                ],
                "relatedQuestion": {
                  "question": "<string>",
                  "answer": "<string>",
                  "ranges": [
                    {
                      "startIndex": 123,
                      "endIndex": 123,
                      "type": "BOLD",
                      "url": "<string>",
                      "document": {}
                    }
                  ]
                },
                "disambiguation": {
                  "name": "<string>",
                  "id": "<string>",
                  "type": "PERSON"
                },
                "snippets": [
                  {
                    "snippet": "snippet",
                    "mimeType": "mimeType"
                  }
                ],
                "trackingToken": "<string>",
                "prominence": "HERO",
                "source": "EXPERT_DETECTION"
              }
            ],
            "trackingToken": "<string>",
            "text": "<string>",
            "querySuggestion": {
              "query": "app:github type:pull author:mortimer",
              "label": "Mortimer's PRs",
              "datasource": "github"
            },
            "file": {
              "id": "FILE_1234",
              "url": "www.google.com",
              "name": "sample.pdf",
              "metadata": {
                "status": "PROCESSING",
                "uploadTime": 123,
                "processedSize": 123,
                "failureReason": "PARSE_FAILED",
                "mimeType": "<string>"
              }
            },
            "action": {
              "metadata": {
                "type": "RETRIEVAL",
                "name": "<string>",
                "displayName": "<string>",
                "toolId": "<string>",
                "displayDescription": "<string>",
                "logoUrl": "<string>",
                "objectName": [
                  "HR ticket",
                  "Email",
                  "Chat message"
                ],
                "knowledgeType": "NEUTRAL_KNOWLEDGE",
                "createdBy": {
                  "name": "<string>",
                  "obfuscatedId": "<string>"
                },
                "lastUpdatedBy": {
                  "name": "<string>",
                  "obfuscatedId": "<string>"
                },
                "createdAt": "2023-11-07T05:31:56Z",
                "lastUpdatedAt": "2023-11-07T05:31:56Z",
                "writeActionType": "REDIRECT",
                "authType": "NONE",
                "auth": {
                  "isOnPrem": true,
                  "usesCentralAuth": true,
                  "type": "NONE",
                  "grantType": "AUTH_CODE",
                  "status": "AWAITING_AUTH",
                  "client_url": "<string>",
                  "scopes": [
                    "<string>"
                  ],
                  "audiences": [
                    "<string>"
                  ],
                  "authorization_url": "<string>",
                  "lastAuthorizedAt": "2023-11-07T05:31:56Z"
                },
                "permissions": {
                  "write": {
                    "scopeType": "GLOBAL",
                    "create": true,
                    "update": true,
                    "delete": true
                  }
                },
                "usageInstructions": "<string>",
                "isSetupFinished": true
              },
              "parameters": {}
            }
          }
        ],
        "ts": "<string>",
        "messageId": "<string>",
        "messageTrackingToken": "<string>",
        "messageType": "CONTENT",
        "hasMoreFragments": true
      }
    ],
    "chatId": "<string>",
    "followUpPrompts": [
      "<string>"
    ],
    "backendTimeMillis": 1100,
    "chatSessionTrackingToken": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Scio-Actas
string

Email address of a user on whose behalf the request is intended to be made (should be non-empty only for global tokens).

X-Glean-Auth-Type
string

Auth type being used to access the endpoint (should be non-empty only for global tokens).

Body

application/json
Ask request
searchRequest
object
required
Example:
{
  "trackingToken": "trackingToken",
  "query": "vacation policy",
  "pageSize": 10,
  "requestOptions": {
    "facetFilters": [
      {
        "fieldName": "type",
        "values": [
          {
            "value": "article",
            "relationType": "EQUALS"
          },
          {
            "value": "document",
            "relationType": "EQUALS"
          }
        ]
      },
      {
        "fieldName": "department",
        "values": [
          {
            "value": "engineering",
            "relationType": "EQUALS"
          }
        ]
      }
    ]
  }
}
detectOnly
boolean

Whether to apply only question detection and not answering.

AskExperimentalMetadata
object

Additional metadata about the query.

excludedDocumentSpecs
object[]
deprecated

A list of Glean Document IDs to be excluded when retrieving documents. Note that, currently, it only supports exclusion of one Glean Documnet ID based spec. If multiple specifications are provided only the first Glean Document ID based spec is excluded and the remaining specs are ignored.

operators
string

Search operators to append to the query

backend
enum<string>

Which backend to use to fulfill the requests.

Available options:
SEARCH,
CHAT
chatApplicationId
string

The ID of the application this request originates from, used to determine the configuration of underlying chat processes when invoking the CHAT backend. This should correspond to the ID set during admin setup. If not specified, the default chat experience will be used.

inclusions
object

A list of filters which only allows chat to access certain content.

exclusions
object

A list of filters which disallows chat from accessing certain content.

Response

200
application/json
OK
isQuestion
boolean
required

Whether or not the query was a question.

question
string

The part of the query which was used as a question for search

searchResponse
object
Example:
{
  "trackingToken": "trackingToken",
  "suggestedSpellCorrectedQuery": "suggestedSpellCorrectedQuery",
  "hasMoreResults": true,
  "errorInfo": {
    "errorMessages": [
      {
        "source": "gmail",
        "errorMessage": "invalid token"
      },
      {
        "source": "slack",
        "errorMessage": "expired token"
      }
    ]
  },
  "requestID": "5e345ae500ff0befa2b9d1a3ba0001737e7363696f312d323535323137000171756572792d656e64706f696e743a323032303031333074313830343032000100",
  "results": [
    {
      "snippets": [
        {
          "snippet": "snippet",
          "mimeType": "mimeType"
        }
      ],
      "metadata": {
        "container": "container",
        "createTime": "2000-01-23T04:56:07.000Z",
        "datasource": "datasource",
        "author": { "name": "name" },
        "documentId": "documentId",
        "updateTime": "2000-01-23T04:56:07.000Z",
        "mimeType": "mimeType",
        "objectType": "objectType"
      },
      "title": "title",
      "url": "https://www.example.com/"
    },
    {
      "snippets": [
        {
          "snippet": "snippet",
          "mimeType": "mimeType"
        }
      ],
      "metadata": {
        "container": "container",
        "createTime": "2000-01-23T04:56:07.000Z",
        "datasource": "datasource",
        "author": { "name": "name" },
        "documentId": "documentId",
        "updateTime": "2000-01-23T04:56:07.000Z",
        "mimeType": "mimeType",
        "objectType": "objectType"
      },
      "title": "title",
      "url": "https://www.example.com/"
    }
  ],
  "facetResults": [
    {
      "buckets": [
        {
          "percentage": 5,
          "count": 1,
          "value": {
            "stringValue": "stringValue",
            "integerValue": 5
          }
        },
        {
          "percentage": 5,
          "count": 1,
          "value": {
            "stringValue": "stringValue",
            "integerValue": 5
          }
        }
      ],
      "sourceName": "sourceName",
      "operatorName": "operatorName",
      "objectType": "objectType"
    },
    {
      "buckets": [
        {
          "percentage": 5,
          "count": 1,
          "value": {
            "stringValue": "stringValue",
            "integerValue": 5
          }
        },
        {
          "percentage": 5,
          "count": 1,
          "value": {
            "stringValue": "stringValue",
            "integerValue": 5
          }
        }
      ],
      "sourceName": "sourceName",
      "operatorName": "operatorName",
      "objectType": "objectType"
    }
  ],
  "rewrittenQuery": "rewrittenQuery",
  "rewrittenFacetFilters": [
    {
      "fieldName": "fieldName",
      "values": ["fieldValues", "fieldValues"]
    },
    {
      "fieldName": "fieldName",
      "values": ["fieldValues", "fieldValues"]
    }
  ]
}
chatResponse
object

A single response from the /chat backend.