Search files keyword
Searches for files using keywords and supports metadata filters, file extension filtering (without dots), and field selection. Maps to Box's searchForContent API with comprehensive filtering capabilities.
The response always includes core fields: id, name, description, type, and size. Each entry also includes `url` (Box web link for files and folders; web links use the API `url` when returned). The 'fields' parameter allows you to request additional fields beyond these core ones. All requested fields (core + additional) will be included in the API request and returned in the response.
**Available Additional Fields:**
fileVersion, sha1, contentCreatedAt, contentModifiedAt, createdAt, createdBy, modifiedAt, modifiedBy, ownedBy, parent, pathCollection, purgedAt, sharedLink, size, trashedAt, classification, commentCount, dispositionAt, expiresAt, extension, hasCollaborations, isAccessibleViaSharedLink, isAssociatedWithAppItem, isExternallyOwned, isPackage, lock, metadata, permissions, representations, sharedLinkPermissionOptions, tags, uploaderDisplayName, watermarkInfo
**Date Range Filters:**
Date range filters properties of the input schema: created_at_range, updated_at_range, deleted_at_range. Use comma-separated RFC3339 timestamps.
**Format:** "start_date,end_date" where:
- Omit start date to search all items before end date: ",2023-12-31T23:59:59Z"
- Omit end date to search from start date to the present: "2023-01-01T00:00:00Z,"
- Both dates for specific range: "2023-01-01T00:00:00Z,2023-12-31T23:59:59Z"
<examples>
Basic keyword search (returns core fields only):
<input>
{
"query": "contract agreement",
"limit": 50
}
</input>
Advanced search with additional fields:
<input>
{
"query": "quarterly report",
"file_extensions": ["pdf", "docx"],
"ancestor_folder_id": "123456789",
"fields": ["createdAt", "modifiedAt", "size", "createdBy"]
}
</input>
Searching by date:
<input>
{
"query": "quarterly report",
"file_extensions": ["pdf", "docx"],
"ancestor_folder_id": "123456789",
"created_at_range”: "2023-01-01T00:00:00Z,2023-12-31T23:59:59Z",
"fields": ["createdAt"]
}
</input>
Search with metadata filters and additional fields:
<input>
{
"query": "invoice",
"file_extensions": ["pdf"],
"limit": 30,
"fields": ["contentCreatedAt", "pathCollection", "metadata"],
"mdfilters": [
{
"scope": "enterprise",
"templateKey": "invoiceTemplate",
"filters": {
"amount": {
"gt": 1000,
"lt": 5000
},
"status": "approved",
"department": "finance"
}
}
]
}
</input>
Multi-template metadata search with custom fields:
<input>
{
"query": "project document",
"fields": ["modifiedBy", "sharedLink", "tags", "permissions"],
"mdfilters": [
{
"scope": "enterprise",
"templateKey": "projectTemplate",
"filters": {
"priority": "high",
"deadline": {
"gt": "2024-01-01"
}
}
},
{
"scope": "global",
"templateKey": "reviewTemplate",
"filters": {
"reviewer": "john.doe@company.com"
}
}
]
}
</input>
</examples>