Turn switches off for a session
This page needs your own installation with an Embed license.
POST/
Turns more switches off for the frame’s session. Nothing turns one back on.
Needs the frame’s session: Authorization: Bearer gri_…. The SDK calls it; you rarely do.
Parameters
Body
turnOffOptional · array of stringsSwitch IDs to turn off. Unknown ones are listed in
ignored.
Responses
- 200OK
The session’s switches now.
The body isn’t JSON.
- 401
UNAUTHORIZEDNo session token.
The session ended.
details.reasonsays why, such asaccess_removed,role_changedorworkspace_deleted.Embed isn’t licensed here, or sign-in is off (
details.reason:not_licensedorsign_in_off).Something failed on the installation’s side. Try again.
Any call can also answer: 413 PAYLOAD_TOO_LARGE · 415 INVALID_CONTENT_TYPE · 429 RATE_LIMITED · 503 BUSY. See Errors.
Request
GORUNNER="https://automations.example.com"
GORUNNER_SESSION="gri_…" # the frame’s session
URL="$GORUNNER/api/embed/v1/sessions/current/"
URL="${URL}turn-off"
curl -X POST "$URL" \
-H "Authorization: Bearer $GORUNNER_SESSION" \
-H "Content-Type: application/json" \
-d '{
"turnOff": [
"deleteRuns",
"importExport"
]
}'const GORUNNER = "https://automations.example.com";
const SESSION = process.env.GORUNNER_SESSION; // gri_…
const res = await fetch(
`${GORUNNER}/api/embed/v1/sessions/current/` +
`turn-off`,
{
method: "POST",
headers: {
Authorization: `Bearer ${SESSION}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
turnOff: ["deleteRuns", "importExport"],
}),
},
);
const { data } = await res.json();import os, requests
GORUNNER = "https://automations.example.com"
SESSION = os.environ["GORUNNER_SESSION"] # gri_…
res = requests.post(
f"{GORUNNER}/api/embed/v1/sessions/current/"
f"turn-off",
headers={"Authorization": f"Bearer {SESSION}"},
json={
"turnOff": ["deleteRuns", "importExport"],
},
)
data = res.json()["data"]Response · 200 OK, shortened
{
"data": {
"switches": {
"deleteRuns": false,
"importExport": false,
"…": true
},
"ignored": []
}
}Every field
Body
turnOffOptional · array of strings
Response · 200 OK
dataobjectswitchesobjectEvery switch id with its effective value; a missing id is off.
{key}booleanEach key’s value.
ignoredarray of strings