Search API Documentation

POST /api/v1/search

Base URL

The base URL for all API requests is: https://{your_subdomain}.nousai.com. You can use the subdomain provided to you by Nous AI.

Authentication

This endpoint requires API key authentication. You can use the x-api-key provided to you by Nous AI.

Request

Headers

NameRequiredDescription
x-api-keyYesYour API key for authentication

Body

The request body should be in JSON format with the following parameters:

ParameterTypeRequiredDescription
querystringYesThe search query string
modeenumNoThe search mode: 'fast' or 'powerful'
business_unit_namestringNoThe name of the business unit in scope
source_path_patternstringNoA regex pattern for filtering sources by their path.
source_date_thresholdstringNoThe date for filtering sources in YYYY-MM-DD format
ai_summary_formatstring | jsonNoThe desired format of the ai_summary field. Can be a string or (for structured output) a JSON schema.

The only required parameter is query.

You can optionally include the following parameters in the request body:

  • mode, which determines the search mode. Valid options are: 'fast' and 'powerful'. If not specified, uses the tenant's configured default search mode.
  • business_unit_name, which specifies that the response should only consider sources associated with the business unit specified plus any "shared" sources (i.e., sources with no business unit assignment).
  • source_path_pattern, which allows you to filter sources using regex patterns matched against the source path. For webpages, the source path is the URL; for files, it is the file path. Pattern matching is case-insensitive. Note that this parameter does not impact or limit media search results.
  • source_date_threshold, which specifies that the response should only consider sources dated on or after the given date. Generally, you won't need to use this parameter, as newer sources are automatically prioritized when recency is important for the search query.
  • ai_summary_format, which allows you to customize the ai_summary field in the response by specifying its output format (such as a JSON object or a list, instead of a plain string) and other attributes like the desired length and tone of voice. By default, the ai_summary will be provided in Markdown format. This parameter is particularly useful for obtaining structured output in a custom schema of your preference. Pass a JSON schema describing the desired structure, and the response will conform to that format.
Example Request Body
{
    "query": "What's expected to happen with interest rates?"
}
Example Request Body with additional parameters
{
    "query": "What is our Q4 strategy?",
    "mode": "powerful",
    "business_unit_name": "North Star Division",
    "source_path_pattern": ".*marketing.*\\.pptx$",
    "source_date_threshold": "2025-07-01",
    "ai_summary_format": "500 words, avoid jargon"
}
Example Request Body with structured output schema
{
    "query": "What are our 5 biggest holdings?",
    "ai_summary_format": {
        "introduction": "<string> // 30 words",
        "items": [
            {
                "name": "<string> // Name of the holding",
                "value": "<float> // Value of the holding. 2 decimals."
            }
        ],
        "total": "<float> // Sum of item values. 2 decimals."
    }
}

Response

Success Response

  • Code: 200 OK
  • Content-Type: application/json
Example Response Body
{
    "ai_summary": "Interest rates are expected to...",
    "documents": [
        {
        "source": {
            "title": "Global Markets Outlook",
            "path": "https://www.example.com/global-markets-outlook",
        }
        "date": "2025-21-01",
        "extract": "We believe that interest rates are going to...",
        },
        // more document results...
    ]
    "media": [
        "/media/image.png"
    ]
}

Error Responses

Invalid API Key

  • Code: 403 Forbidden
  • Content: {"detail": "Invalid API key"}

Missing Required Parameter

  • Code: 400 Bad Request
  • Content: {"query": "This field is missing"}

Invalid Parameter Value

  • Code: 400 Bad Request
  • Content: {"detail": "Invalid business unit name."}

GET /api/v1/search-history

Base URL

The base URL for all API requests is: https://{your_subdomain}.nousai.com. You can use the subdomain provided to you by Nous AI.

Authentication

This endpoint requires API key authentication. You can use the x-api-key provided to you by Nous AI.

Request

Headers

NameRequiredDescription
x-api-keyYesYour API key for authentication

Query Parameters

ParameterTypeRequiredDescription
query_idUUIDNoIf provided, the response will be limited to the query with this unique identifier.
earliest_dateDateNoIf provided, only queries created on or after this date will be included in the response. Format: YYYY-MM-DD.
max_resultsIntegerNoThe maximum number of queries to return in the response. The value must be an integer between 1 and 1,000. If not provided, a default limit of 100 will be applied.
include_resultsBooleanNoA boolean value indicating whether to include the search results associated with each query in the response. Defaults to false. Set to true to include results.
Example Request
GET /api/v1/search-history?include_results=true HTTP/1.1
        Host: your-subdomain.nousai.com
        x-api-key: your-api-key

Response

Success Response

  • Code: 200 OK
  • Content-Type: application/json
Example Response Body
[
    {
        "id": "925fcc65-148c-11f0-9526-54e1adc13119",
        "query": "What's expected to happen with interest rates?",
        "business_unit_name": "International Markets",
        "created_on": "2025-04-08T15:17:23.227267Z",
        "results": {
            "ai_summary": "Interest rates are expected to...",
            "documents": [
                {
                "source": {
                    "title": "Global Markets Outlook",
                    "path": "https://www.example.com/global-markets-outlook",
                }
                "date": "2025-21-01",
                "extract": "We believe that interest rates are going to...",
                },
                // more document results...
            ]
            "media": [
                "/media/image.png"
            ]
        }
    },
    // more query history items...
]

Error Responses

Invalid API Key

  • Code: 403 Forbidden
  • Content: {"detail": "Invalid API key"}

Invalid Query Parameter

  • Code: 400 Bad Request
  • Content: {"error": "Invalid parameters: (list of invalid query parameters)"}

Invalid Date Format

  • Code: 400 Bad Request
  • Content: {"earliest_date": "Use this format: YYYY-MM-DD."}

POST /api/v1/questions

Base URL

The base URL for all API requests is: https://{your_subdomain}.nousai.com. You can use the subdomain provided to you by Nous AI.

Authentication

This endpoint requires API key authentication. You can use the x-api-key provided to you by Nous AI.

Request

Headers

NameRequiredDescription
x-api-keyYesYour API key for authentication

Body

The request body should be in JSON format with the following optional parameter:

ParameterTypeRequiredDescription
business_unit_namestringNoThe name of the business unit in scope

The optional business_unit_name parameter specifies that the response should only consider sources associated with the business unit specified.

Example Request Body
{
    "business_unit_name": "International Markets"
}

Response

Success Response

  • Code: 200 OK
  • Content-Type: application/json
Example Response Body
{
    "questions": [
        "What are the current market trends for Q1 2025?",
        "How do interest rate changes affect our portfolio?",
        "What are the key risk factors in emerging markets?"
    ]
}

Error Responses

Invalid API Key

  • Code: 403 Forbidden
  • Content: {"detail": "Invalid API key"}

Invalid Parameter Value

  • Code: 400 Bad Request
  • Content: {"detail": "Invalid business unit name."}