Receive a Git provider push webhook
Changed onPublic endpoint that receives a push event from a Git provider (typically GitHub). The webhook token in the URL path (:webhook) authenticates the call; no Authorization header is sent.
Accepts application/json only. The optional branch query parameter filters which branch triggers a deploy — if present and body.ref does not match refs/heads/<branch>, the request is accepted with 202 but no deploy is queued. Pushes of tags (or any ref outside refs/heads/) and branch deletions are also answered with 202 and never deployed, before the rate limit, so they cannot hold back a deploy that arrives right after them. The optional restart query parameter (?restart=false) skips the post-deploy application restart.
Responses are text/plain and always say whether a deploy was queued; only the 429 of the 15-second deploy limit is the JSON error body. A 200 is sent only after the deploy job is stored: on a temporary failure the answer is 503 and the push must be redelivered. Rate limited to 1 deploy per 15 seconds per webhook token, and to 10 deliveries over 1 MB (or without Content-Length) a minute per webhook token whatever their outcome (a text 429 RATE_LIMITED, before the payload is read).
Request
- Base URLhttps://api.squarecloud.app
- Authnone required
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Per-application Git webhook token (64 hex chars).
Query parameters
Lowercase branch name (≤256 chars). When provided, only matching pushes trigger a deploy.
Pass false to skip the post-deploy application restart.
Request body
Response
The deploy was queued. It is only answered after the job is stored.
Changes
- warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status - warning
added the new
SNAPSHOTS_UNAVAILABLEenum value to the////response property for the response status
- warning
- warning
added the new
WRITE_FAILEDenum value to the////response property for the response status - warning
added the new
WRITE_FAILEDenum value to the////response property for the response status - warning
added the new
WRONG_HOSTenum value to the////response property for the response status - warning
added the new
WRONG_HOSTenum value to the////response property for the response status
- warning