site logo

Tettra Help Docs

  • Category IconGetting Started
  • Category IconUsing Tettra
  • Category IconKai AI Features
  • Category IconIntegrations
    • Category IconSlack Integration
    • Category IconGoogle Workspace Integration
    • Category IconGitHub Integration
    • Category IconZapier Integration
    • Category IconNotion Integration
    • Category IconAPI Overview
      • What is the Tettra API?
      • How to find your API credentials
      • API Endpoint: Search
      • API Endpoint: Create Page
      • API Endpoint: Create a Question
      • API Endpoint: Suggest a New Page
      • API Endpoint: Suggest Page Update
  • Category IconUsers & Permissions
  • Category IconAccount Management
  • Category IconBilling & Payments
  • Category IconSecurity

API Endpoint: Search

The Search endpoint returns up to 5 page results for the given search term.


URL: https://app.tettra.co/api/teams/{{team_id}}/search 


HTTP Method: GET


Arguments:  

  • api_key - required - your API key 
  • query - optional - the search term; returns most recent pages if omitted

Example Request:

curl -X GET \
   -H 'Content-Type: application/json' \
   --data \
   '{
       "api_key":"xxxxxxxxxxxxxxxxxx1234567890",
       "query":"Company Holidays"
   }' \
   https://app.tettra.co/api/teams/5/search


Example Response:

{ 
  success: true,
  query: "Company Holidays",
  pages: [
     {
        id: 2,
        title: "2020 Company Holidays",
        updated_at: "2020-06-03T17:10:24.000000Z",
        url: "https://app.tettra.co/teams/example/pages/2020-company-holidays",
        content: "{"blocks":[{"key":"avkfq","text":"example content","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}}],"entityMap":{}}",
        owner: "Andy",
        category: {
           id: 1,
           name: "Office & Ops",
           url: "https://app.tettra.co/teams/example/categories/1"
        }
     }
  ]
}



Priority of search results 

Search results are given priority based on the following order:   


1. Page title matches 

2. Header matches in descending order from H1 to H3 

3. Content on a page


Related

  • API overview
Previous
How to find your API credentials
Next
API Endpoint: Create Page
Powered by Tettra