/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Get GitHub Link

Get GitHub Link

Where a project's pages live, and where a move to GitHub stands.

GET/v1/projects/{projectId}/source/githubTry it
Session token

Where the project's pages live — in Syntext or in a GitHub repository — and, when a move between them has started, where it stands.

Note

Requires the admin or owner role and a session JWT; API keys are refused with 401. This applies to every /source/github endpoint: they change where a project's content lives.

Moving a project written in Syntext to GitHub and back takes four endpoints:

EndpointDescription
GET /source/githubWhere the pages live; finishes a link whose pull request was merged
POST /source/github/previewWhat linking a repository would do. Never writes
POST /source/github/connectLink: push the pages, open a pull request, or use the repository's pages
POST /source/github/disconnectUnlink: copy the repository's pages back into Syntext

Path Parameters

NameDescription
projectId:stringpathRequired
The project ID.

Response

NameDescription
contentSource:string
hosted, github or upload.
repoUrl:string | null
The connected repository.
branch:string | null
The branch the site builds from, on a GitHub project. null otherwise.
docsPath:string | null
The docs folder in the repository ("" for its root), on a GitHub project. null otherwise.
sync:object | null
Where a move stands — the project's githubSync. state is pushing, pending_merge, linked, pr_closed or failed. null when the project never used the flow.

While a pull request is pending, this checks it on GitHub. If it was merged, the project switches to GitHub and builds the merge commit — so the link finishes even if GitHub's merge webhook was missed. If it was closed unmerged, state becomes pr_closed and the project stays in Syntext.

Error Responses

403 Forbidden

forbidden — you're not an admin or owner of the workspace, or not a member.

404 Not Found

The project doesn't exist.

Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request GET \
--url 'https://api.syntext.dev/v1/projects/{projectId}/source/github' \
--header 'Authorization: Bearer <jwt>'
Responseapplication/json
json
{
"data": {
"contentSource": "hosted",
"repoUrl": null,
"branch": null,
"docsPath": null,
"sync": {
"state": "pending_merge",
"strategy": "pull_request",
"repoUrl": "https://github.com/acme/docs",
"branch": "main",
"docsPath": "docs",
"installationId": 51234567,
"revision": 14,
"commitSha": "9d4e1b7c3a5f8e2d6b0c4a9f1e7d3b5c8a2f6e0d",
"prBranch": "syntext/move-from-syntext-2026-11-14",
"pullRequest": { "number": 42, "url": "https://github.com/acme/docs/pull/42" },
"startedAt": "2026-11-14T09:30:00.000Z",
"updatedAt": "2026-11-14T09:30:12.000Z"
}
}
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext