Query for machine instances using the indicated index.
Using an index specified during machine creation and defined during machine version creation, query for instances of the provided machine that have an indexed value that matches the provided filters.
Path parameters
-
machineSlug
string Required The slug/name for the machine definition.
Minimum length is
1
. Format should match the following pattern:^[a-zA-Z0-9_-]{1,128}$
. -
index
string Required The name for the machine index.
Format should match the following pattern:
^[a-zA-Z0-9_-]{1,128}$
.
Query parameters
-
op
string The operation for the filter.
Values are
eq
,ne
,gt
,gte
,lt
, orlte
. -
value
string The value for the filter.
-
dir
string The sort direction for the index.
Values are
asc
ordesc
. -
limit
number The maximum number of items to return.
-
cursor
string The cursor returned from a previous call to query.
GET
/machines/{machineSlug}/indexes/{index}/query
curl \
-X GET https://api.statebacked.dev/machines/my-machine/indexes/{index}/query \
-H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
"instances": [
{
"indexValue": "string",
"slug": "user-1234"
}
],
"cursor": "string"
}
Response examples (200)
{
"instances": [
{
"indexValue": "string",
"slug": "user-1234"
}
],
"cursor": "string"
}
Response examples (403)
{
"error": "string",
"code": "missing-scope"
}
Response examples (403)
{
"error": "string",
"code": "missing-scope"
}