# Search sheet

Gets a list of the user's search results in a sheet, based on a query.

The list contains an abbreviated row object for each query-matching row in the sheet. 

> Important: If you have't used the public API in a while, we will need to provision your
data. This could take up to 24 hours so please check back later!

> Note: Newly created or recently updated data may not be immediately discoverable
via search.

Endpoint: GET /search/sheets/{sheetId}
Version: 2.0.0
Security: APIToken, OAuth2

## Path parameters:

  - `sheetId` (number, required)
    ID of the sheet being accessed.

## Header parameters:

  - `Authorization` (string)
    API Access Token used to authenticate requests to Smartsheet APIs.

  - `smartsheet-integration-source` (string)
    Uses the following metadata to distinguish between human-initiated API requests and third-party service-initiated calls by AI Connectors or ITSM:

- Integration source type
- Organization name
- Integration source name 

Format:


TYPE,OrgName,SourceName


Examples: 

AI,SampleOrg,My-AI-Connector-v2

SCRIPT,SampleOrg2,Accounting-updater-script

APPLICATION,SampleOrg3,SheetUpdater
    Example: "AI,SampleOrg,My-AI-Connector-v2"

## Query parameters:

  - `query` (string, required)
    Text with which to perform the search.

Tip: To match the exact text, wrap the query in double-quotes.

## Response 200 fields (application/json):

  - `results` (array) — one of:
    Array of matching items.
    - Search result item:
      - `text` (string)
        Excerpt of the item's matching text.
      - `objectType` (string)
        The matching item's type.
        Enum: "attachment", "sight", "discussion", "folder", "report", "row", "sheet", "summaryField", "template", "workspace"
      - `objectId` (number)
        The matching item's ID.
        Example: 12345678
      - `contextData` (array)
        Additional information about the matching item. If the item has a discussion or attachment belonging to a proof, the context data includes the URL of that proof (for example, "proofUrl: https://app.smartsheet.com/b/proofs/sheets/abc123/proofs/def456").
      - `favorite` (boolean)
        true if the item is one of the user's favorites.
        Example: true
    - Search result sub-item:
      - `text` (string)
        Excerpt of the item's matching text.
      - `objectType` (string)
        The matching item's type.
        Enum: same as `objectType` in "Search result item" (10 values)
      - `objectId` (number)
        The matching item's ID.
        Example: 12345678
      - `contextData` (array)
        Additional information about the matching item. If the item has a discussion or attachment belonging to a proof, the context data includes the URL of that proof (for example, "proofUrl: https://app.smartsheet.com/b/proofs/sheets/abc123/proofs/def456").
      - `parentObjectType` (string)
        The type of the item's parent.
        Enum: "dashboard", "folder", "report", "sheet", "template", "workspace"
      - `parentObjectId` (number)
        The ID of the item's parent.
        Example: 23456789
      - `parentObjectName` (string)
        The name of the item's parent.
      - `parentObjectFavorite` (boolean)
        true if the parent is one of the user's favorites.
        Example: true

  - `totalCount` (number)
    Total number of search results in the results array.
    Example: 1

## Response default fields (application/json):

  - `refId` (string)
    The ID of the specific error occurrence. Please include this information when contacting Smartsheet support.

  - `errorCode` (number)
    Custom error code from Smartsheet. See the complete [Error Code List](/api/smartsheet/error-codes).

  - `message` (string)
    Descriptive error message.


