Saved SQL
Update saved SQL
PATCH
/
v1
/
saved-sql-queries
/
{id}
Update saved SQL
curl --request PATCH \
--url https://sand-api.orquestr.dev/cloud/v1/saved-sql-queries/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"sql": "<string>",
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
sql: '<string>',
device_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://sand-api.orquestr.dev/cloud/v1/saved-sql-queries/{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/saved-sql-queries/{id}"
payload = {
"name": "<string>",
"sql": "<string>",
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "e9999999-9999-4999-8999-999999999999",
"customer_id": "o2222222-2222-2222-2222-222222222222",
"adapter": "sicarv4",
"name": "Top sellers (updated)",
"sql": "SELECT clave, SUM(cantidad) AS qty FROM ventas GROUP BY clave ORDER BY qty DESC LIMIT 20",
"device_id": null,
"created_by": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"created_at": "2026-09-12T10:00:00.000Z",
"updated_at": "2026-09-14T11:00:00.000Z"
}
}{
"error": {
"code": "bad_request",
"message": "Invalid body"
}
}{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "Forbidden"
}
}{
"error": {
"code": "not_found",
"message": "Not found"
}
}⌘I
Update saved SQL
curl --request PATCH \
--url https://sand-api.orquestr.dev/cloud/v1/saved-sql-queries/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"sql": "<string>",
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
sql: '<string>',
device_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://sand-api.orquestr.dev/cloud/v1/saved-sql-queries/{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/saved-sql-queries/{id}"
payload = {
"name": "<string>",
"sql": "<string>",
"device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "e9999999-9999-4999-8999-999999999999",
"customer_id": "o2222222-2222-2222-2222-222222222222",
"adapter": "sicarv4",
"name": "Top sellers (updated)",
"sql": "SELECT clave, SUM(cantidad) AS qty FROM ventas GROUP BY clave ORDER BY qty DESC LIMIT 20",
"device_id": null,
"created_by": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"created_at": "2026-09-12T10:00:00.000Z",
"updated_at": "2026-09-14T11:00:00.000Z"
}
}{
"error": {
"code": "bad_request",
"message": "Invalid body"
}
}{
"error": {
"code": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"code": "forbidden",
"message": "Forbidden"
}
}{
"error": {
"code": "not_found",
"message": "Not found"
}
}
