---
title: "Search"
description: "<p>Search assets, folders, and other objects.</p>"
url: "https://www.contentstack.com/docs/developers/apis/assets-api/search"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-08-21"
---

# Search

Search assets, folders, and other objects.

## Search a specific object type

### Search a specific object type

**POST** `/api/{object_type}/search`

The Search a specific object type request searches within one object type, such as assets or asset\_types, using a query payload. Folders are not searchable here: use include\_folders on the list endpoints instead.

Control text matching with search\_text, the term to look for. Restrict it to a single field with search\_field, which accepts all, title, name, url, or category, and choose how multiple terms combine with search\_terms\_operator, which accepts and or or.

For conditions that text alone cannot express, send query instead. It takes nested $and and $or clauses, so you can combine several conditions in one request.

Shape the results with asc or desc, each taking a field name to sort by, page through them with limit and skip, and trim the payload to the keys you need with fields.

Narrow the scope with spaces to search only specific spaces, or with contextual\_locale and contextual\_fallback\_locales for locale-aware results.

Deleted items are excluded by default. Pass include\_deleted\_items to add them alongside live items, filter\_only\_deleted\_items to return nothing else, or include\_deleted\_workspace to reach items whose workspace was deleted.

To avoid follow-up requests, set include\_user\_details or include\_asset\_type\_schema and the related records arrive inline.  
  

##### Restrict to titles and sort by newest:

```
{
  "desc": "created_at",
  "limit": 50,
  "search_field": "title",
  "search_text": "campaign",
  "skip": 0
}
```

undefined  
  

##### Structured filter instead of text:

```
{
  "limit": 25,
  "query": {
    "$and": [
      {
        "$or": [
          {
            "category": "image"
          },
          {
            "category": "video"
          }
        ]
      }
    ]
  }
}
```

undefined  
  

##### Restrict to specific spaces and trim the payload:

```
{
  "fields": [
    "uid",
    "title",
    "url"
  ],
  "search_text": "q4",
  "spaces": [
    "amaa28fea7d7447e71"
  ]
}
```

undefined  
  

##### Only deleted items, for a restore workflow:

```
{
  "filter_only_deleted_items": true,
  "include_deleted_workspace": true,
  "search_text": "invoice"
}
```

undefined  
  

##### Locale-aware search with fallbacks:

```
{
  "contextual_fallback_locales": [
    "en-us"
  ],
  "contextual_locale": "de-de",
  "search_text": "weihnachten"
}
```

undefined  
  

##### Include user details and the asset type schema inline:

```
{
  "include_asset_type_schema": true,
  "include_user_details": true,
  "search_text": "hero"
}
```

undefined

#### URL Parameters

- **object_type** (required)
  Enter the type of object to search. Folders are not supported here; use include\_folders on the relevant list endpoints to retrieve folders.

#### Query Parameters

- **save_recent_search** (optional)
  Set to true to save this query to the user's recent searches.
- **project_uid** (optional)
  Enter the uid of the project to scope the search to a specific project.
- **context_uid** (optional)
  Enter the uid of the context in which the search runs.

#### Headers

- **authorization** (optional)
  OAuth access token authentication. Pass the token in the authorization header as Bearer . This header takes an OAuth access token. It does not take a management token, and management tokens are not supported by this API.

Authentication is required. Every request must carry either this header or the authtoken header; a request with neither is rejected.
- **authtoken** (optional)
  Contentstack authtoken authentication. Pass your Contentstack authtoken in the authtoken header.

This is your authtoken, not your stack api\_key and not a management token. OpenAPI classifies any credential sent in a header as an API key, which is why some documentation viewers label this scheme apiKey. That label refers to the transport, not to a Contentstack API key.

Authentication is required. Every request must carry either this header or the authorization header; a request with neither is rejected.
- **x-cs-api-version** (required)
  Enter the Assets API version. Default is 4.
- **organization_uid** (optional)
  REQUIRED when using authtoken authentication. You must explicitly provide this header. It is optional with Authorization Bearer token authentication, where the organization\_uid is derived from the token.

#### Sample Response

```json
{}
```