Receive a push from a git provider
You do not call this endpoint. When you add a repository to an environment that deploys automatically, the Control Panel installs a webhook at your git provider that points here, with a secret of its own, and a push to the branch the repository deploys starts a deployment. A delivery is verified by the provider's signature over the exact bytes of the body, never by a token. Every delivery to a repository that exists is answered 204 with no body, whether or not it started a deployment, so the answer does not say what was done with it: read the repository in the Control Panel to see whether your deliveries arrive. Limited to 120 a minute for one repository and to 600 a minute from one address.
Path parameters
The git provider that delivers the push.
githubgitlabbitbucketThe id of the CoreStack Enterprise environment the repository deploys to. At least 1.
The id of the environment's repository, as the Control Panel lists it. At least 1.
Body
The body is application/json. The request example shows its shape.
Returns
204 Received. No body, whatever the Control Panel did with the delivery; a delivery that is sent twice is acted on once.
If it is refused
| Status | Reason | What to do |
|---|---|---|
404 | none | Check the id. You see only what your account can reach. |
429 | rate_limited | Wait for the seconds in Retry-After. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X POST https://manage.corefinity.com/api/github/webhooks/environments/1311/repositories/4471 \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"after": "abc123def456789012345678901234567890abcd",
"before": "9999999999999999999999999999999999999999",
"head_commit": {
"author": {
"name": "Daniel Reyes"
},
"id": "abc123def456789012345678901234567890abcd",
"message": "Add the autumn sale banner"
},
"pusher": {
"name": "danielreyes"
},
"ref": "refs/heads/main",
"repository": {
"full_name": "northwind-digital/harbourandfinch"
}
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/github/webhooks/environments/1311/repositories/4471', [
'after' => 'abc123def456789012345678901234567890abcd',
'before' => '9999999999999999999999999999999999999999',
'head_commit' => [
'author' => [
'name' => 'Daniel Reyes',
],
'id' => 'abc123def456789012345678901234567890abcd',
'message' => 'Add the autumn sale banner',
],
'pusher' => [
'name' => 'danielreyes',
],
'ref' => 'refs/heads/main',
'repository' => [
'full_name' => 'northwind-digital/harbourandfinch',
],
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/github/webhooks/environments/1311/repositories/4471', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
after: 'abc123def456789012345678901234567890abcd',
before: '9999999999999999999999999999999999999999',
head_commit: {
author: {
name: 'Daniel Reyes',
},
id: 'abc123def456789012345678901234567890abcd',
message: 'Add the autumn sale banner',
},
pusher: {
name: 'danielreyes',
},
ref: 'refs/heads/main',
repository: {
full_name: 'northwind-digital/harbourandfinch',
},
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.post(
"https://manage.corefinity.com/api/github/webhooks/environments/1311/repositories/4471",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"after": "abc123def456789012345678901234567890abcd",
"before": "9999999999999999999999999999999999999999",
"head_commit": {
"author": {
"name": "Daniel Reyes",
},
"id": "abc123def456789012345678901234567890abcd",
"message": "Add the autumn sale banner",
},
"pusher": {
"name": "danielreyes",
},
"ref": "refs/heads/main",
"repository": {
"full_name": "northwind-digital/harbourandfinch",
},
},
)
data = res.json() if res.content else None{
"message": "Not found."
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}Try it is off for this endpointIt runs commands on a live site. Copy the request and run it yourself when you are sure.