Functions
Invoke function
Device must be enrolled. Top-level sql/operation/params are forbidden.
POST
/
v1
/
devices
/
{device_id}
/
functions
/
{function_id}
Invoke function
curl --request POST \
--url https://sand-api.orquestr.dev/cloud/v1/devices/{device_id}/functions/{function_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"input": {}
}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: {}})
};
fetch('https://sand-api.orquestr.dev/cloud/v1/devices/{device_id}/functions/{function_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sand-api.orquestr.dev/cloud/v1/devices/{device_id}/functions/{function_id}"
payload = { "input": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"device_id": "d7777777-7777-7777-7777-777777777777",
"function_id": "sicarv4.products.list",
"operation": "db.query",
"result": {
"status": "ok",
"command_id": "cmd-9f3a2b1c",
"rows": [
{
"id": 1,
"clave": "SKU-001",
"descripcion": "Café 1kg"
}
],
"row_count": 1
}
}
}{
"error": {
"code": "bad_request",
"message": "Invalid body"
}
}{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "Account not eligible for this action"
}
}{
"error": {
"code": "forbidden",
"message": "Forbidden"
}
}{
"error": {
"code": "not_found",
"message": "Not found"
}
}{
"error": {
"code": "conflict",
"message": "Device quota exceeded"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests",
"details": {
"retry_after": 60
}
}
}{
"error": {
"code": "gateway_error",
"message": "Gateway request failed"
}
}Authorizations
API key (sk_live_…). Send as Authorization: Bearer <api_key>.
Path Parameters
e.g. sicarv4.products.search or saved.
Body
application/json
Fields from the function params schema. Omit when none.
Response
Success
The response is of type object.
⌘I
Invoke function
curl --request POST \
--url https://sand-api.orquestr.dev/cloud/v1/devices/{device_id}/functions/{function_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"input": {}
}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({input: {}})
};
fetch('https://sand-api.orquestr.dev/cloud/v1/devices/{device_id}/functions/{function_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://sand-api.orquestr.dev/cloud/v1/devices/{device_id}/functions/{function_id}"
payload = { "input": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"device_id": "d7777777-7777-7777-7777-777777777777",
"function_id": "sicarv4.products.list",
"operation": "db.query",
"result": {
"status": "ok",
"command_id": "cmd-9f3a2b1c",
"rows": [
{
"id": 1,
"clave": "SKU-001",
"descripcion": "Café 1kg"
}
],
"row_count": 1
}
}
}{
"error": {
"code": "bad_request",
"message": "Invalid body"
}
}{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "Account not eligible for this action"
}
}{
"error": {
"code": "forbidden",
"message": "Forbidden"
}
}{
"error": {
"code": "not_found",
"message": "Not found"
}
}{
"error": {
"code": "conflict",
"message": "Device quota exceeded"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests",
"details": {
"retry_after": 60
}
}
}{
"error": {
"code": "gateway_error",
"message": "Gateway request failed"
}
}
