---
title: "Receive a push from a git provider"
url: https://docs.corefinity.com/api/reference/webhooks/receive-git-push-webhook
type: endpoint
last_updated: 2026-11-13
feature: git-webhooks
related:
  - https://docs.corefinity.com/guides/corestack-enterprise/repositories-and-webhooks.md
---
# 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.

```http
POST /api/{provider}/webhooks/environments/{environment}/repositories/{repository}
```

- Rate limit: 120 a minute; 600 a minute for each address
- Try it in the console: off. It runs commands on a live site. Copy the request and run it yourself when you are sure.

## Path parameters

- `provider` (string, required): The git provider that delivers the push.
- `environment` (integer, required): The id of the CoreStack Enterprise environment the repository deploys to.
- `repository` (integer, required): The id of the environment's repository, as the Control Panel lists it.

## Body


## Request

### curl

```bash
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"
    }
  }'
```

### PHP

```php
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();
```

### Node

```javascript
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);
```

### Python

```python
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
```

## Responses

### 204 Received. No body, whatever the Control Panel did with the delivery; a delivery that is sent twice is acted on once.

### 404 A delivery that verified names an environment that does not exist. A delivery whose signature does not verify is answered `204` like any other, whether or not its ids exist.

```json
{
  "message": "Not found."
}
```

### 429 Too many deliveries for this repository or from this address in a minute (`rate_limited`, with `Retry-After`). The provider delivers again later.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 404 |  | Check the id. You see only what your account can reach. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Repositories and webhooks](https://docs.corefinity.com/guides/corestack-enterprise/repositories-and-webhooks.md)
