Skip to content

API reference

Search document content

documents.SearchDocumentContentReadAPI key

Search the text of readable files and return matching excerpts and file IDs. Results may combine keyword and semantic matching; scores are relative to this search, not percentages.

POST/v1/operations/documents.SearchDocumentContent
On this page

Access & visibility

Allow documents.SearchDocumentContent on your API key.

Workspace access by default. Private member data requires approved member delegation through Brigg-Act-As; the key supplies permissions while private ownership and project boundaries remain enforced.

Set up authentication · Choose permissions

Request fields

Send a JSON object with the following fields. Required fields must be included; omit optional fields you do not need.

querystringRequired

Text to search for.

At least 1 character. At most 400 characters.

limitintegerOptional

Maximum number of matching results to return. This operation does not provide a continuation cursor.

Range: 1 to 50.

Response

Returns 200 OK with a JSON body.

This operation has no continuation cursor. An empty items array means no matching visible results were returned.

itemsarray of Document search resultRequired

Content matches in documents visible to the caller, bounded by limit. This operation has no cursor pagination.

Item fields
file_idnull or stringRequired

Stable file ID returned by documents.CompleteUpload, documents.ListDocuments or a document creation operation. Use the same ID for downloads, attachments and supported file-based workflows. Do not use a filename or storage path.

filenamenull or stringRequired

Original filename, including its extension.

scopenull or stringRequired

Document collection containing this match: org, user or resources.

pathnull or stringRequired

Folder path within the selected document collection. An empty string is its root.

snippetstringRequired

A short excerpt showing why the result matched.

scorenumberRequired

Search relevance score; use it for ranking results within this response, not as a probability.

channelsarray of stringRequired

Search methods that contributed to this match.

Each item: "keyword", "semantic".

Errors & retries

This operation reads data. It needs no idempotency key and can be retried after a transient failure.

For rate limits, follow the server’s retry guidance and back off. See HTTP errors and safe retries and limits.

HTTP status Code What to do
400 invalid_json Send a JSON object with Content-Type: application/json.
400 invalid_input Check the request fields and types.
401 invalid_key The workspace API key is missing, invalid or revoked.
403 forbidden Check the key’s operation and resource grants. If Brigg-Act-As is supplied, the key must be authorized to delegate to that member.
404 not_found The requested operation or resource is not available to this credential.
429 rate_limited Wait for Retry-After before retrying.

Next steps

Download OpenAPI · Versioning & retirement

JSON schemas

Use the complete schemas for validation or client generation.

Full request JSON schema
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 400,
      "description": "Text to search for."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 50,
      "description": "Maximum number of matching results to return. This operation does not provide a continuation cursor."
    }
  },
  "required": [
    "query"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "query": "onboarding"
    }
  ]
}
Full response JSON schema
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "title": "Document search result",
        "type": "object",
        "properties": {
          "file_id": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Stable file ID returned by documents.CompleteUpload, documents.ListDocuments or a document creation operation. Use the same ID for downloads, attachments and supported file-based workflows. Do not use a filename or storage path.",
            "examples": [
              "file_proposal"
            ]
          },
          "filename": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Original filename, including its extension.",
            "examples": [
              "Proposal.pdf"
            ]
          },
          "scope": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Document collection containing this match: org, user or resources.",
            "examples": [
              "org"
            ]
          },
          "path": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Folder path within the selected document collection. An empty string is its root.",
            "examples": [
              "Proposals"
            ]
          },
          "snippet": {
            "type": "string",
            "description": "A short excerpt showing why the result matched.",
            "examples": [
              "The project includes onboarding and support."
            ]
          },
          "score": {
            "type": "number",
            "description": "Search relevance score; use it for ranking results within this response, not as a probability.",
            "examples": [
              0.82
            ]
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "keyword",
                "semantic"
              ]
            },
            "description": "Search methods that contributed to this match."
          }
        },
        "required": [
          "file_id",
          "filename",
          "scope",
          "path",
          "snippet",
          "score",
          "channels"
        ],
        "additionalProperties": false
      },
      "description": "Content matches in documents visible to the caller, bounded by limit. This operation has no cursor pagination."
    }
  },
  "required": [
    "items"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "items": [
        {
          "file_id": "file_proposal",
          "filename": "Proposal.pdf",
          "scope": "org",
          "path": "Proposals",
          "snippet": "The project includes onboarding and support.",
          "score": 0.82,
          "channels": []
        }
      ]
    }
  ]
}

Search by operation name or what you want to build.

Use arrow keys to browse. Enter opens a result.