Connect continuous GitHub source sync
PreviewApply a reviewed GitHub package and enable continuous sync. Pull mode is read-only; two_way also publishes local edits using conditional commits.
/v1/agents/{agent_id}/sourceSee authentication for credentials and permissions.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Prefixed public identifier
Request Bodyrequired
Section titled “Request Bodyrequired”Reviewed package location and concurrency tokens required to enable source sync.
object
Branch whose future commits the Agent follows.
Example
mainRepository-relative package folder or manifest; empty selects the repository root.
Example
agents/supportGitHub repository in owner/name form.
Example
acme/agentsAgent package digest returned by preview, protecting concurrent local edits.
Example
0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdefExact source commit returned by preview; a changed branch requires another preview.
Example
0123456789abcdef0123456789abcdef01234567Current binding generation when replacing a source; omit for an unbound Agent.
Example
018f30c8-c970-7cb5-a8c9-9348aa71ba8cSynchronization direction; two_way requires repository Contents write access.
Responses
200Success
Success
Continuous GitHub source binding, applied revision and reconciliation status.
object
Last successfully applied commit; retained when a later revision fails.
Branch monitored for source updates.
Safe diagnostic for the latest failed check, without upstream credentials.
Binding generation used to detect a concurrent reconnect or disconnect.
GitHub account the source reads through: personal, organization, or agent for a binding made before sync stopped using the Agent’s identity.
UTC time when the source was last checked.
UTC time when a source revision was last applied successfully.
Local edits are waiting for GitHub synchronization.
Package channel names whose configuration is managed by the source.
Direction of synchronization: pull or two_way.
Repository-relative package folder or manifest; empty means the root.
Selected GitHub repository in owner/name form.
Current reconciliation state, including conflict when both sides changed.
Example
{ "applied_commit": "0123456789abcdef0123456789abcdef01234567", "branch": "main", "error": "Source package validation failed: missing capability", "generation": "018f30c8-c970-7cb5-a8c9-9348aa71ba8c", "github_account": "organization", "last_checked_at": "2026-10-23T12:00:00Z", "last_synced_at": "2026-10-23T12:00:00Z", "local_dirty": false, "managed_channels": [ "chat" ], "mode": "two_way", "path": "agents/support", "repository": "acme/agents", "status": "synced"}