Create Library Change (writeback)
Sandcastles
Create Library Change (Writeback)
Persist a sandcastle’s edits to /sandbox/files/library back to the org’s Context Library as a reviewable change.
POST
Create Library Change (writeback)
This is the writeback half of the Context Library. The library is mounted into
every sandcastle at
/sandbox/files/library, pruned to your OWNERS
permissions. Reads happen over the filesystem; writes back to canonical,
versioned org context happen here — as a reviewable change, not a silent commit.Workflow
(Optional) Preview the diff
Call Diff Library to confirm what
will be written back before authoring a change.
Create the change
POST /v2/sandcastles/:id/library/changes with a title and description.
The change is submitted OPEN for admin review (or DRAFT if you set
draft: true).Driving this from an agent loop
If you let an LLM decide when to write back, give the tool a description that teaches the stage-then-change workflow — otherwise models try to “save” before editing, or file empty changes. A description that mirrors the in-product tool works well:Authorizations
API key or JWT token
Path Parameters
Sandbox ID
Body
application/json
Short summary (≤50 chars). Required for a new change.
Maximum string length:
50Markdown explanation of the changes. Required for a new change.
File as DRAFT instead of OPEN (not yet ready for review).
Set to revise an existing change (creates a new changeset).
Response
Change created or updated
Change lifecycle state after submission.
Available options:
open, draft, approved, reserved Human-readable conflict view (present when has_conflicts).