curl --request POST \
--url 'https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data action=sagescreen_save_context \
--data 'nonce=<string>' \
--data base_sage_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--data 'sage_name=<string>' \
--data 'role=<string>' \
--data 'role_level=<string>' \
--data 'job_description=<string>' \
--data 'language_code=<string>' \
--data 'default_tone=<string>' \
--data 'default_role=<string>'import requests
url = "https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context"
payload = {
"action": "sagescreen_save_context",
"nonce": "<string>",
"base_sage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sage_name": "<string>",
"role": "<string>",
"role_level": "<string>",
"job_description": "<string>",
"language_code": "<string>",
"default_tone": "<string>",
"default_role": "<string>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
action: 'sagescreen_save_context',
nonce: '<string>',
base_sage_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
sage_name: '<string>',
role: '<string>',
role_level: '<string>',
job_description: '<string>',
language_code: '<string>',
default_tone: '<string>',
default_role: '<string>'
})
};
fetch('https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "action=sagescreen_save_context&nonce=%3Cstring%3E&base_sage_id=3c90c3cc-0d44-4b50-8888-8dd25736052a&sage_name=%3Cstring%3E&role=%3Cstring%3E&role_level=%3Cstring%3E&job_description=%3Cstring%3E&language_code=%3Cstring%3E&default_tone=%3Cstring%3E&default_role=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context"
payload := strings.NewReader("action=sagescreen_save_context&nonce=%3Cstring%3E&base_sage_id=3c90c3cc-0d44-4b50-8888-8dd25736052a&sage_name=%3Cstring%3E&role=%3Cstring%3E&role_level=%3Cstring%3E&job_description=%3Cstring%3E&language_code=%3Cstring%3E&default_tone=%3Cstring%3E&default_role=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("action=sagescreen_save_context&nonce=%3Cstring%3E&base_sage_id=3c90c3cc-0d44-4b50-8888-8dd25736052a&sage_name=%3Cstring%3E&role=%3Cstring%3E&role_level=%3Cstring%3E&job_description=%3Cstring%3E&language_code=%3Cstring%3E&default_tone=%3Cstring%3E&default_role=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "action=sagescreen_save_context&nonce=%3Cstring%3E&base_sage_id=3c90c3cc-0d44-4b50-8888-8dd25736052a&sage_name=%3Cstring%3E&role=%3Cstring%3E&role_level=%3Cstring%3E&job_description=%3Cstring%3E&language_code=%3Cstring%3E&default_tone=%3Cstring%3E&default_role=%3Cstring%3E"
response = http.request(request)
puts response.read_bodySave sage context (step 1 → 2)
Creates a new ss_council_sage post in ss_draft status with
the provided context data, then calls the Python API to register
the sage association.
For non-customizable (system) sages, checks that the council does not already have one of that type. On failure, cleans up the created post.
Advances ss_setup_step to 2 on success.
Registered as wp_ajax_sagescreen_save_context — login required.
curl --request POST \
--url 'https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data action=sagescreen_save_context \
--data 'nonce=<string>' \
--data base_sage_id=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--data 'sage_name=<string>' \
--data 'role=<string>' \
--data 'role_level=<string>' \
--data 'job_description=<string>' \
--data 'language_code=<string>' \
--data 'default_tone=<string>' \
--data 'default_role=<string>'import requests
url = "https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context"
payload = {
"action": "sagescreen_save_context",
"nonce": "<string>",
"base_sage_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sage_name": "<string>",
"role": "<string>",
"role_level": "<string>",
"job_description": "<string>",
"language_code": "<string>",
"default_tone": "<string>",
"default_role": "<string>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
action: 'sagescreen_save_context',
nonce: '<string>',
base_sage_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
sage_name: '<string>',
role: '<string>',
role_level: '<string>',
job_description: '<string>',
language_code: '<string>',
default_tone: '<string>',
default_role: '<string>'
})
};
fetch('https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "action=sagescreen_save_context&nonce=%3Cstring%3E&base_sage_id=3c90c3cc-0d44-4b50-8888-8dd25736052a&sage_name=%3Cstring%3E&role=%3Cstring%3E&role_level=%3Cstring%3E&job_description=%3Cstring%3E&language_code=%3Cstring%3E&default_tone=%3Cstring%3E&default_role=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context"
payload := strings.NewReader("action=sagescreen_save_context&nonce=%3Cstring%3E&base_sage_id=3c90c3cc-0d44-4b50-8888-8dd25736052a&sage_name=%3Cstring%3E&role=%3Cstring%3E&role_level=%3Cstring%3E&job_description=%3Cstring%3E&language_code=%3Cstring%3E&default_tone=%3Cstring%3E&default_role=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("action=sagescreen_save_context&nonce=%3Cstring%3E&base_sage_id=3c90c3cc-0d44-4b50-8888-8dd25736052a&sage_name=%3Cstring%3E&role=%3Cstring%3E&role_level=%3Cstring%3E&job_description=%3Cstring%3E&language_code=%3Cstring%3E&default_tone=%3Cstring%3E&default_role=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-ajax.php?nonce=&action=sagescreen_save_context")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "action=sagescreen_save_context&nonce=%3Cstring%3E&base_sage_id=3c90c3cc-0d44-4b50-8888-8dd25736052a&sage_name=%3Cstring%3E&role=%3Cstring%3E&role_level=%3Cstring%3E&job_description=%3Cstring%3E&language_code=%3Cstring%3E&default_tone=%3Cstring%3E&default_role=%3Cstring%3E"
response = http.request(request)
puts response.read_bodyAuthorizations
WordPress AJAX nonce (passed as form field, verified per-action)
Body
"sagescreen_save_context"WP nonce for sagescreen_frontend_nonce
"abc123def456"
UUID of the base sage template
"b1c2d3e4-f5a6-7890-bcde-f12345678901"
Display name for the new sage
"My Custom Sage"
Role type
"Developer"
Seniority level
"senior"
Job description / context for the sage
"Full-stack developer responsible for building web applications..."
ISO language code
"en"
Default tone from base sage
"professional"
Default role from base sage
"interviewer"