---
title: "Search for documents, templates, and document groups"
url: "https://docs.signnow.com/docs/search/operations/get-v2-search"
type: "endpoint"
section: "search"
slug: "search/operations/get-v2-search"
method: "GET"
path: "/v2/search"
operation_id: "get-v2-search"
authorization: "bearer"
---

# Search for documents, templates, and document groups

`GET /v2/search`

This endpoint allows users to search across their documents, templates, document groups, and document group templates. Search covers all folders accessible to the user, including own, shared, and team folders. Results are sorted by the date updated, from newest to oldest.

Each `search_by` value uses its own matching logic and minimum `search_key` length:

| `search_by` value | Searches | Matching | Min `search_key` length |
|---|---|---|---|
| `name` | Entity name | Contains | 1 |
| `id` | Entity ID | Exact match | — |
| `inviter-email` | Inviter email | Prefix | 2 |
| `signer-email` | Signer email | Prefix | 2 |
| `document-text` | Text inside the document | Substring | 3 |

Matching is case-insensitive. Leading and trailing whitespace in `search_key` is trimmed before the length check. If `search_key` is shorter than the minimum for a given field, that field returns no results without a validation error. For `inviter-email` and `signer-email`, the prefix match applies to the first 40 characters of the email; a longer `search_key` matches by exact email value.

The maximum number of results before pagination is 1,000.

## Authorization

bearer

## Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `search_key` | string | Yes | Search phrase. Must be a non-empty string. |
| `search_by` | string | Yes | Comma-separated list of fields to search by. Possible values: `name`, `id`, `inviter-email`, `signer-email`, `document-text`. |
| `per_page` | integer | No | Number of results per page. Possible values: 1–20. |
| `page` | integer | No | Page number. Must be greater than 0. |

## Responses

### 200

Success. `entity_properties` content depends on `entity_type`. An empty result returns HTTP 200 with an empty `data` array and `meta.pagination.total` set to `0`. Document text and emails are used for matching only and are not returned in the response.

**Example** (`application/json`)

```json
{
  "data": [
    {
      "id": "4fXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "name": "Sales invoice.pdf",
      "owner": "owner@email.com",
      "created": "1696492112",
      "updated": "1696492114",
      "folder_id": "e6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "entity_type": "document-group",
      "entity_properties": {
        "state": "created",
        "documents": [
          {
            "id": "60XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            "owner": {
              "id": "57XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
              "email": "owner@email.com"
            },
            "roles": [],
            "updated": 1696492113,
            "folder_id": null,
            "thumbnail": {
              "large": "https://api.signnow.com/document/60XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/thumbnail?size=large",
              "small": "https://api.signnow.com/document/60XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/thumbnail?size=small",
              "medium": "https://api.signnow.com/document/60XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/thumbnail?size=medium"
            },
            "has_fields": false,
            "page_count": 1,
            "signatures": [],
            "document_name": "Sales invoice.pdf",
            "field_invites": [],
            "freeform_invites": []
          }
        ],
        "invite_id": null,
        "origin_dgt": null,
        "entity_labels": [],
        "sign_as_merged": null,
        "scheduled_invite": null,
        "freeform_invite_id": null
      }
    },
    {
      "id": "d0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "name": "Contract",
      "owner": "owner@email.com",
      "created": "1696492100",
      "updated": "1696492110",
      "folder_id": "e6XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "entity_type": "document",
      "entity_properties": {
        "roles": [
          {
            "name": "Signer 1",
            "unique_id": "59XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            "signing_order": "1"
          }
        ],
        "thumbnail": {
          "large": "https://api.signnow.com/document/d0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/thumbnail?size=large",
          "small": "https://api.signnow.com/document/d0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/thumbnail?size=small",
          "medium": "https://api.signnow.com/document/d0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/thumbnail?size=medium"
        },
        "page_count": "1",
        "signatures": [],
        "entity_labels": [],
        "field_invites": [],
        "scheduled_invite": null,
        "origin_document_id": null
      }
    }
  ],
  "meta": {
    "pagination": {
      "count": 2,
      "links": {
        "next": "https://api.signnow.com/v2/search?search_key=invoice&search_by=name&per_page=15&page=2"
      },
      "total": 118,
      "per_page": 15,
      "total_pages": 8,
      "current_page": 1
    }
  }
}
```

### 400

* Incorrect or missing token.
* The `search_key` field is not a string.
* The `search_key` field is empty.
* The `search_by` field is not a string.
* The `search_by` field is empty.
* The `search_by` field values are not in the available value list: `name`, `id`, `inviter-email`, `signer-email`, `document-text`.
* The `per_page` field is not a digit.
* The `per_page` field value is 0 or less.
* The `per_page` field value is greater than 20.
* The `page` field is not a digit.
* The `page` field value is 0 or less.
* Could not find search info.

**Example** (`search_by is empty`)

```json
{
  "errors": [
    {
      "code": 26003010,
      "message": "The `search_by` field is empty."
    }
  ]
}
```

**Example** (`page is not a digit`)

```json
{
  "errors": [
    {
      "code": 26003015,
      "message": "The `page` field is not a digit."
    }
  ]
}
```

**Example** (`search_key is empty`)

```json
{
  "errors": [
    {
      "code": 26003008,
      "message": "The `search_key` field is empty."
    }
  ]
}
```

**Example** (`Search info not found`)

```json
{
  "errors": [
    {
      "code": 26003021,
      "message": "Could not find search info."
    }
  ]
}
```

**Example** (`page value is 0 or less`)

```json
{
  "errors": [
    {
      "code": 26003016,
      "message": "The `page` field value is 0 or less."
    }
  ]
}
```

**Example** (`per_page is not a digit`)

```json
{
  "errors": [
    {
      "code": 26003012,
      "message": "The `per_page` field is not a digit."
    }
  ]
}
```

**Example** (`search_by is not a string`)

```json
{
  "errors": [
    {
      "code": 26003009,
      "message": "The `search_by` field is not a string."
    }
  ]
}
```

**Example** (`Incorrect or missing token`)

```json
{
  "code": 1537,
  "error": "invalid_token"
}
```

**Example** (`search_key is not a string`)

```json
{
  "errors": [
    {
      "code": 26003007,
      "message": "The `search_key` field is not a string."
    }
  ]
}
```

**Example** (`per_page value is 0 or less`)

```json
{
  "errors": [
    {
      "code": 26003013,
      "message": "The `per_page` field value is 0 or less."
    }
  ]
}
```

**Example** (`search_by value is not valid`)

```json
{
  "errors": [
    {
      "code": 26003011,
      "message": "The `search_by` field values are not in the available value list: `name`, `id`, `inviter-email`, `signer-email`, `document-text`."
    }
  ]
}
```

**Example** (`per_page value is greater than 20`)

```json
{
  "errors": [
    {
      "code": 26003014,
      "message": "The `per_page` field value is greater than 20."
    }
  ]
}
```

### 500

* Internal API error.

**Example** (`Internal server error`)

```json
{
  "error": [
    {
      "code": 26000005,
      "message": "Internal Api Error"
    }
  ]
}
```

## Code Examples

> Replace `$SIGNNOW_ACCESS_TOKEN` and any `{placeholder}` values before running.

### cURL

```bash
curl -X GET \
  "https://api.signnow.com/v2/search" \
  -H "Authorization: Bearer $SIGNNOW_ACCESS_TOKEN"
```

---
*Full reference: https://docs.signnow.com/docs/search/operations/get-v2-search*
