search
query · in the family 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.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Reading your records — Looking up and listing the records of your organization.
Roles that may call it:
- Owner
- System Administrator
- Manager
- Associate Manager
- Sales Associate
- Cashier
- An API key whose scope allows
api:search
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
type | SearchableType SearchableType! | yes | One of the values of [SearchableType](/types/SearchableType/). |
prefix | String String! | yes | |
limit | Int | no | How many records to answer at most; a page may hold fewer. |
Returns
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": "User",
"prefix": "blue",
"limit": 10
}Example response
json
{
"data": {
"search": [
{
"id": "01900000-0000-7000-8000-37386ae00000",
"type": "User",
"rootId": "01900000-0000-7000-8000-a1295a650000",
"caption": "Blue jeans",
"status": "active",
"sysId": "US-EXMP-0000-000F"
}
]
},
"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. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)