/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Get Editor Symbols

Get Editor Symbols

The @stx-annotated symbols in a project's repository — what the web editor offers for {@embed} completions and Code from @stx.

GET/v1/projects/{projectId}/editor/symbolsTry it
Session token

Returns the functions, classes, interfaces, types and enums in the project's repository that carry an @stx annotation, each with the value to put in an {@embed} directive.

The web editor uses it for {@embed src="…"} completions, for Code from @stx in the Preview's block picker, and to flag an {@embed} that names a symbol that doesn't exist.

Note

Any member of the workspace can call this, signed in with a session JWT — API keys are refused with 401. You must belong to the organization that owns {projectId}. The project's repository is read through its GitHub App installation — see Pages & Content API. A project written in Syntext has no code to annotate, so its index is always empty.

Limited to 30 requests per user, per project, per minute — see Rate limits.

How the index is built

•
From the head of the project's branch, read through the GitHub API — nothing is cloned.
•
Up to 200 code files in TypeScript, JavaScript, Python, Go, Rust, Java, PHP, Ruby and C#, taken in the order GitHub lists the repository tree. Files over 200 KB, test files (*.test.*, *.spec.*, _test.go, test_*.py, __tests__/…) and node_modules, dist, build, vendor and .git folders are skipped. truncated is true when there were more files than that.
•
Annotated symbols only — a symbol is listed when it has at least one @stx tag.
•
Cached for 10 minutes per project, repository and head commit. A push changes the head commit, so the next request after a push builds a fresh index.
•
Time-limited — each GitHub request may take 10 seconds and the whole index 30. Past that, the request fails with 502 github_error.

Path Parameters

NameDescription
projectId:stringpathRequired
The project ID.

Response Fields

NameDescription
symbols:object[]
Every annotated symbol found.
symbols[].name:string
The symbol's name.
symbols[].path:string
The file it's in, relative to the repository root.
symbols[].kind:string
function, class, interface, type or enum.
symbols[].line:number
The line the symbol starts on, 1-based.
symbols[].summary:string
The first line of its @stx description. Absent when it has none.
symbols[].signature:string
One line describing its shape, up to 160 characters — parameters and return type for a function, class Name extends Base for a class. Absent when the parser didn't capture one.
symbols[].embed:string
path#name — the value of {@embed src="…"} for this symbol.
indexedAt:string
When the index was built (ISO 8601). A cached index keeps its original time.
truncated:boolean
true when the repository has more code files than the index reads, so some symbols may be missing.
repo:string
The repository indexed, as owner/repo.

Error Responses

400 Bad Request

bad_request — the project has no repository, an invalid repository URL or no GitHub App installation.

401 Unauthorized

No session JWT, an expired one, or an API key.

403 Forbidden

forbidden — you are not a member of the organization that owns the project. installation_not_owned — the GitHub App installation isn't connected to the project's workspace.

404 Not Found

not_found — the project does not exist or was deleted.

429 Too Many Requests

rate_limited — more than 30 symbol requests from you on this project in the current minute. Wait details.retryAfterSeconds before trying again.

502 Bad Gateway

github_error — GitHub refused a request, or didn't answer in time. details.githubStatus has GitHub's status, or 504 for a timeout.

Was this page helpful? Yes No
Previous
Next
Request
bashJavaScriptPythonGoRubyPHPJavaC#bash
curl "https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/editor/symbols" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
Responseapplication/json
200OK
{
"data": {
"symbols": [
{
"name": "rotateKey",
"path": "src/keys/rotate.ts",
"kind": "function",
"line": 18,
"summary": "Rotate an API key and revoke the old one after a grace period.",
"signature": "async rotateKey(id: string, graceHours?: number): Promise<ApiKey>",
"embed": "src/keys/rotate.ts#rotateKey"
}
],
"indexedAt": "2026-11-13T16:02:11.000Z",
"truncated": false,
"repo": "acme/api"
}
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext