/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Get Custom Code

Get Custom Code

Read a project's custom code: the switches for code from your docs, what the last publish applied, and the pasted snippets and CSS.

GET/v1/projects/{projectId}/custom-scriptsTry it
Session token

Returns everything on Integrations › Custom code: the three switches for custom code from your docs (_syntext/), what the last published site applied from it, and the pasted head snippets, body snippets and CSS under Override (advanced).

Note

Requires a session JWT and membership of the organization that owns {projectId} — any role. API keys are rejected with 401. Reading works on any plan; saving needs Starter or higher.

Path Parameters

NameDescription
projectId:stringpathRequired
The project ID, a UUID.

Response

NameDescription
data.enabled:boolean
Whether the pasted code (Override (advanced)) is on. false until the first save.
data.config:object
The pasted code — the same shape you send to Update Pasted Custom Code. Before anything is saved it's { "headSnippets": [], "bodySnippets": [] }.
data.updatedAt:string | null
When the pasted code was last saved, or null.
data.docsCode:object
The switches for code from your docs.
Show 6 child attributesobject
data.canManage:boolean
true when you're a workspace admin or owner, so you can change the switches and use Move into your docs.
data.isPrivate:boolean
true when the site is behind a password, invites or SSO. Turning on head tags or scripts then needs confirmPrivate — see Update Custom Code Switches.
data.source:string
Where the project's files live: github, hosted (written in Syntext) or upload (published with stx deploy).
data.applied:object | null
What the last published site applied from your docs, or null before the first publish with custom code.
Show 3 child attributesobject | null

Errors

StatusCodeWhen
401unauthorizedNo session token, an invalid or expired one, or an API key
403forbiddenYou're not a member of the project's organization
404not_foundThe project doesn't exist
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl https://api.syntext.dev/v1/projects/$PROJECT_ID/custom-scripts \
-H "Authorization: Bearer $SYNTEXT_JWT"
Responseapplication/json
200OK
{
"data": {
"enabled": true,
"config": {
"headSnippets": [
{ "id": "plausible", "name": "Plausible", "code": "<script defer data-domain=\"docs.acme.com\" src=\"https://plausible.io/js/script.js\"></script>", "enabled": true }
],
"bodySnippets": [],
"customCss": ".hero h1 { letter-spacing: -0.02em; }"
},
"updatedAt": "2026-11-10T14:03:22.000Z",
"docsCode": {
"css": true,
"head": true,
"scripts": false,
"updatedAt": "2026-11-14T09:12:40.000Z",
"updatedBy": "8f6a2c1e-3b4d-4e5f-9a0b-1c2d3e4f5a6b",
"privateConfirmedAt": null
},
"canManage": true,
"isPrivate": false,
"source": "github",
"applied": {
"buildId": "b2f1c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"deployedAt": "2026-11-14T09:20:03.000Z",
"files": [
{ "path": "_syntext/theme.css", "kind": "css", "bytes": 2048, "sha256": "3f9a1c0b7e2d", "status": "applied", "domains": [] },
{ "path": "_syntext/head.html", "kind": "head", "bytes": 412, "sha256": "a81d44e09c5f", "status": "applied", "domains": ["plausible.io"] },
{ "path": "_syntext/app.js", "kind": "js", "bytes": 1530, "sha256": "0c7be2915a3d", "status": "off", "domains": [] }
]
}
}
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext