Search Content on External Storage Action

Searches content stored in files, including images, audio recordings, video footage, and PDF documents that are stored in external storage systems, and returns matching files with specific citations.

This action is available in API version 68.0 and later.

This action searches files by meaning, not just exact keywords. For example, a query for “fled” can also return files that mention “absconded” or a video where someone says “ran away.” Use it from a flow, an Agentforce agent, or REST API. The Search Files agent action calls this invocable action. For the related Connect REST API, see Search External Storage (POST).

Special Access Rules 

To access the Search Content on External Storage action, External Storage Search must be enabled in your org, and the user must have the Search Files in Amazon S3 system permission. For details, see External Storage Search Prerequisites.

Supported REST HTTP Methods 

URI: /services/data/vXX.X/actions/standard/invocableCallContentSearch

Where XX.X is the latest API version.

Formats: JSON

HTTP Methods: GET, POST

Authentication: Authorization: Bearer TOKEN

Where TOKEN is a variable.

Inputs 

InputTypeDescription
recordIdIDRequired.
The ID of the Salesforce record that scopes the search to associated files, such as a case, complaint, or inspection.
relevanceScoreDoubleThe minimum relevance score used to filter results, from 0.0 to 1.0, where 1.0 is the most relevant.
searchQueryStringRequired.
The natural-language search query to run against files stored in Amazon S3. Must contain 1 to 4,096 characters and can’t be empty.

Outputs 

OutputTypeDescription
hasMoreBooleanIndicates whether more pages of results are available beyond the current page.
nextSearchHandleStringOpaque pagination token from the current page of results. Use this value to retrieve the next page of results.
resultsStringJSON string that contains the matching files for the current page, ordered by relevance. Each result can include the document title, excerpt, relevance score, source URL, content type, associated ContentDocument IDs, page number, and media timestamps. For the result structure, see External Storage Search Result.
totalResultsIntegerTotal number of matching documents across all pages.

Example 

GET

This example shows how to get the details of the Search Content on External Storage action type.

1curl --include --request GET \
2--header 'Authorization: Bearer 00DR...xyz' \
3--header 'Content-Type: application/json' \
4"https://instance.salesforce.com/services/data/v68.0/actions/standard/invocableCallContentSearch"

POST

Here’s a request for the Search Content on External Storage action.

1{
2  "inputs": [
3    {
4      "recordId": "500xx000000bo1JAAQ",
5      "searchQuery": "suspect fled the scene",
6      "relevanceScore": 0.3
7    }
8  ]
9}

Here’s a response for the Search Content on External Storage action.

1[
2    {
3        "actionName": "invocableCallContentSearch",
4        "errors": null,
5        "invocationId": null,
6        "isSuccess": true,
7        "outcome": null,
8        "outputValues": {
9            "results": "[{\"externalDocumentInfo2\":\"s3://bucket/__sfdcroot__/Case/500xx000000bo1JAAQ/evidence.pdf\",\"contentDocumentIds\":[\"069xx0000004CQm\"],\"title\":\"evidence.pdf\",\"excerpt\":\"the suspect fled the scene\",\"relevanceScore\":0.3502548,\"sourceUrl\":\"s3://bucket/__sfdcroot__/Case/500xx000000bo1JAAQ/evidence.pdf\",\"contentType\":\"PDF\",\"pageNumber\":1,\"startTimeMs\":null,\"endTimeMs\":null}]",
10            "totalResults": 1,
11            "hasMore": false,
12            "nextSearchHandle": null
13        },
14        "sortOrder": -1,
15        "version": 1
16    }
17]

See Also