Scout's page only: save the Generate PDF form's details to the header file
const url = 'http://127.0.0.1:8765/api/pdf-header/save';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"links":[],"location":"Springfield, IL","name":"Jane Example","work_authorization":""}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://127.0.0.1:8765/api/pdf-header/save \ --header 'Content-Type: application/json' \ --data '{ "links": [], "location": "Springfield, IL", "name": "Jane Example", "work_authorization": "" }'Scout’s own page only: write the Generate PDF form’s details to the person’s header file, on their click. NOT for agents: it answers only Scout’s own browser page (a request carrying this server’s own Origin); any other caller gets 403 forbidden_origin, the body is not read and nothing is written. It is the form’s “Save these details to ~/Documents/GigAI/header.json” button: one write per click of what is in the form, to the file POST /api/pdf-header reads (mode 0600, written to a temporary file in the same folder and put in place in one step). The values go into that file and nowhere else: not the store, the journal, a log, a record, a suggestion, a brief, the resumes folder or a model prompt, and this answer holds none of them. state is saved, exists (a file is already there and was not changed; the form asks “Replace the existing header.json?” and sends replace: true) or not_writable (the folder is missing or cannot be written; message says what to check). The folder ~/Documents/GigAI is created when it is missing; no other folder is. The values follow the file’s rules (422 invalid_value names the field and the rule, never a value). The file gets the shorthand: github and linkedin as the id, website as the site address, links only for other links; a field left empty is left out of the file (work_authorization excepted).
Request Body
Section titled “Request Body”object
Optional.
Optional: the GitHub id alone; a profile address is saved as the id.
Optional: the LinkedIn id alone; a profile address is saved as the id.
Optional: at most 6 other links, each {label, url}. One that is a GitHub or LinkedIn profile is saved as that id.
Optional.
Optional; one line of at most 200 characters, like every text field here.
Optional.
True: write over the file that is there. Sent only after the person answered the form’s question.
Optional: a site address.
Optional; empty means no line (always written).
Example
{ "links": [], "location": "Springfield, IL", "name": "Jane Example", "work_authorization": ""}Responses
Section titled “Responses”Success.
object
Example
{ "message": "Saved your details to ~/Documents/GigAI/header.json. GigAI keeps no other copy.", "schema_version": "scout-pdf-header-save:1", "shown": "~/Documents/GigAI/header.json", "state": "saved"}Forbidden_origin
object
object
Example
{ "error": { "code": "forbidden_origin", "message": "..." }}Target_unavailable
object
object
Example
{ "error": { "code": "target_unavailable", "message": "..." }}Unsupported_media_type: writes need Content-Type: application/json.
object
object
Examplegenerated
{ "error": { "allowed_keys": [ "example" ], "code": "example", "message": "example" }}Unknown_key, wrong_type, invalid_value
object
object
Example
{ "error": { "code": "unknown_key", "message": "..." }}