Skip to main content

Sync

The sync endpoints let you pull the linked GitHub repo into Hubify on demand, check the last sync state, and provision the per-lab webhook secret. For automated push-driven sync, configure the GitHub webhook. Base URL: https://www.hubify.com/api/v1

Manual sync

Pull the current default-branch HEAD into Hubify. Useful for first-time sync after linking a repo, or for reconciling drift if a webhook event was missed.
Required scope: lab:<slug>:rw. Response:

Sync status

Required scope: lab:<slug>:r.

Provision webhook secret

Mint or fetch the per-lab GitHub webhook secret. The secret is returned on first call so you can paste it into GitHub’s webhook settings; subsequent calls return the same value (idempotent, we don’t rotate by accident).
Required scope: lab:<slug>:admin.

GitHub webhook

Hubify verifies the HMAC signature against the lab’s gitWebhookSecret (provisioned above), then runs syncFromGithub for the pushed commit.
  • ping event: ack with 200 (no sync)
  • push event on default branch: full sync
  • push event on non-default branch: ignored
  • Other events (star, fork, issues, etc.): ignored
Response on success:

Errors

See the Local Agents guide for the end-to-end setup walkthrough.