# search

query · in the family [Reading your records](/reference/reading-your-records/)

## What it does

Name search across your records — type-ahead by caption within your own group.

Caption typeahead within the caller's OWN org-group family; requires authentication. Scoped server-side to the principal's rootId (never cross-tenant); the prefix folds case/diacritic-insensitively; limit defaults + clamps server-side.

## Who may call it

Capability area: **Reading your records** — Looking up and listing the records of your organization.

- Owner
- System Administrator
- Manager
- Associate Manager
- Sales Associate
- Cashier
- An API key whose scope allows `api:search`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `type` | [SearchableType](/types/SearchableType/) `SearchableType!` | yes | No further notes. |
| `prefix` | [String](/types/#scalars) `String!` | yes | No further notes. |
| `limit` | [Int](/types/#scalars) | no | How many records to answer at most; a page may hold fewer. |

## Returns

[SearchHit](/types/SearchHit/) `[SearchHit!]!` — One caption-search typeahead hit — the display projection of a matched construct.

## Example request

```graphql
query ExampleSearch($type: SearchableType!, $prefix: String!, $limit: Int) {
  search(type: $type, prefix: $prefix, limit: $limit) {
    id
    type
    rootId
    caption
    status
    sysId
  }
}
```

Variables:

```json
{
  "type": "Organization",
  "prefix": "<prefix>",
  "limit": 1
}
```

## Example response

```json
{
  "data": {
    "search": [
      {
        "id": "01900000-0000-7000-8000-37386ae00000",
        "type": "Organization",
        "rootId": "01900000-0000-7000-8000-a093dd800000",
        "caption": "Blue jeans",
        "status": "<status>",
        "sysId": "<sys id>"
      }
    ]
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

## Errors this call can answer

- `VALIDATION/INVALID` — Something in the request is not valid. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
