Connect Stripe or GitHub with one key

Registers an app's inbound URL as a webhook at Stripe or GitHub using the provider's own key, saves the signing secret the provider yields, and turns on signature verification at the edge. The provider is read from the key prefix (sk_/rk_ for Stripe, github_pat_/ghp_ for GitHub). The key is used for these calls only and is not stored. Without app, a new app is created for the provider (and removed again if the provider refuses the key). Re-running replaces the registration instead of duplicating it. Least privilege: a Stripe restricted key with Webhook Endpoints = Write, or a fine-grained GitHub token with Webhooks = Read and write.

post/api/v1/connect

Request

  • Base URL: https://anyhook.net
  • URL: https://anyhook.net/api/v1/connect
  • Auth: HTTP bearer

Request body

keystring required

Stripe secret or restricted key, or GitHub token. Not stored.

appstring

Slug of an existing app to connect. Omit to create a new app.

targetstring

GitHub only: "owner/repo", or an organization name for an org-wide hook. Optional when the token administers exactly one repository.

Response

Existing app connected

Changes

No recorded changes to this operation across all 2 revisions of this API.