Auto-pull API collections when the repository changes

A collection synced with Git normally learns about new commits when someone opens its Git sync dialog. That's fine for a solo project. On a team, it means your teammate merged a fix to the login request an hour ago and you're still running the broken one. A webhook closes that gap.

Turn it on

A workspace admin opens the collection's Overview ▸ Git sync ▸ Set up a webhook… ▸ Turn the webhook on. The dialog shows:

  • a payload URL like https://api.requestarium.com/sync/webhooks/github/<webhook id>;
  • a secret, shown once. It's stored encrypted; Create a new secret replaces it.

Tick Pull new commits automatically in the same place if you want auto-pull.

Add it in your provider

ProviderWhereSettings
GitHubRepository ▸ Settings ▸ Webhooks ▸ Add webhookPayload URL; content type application/json; the secret; "Just the push event"
GitLabProject ▸ Settings ▸ WebhooksURL; Secret token; "Push events", optionally for the linked branch
Bitbucket CloudRepository settings ▸ WebhooksURL; Secret; "Repository push"
Gitea / ForgejoRepository ▸ Settings ▸ WebhooksTarget URL; POST; application/json; Secret; "Push events"
Azure DevOpsProject settings ▸ Service hooks ▸ Web Hooks"Code pushed"; Basic authentication with the secret as password; resource details: All

AWS CodeCommit has no webhooks of its own; route its repository events through an Amazon EventBridge rule and an API destination that sends the secret in an X-Requestarium-Token header.

What happens on a push

  1. The provider posts the push event. Requestarium checks the signature with the link's secret, ignores anything that isn't a push to the linked branch, ignores redeliveries it has already seen, and records the new head commit.
  2. Apps that have the collection open check the link every 30 seconds while a webhook is on.
  3. Without auto-pull, the Git sync button shows a dot: open the dialog, review, pull.
  4. With auto-pull, the app runs the same three-way merge as the dialog. If the changes merge without a single conflict, they're applied. Your own unpushed edits stay as they are.

If anything conflicts, nothing changes and the dot stays until someone settles it in the dialog.

The merge runs in the app, not on the server, so an automatic pull happens the next time any member who can edit the collection has it open. The result is then the same for everyone.

When a webhook can't reach you

A self-hosted Requestarium behind a firewall, or a bucket link, can't receive webhooks. Use a scheduled check instead: Git sync ▸ Set up a schedule…, every 15 minutes to once a day. The server looks at the branch head on that interval and marks the collection as behind, the same as a webhook would. Scheduled checks are part of the Team plan.

For a pull with nobody at the keyboard, run the CLI on a schedule in your CI:

Terminal
requestarium sync pull --all --strategy theirs

What the endpoint can do

The webhook endpoint is public and carries no session. A valid delivery can do one thing: tell its own link "the branch head is now commit X". It never reads the repository and never changes the collection. A late or out-of-order delivery corrects itself, because every sync reads the real branch head.