Skip to content

API reference

Search documents

documents.SearchDocumentsReadAPI key

Find readable files by a case-insensitive filename match, optionally within a folder. Use SearchDocumentContent to search the text inside documents.

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

Access & visibility

Allow documents.SearchDocuments 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.

scopestringRequired

Document collection: org is shared with the workspace; user is private to the calling person; resources contains the workspace's supplied resources. A move changes who can read the document; omit scope when only changing its folder.

Allowed: "org", "user", "resources".

querystringRequired

Text to search for.

At least 1 character. At most 200 characters.

path_prefixstringOptional

Folder-path prefix used to narrow the search.

limitintegerOptional

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

Maximum: 200. Greater than 0.

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 DocumentRequired

Documents matching the search text in the selected collection and optional folder prefix, bounded by limit. This operation has no cursor pagination.

Item fields
file_idstringRequired

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.

filenamestringRequired

Original filename, including its extension.

size_bytesnumber or nullRequired

File size in bytes. Null for a document without a downloadable binary file.

content_typestring or nullRequired

Media type of the file, such as application/pdf. Null when no binary file exists.

pathstringRequired

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

created_atnumberRequired

Creation time in Unix milliseconds.

owner_account_idstring or nullRequired

Account that owns a private document, or null for a workspace document.

created_bystring or nullRequired

Account that created the record, or null when no account is recorded.

kindstring or nullRequired

Document origin or format: user_upload, agent_generated, signed_document and other file categories; text_document identifies collaborative text, while document identifies a generated Brigg document.

scan_statusstring or nullRequired

Malware scan state. Threats and failed scans block downloads. An unsupported file cannot be processed; only its original uploader can retrieve it as a forced download. Null is not proof of readiness.

document_kindstringRequired

file = an uploaded file (its original bytes); text_document = a collaborative Tekstdokument (markdown); generated_document = a formatted document Brigg generated («Lag dokument»).

Allowed: "file", "text_document", "generated_document".

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": {
    "scope": {
      "type": "string",
      "enum": [
        "org",
        "user",
        "resources"
      ],
      "description": "Document collection: org is shared with the workspace; user is private to the calling person; resources contains the workspace's supplied resources. A move changes who can read the document; omit scope when only changing its folder."
    },
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Text to search for."
    },
    "path_prefix": {
      "type": "string",
      "description": "Folder-path prefix used to narrow the search."
    },
    "limit": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 200,
      "description": "Maximum number of matching results to return. This operation does not provide a continuation cursor."
    }
  },
  "required": [
    "scope",
    "query"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "scope": "org",
      "query": "onboarding"
    }
  ]
}
Full response JSON schema
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "file_id": {
            "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": {
            "type": "string",
            "examples": [
              "Proposal.pdf"
            ],
            "description": "Original filename, including its extension."
          },
          "size_bytes": {
            "type": [
              "number",
              "null"
            ],
            "description": "File size in bytes. Null for a document without a downloadable binary file.",
            "examples": [
              48231
            ]
          },
          "content_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "Media type of the file, such as application/pdf. Null when no binary file exists.",
            "examples": [
              "application/pdf"
            ]
          },
          "path": {
            "type": "string",
            "description": "Folder path within the selected document collection. An empty string is its root.",
            "examples": [
              "Proposals"
            ]
          },
          "created_at": {
            "type": "number",
            "description": "Creation time in Unix milliseconds."
          },
          "owner_account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Account that owns a private document, or null for a workspace document.",
            "examples": [
              null
            ]
          },
          "created_by": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "account_alex"
            ],
            "description": "Account that created the record, or null when no account is recorded."
          },
          "kind": {
            "type": [
              "string",
              "null"
            ],
            "description": "Document origin or format: user_upload, agent_generated, signed_document and other file categories; text_document identifies collaborative text, while document identifies a generated Brigg document.",
            "examples": [
              "user_upload"
            ]
          },
          "scan_status": {
            "type": [
              "string",
              "null"
            ],
            "description": "Malware scan state. Threats and failed scans block downloads. An unsupported file cannot be processed; only its original uploader can retrieve it as a forced download. Null is not proof of readiness.",
            "examples": [
              "clean"
            ]
          },
          "document_kind": {
            "type": "string",
            "enum": [
              "file",
              "text_document",
              "generated_document"
            ],
            "description": "`file` = an uploaded file (its original bytes); `text_document` = a collaborative Tekstdokument (markdown); `generated_document` = a formatted document Brigg generated («Lag dokument»).",
            "examples": [
              "file"
            ]
          }
        },
        "required": [
          "file_id",
          "filename",
          "size_bytes",
          "content_type",
          "path",
          "created_at",
          "owner_account_id",
          "created_by",
          "kind",
          "scan_status",
          "document_kind"
        ],
        "additionalProperties": false,
        "title": "Document"
      },
      "description": "Documents matching the search text in the selected collection and optional folder prefix, bounded by limit. This operation has no cursor pagination."
    }
  },
  "required": [
    "items"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "items": [
        {
          "file_id": "file_proposal",
          "filename": "Proposal.pdf",
          "size_bytes": 48231,
          "content_type": "application/pdf",
          "path": "Proposals",
          "created_at": 1794301200000,
          "owner_account_id": null,
          "created_by": "account_alex",
          "kind": "user_upload",
          "scan_status": "clean",
          "document_kind": "file"
        }
      ]
    }
  ]
}

Search by operation name or what you want to build.

Use arrow keys to browse. Enter opens a result.