> ## Documentation Index
> Fetch the complete documentation index at: https://www.usenotra.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks overview

> Inbound GitHub webhooks, outbound post lifecycle, generation and GEO scan events and polling alternatives

Notra receives GitHub webhooks and sends signed outbound webhooks. GitHub events let event triggers generate content as soon as someone publishes a release or commits land on the default branch, while outbound subscriptions notify your endpoint about post lifecycle changes, tracked generation jobs and finished GEO scans.

> [!WARNING]
>
> Notra can also send signed [outbound webhooks](https://www.usenotra.com/docs/api/webhooks/outbound.md) to your own endpoint. You can set them up in **Settings**, then **Webhooks**, or through `/v1/webhooks`, and the GitHub endpoint below only receives events and has nothing to do with outbound subscriptions.

## Inbound webhooks from GitHub

GitHub is the only provider with a working webhook setup, while Linear, Slack and the other integrations connect through their APIs and do not use this endpoint.

### Payload URL

Each connected repository gets its own payload URL:

```text theme={"system"}
POST https://app.usenotra.com/api/webhooks/github/{organizationId}/{integrationId}/{repositoryId}
```

The dashboard generates this URL for you, so copy it from the **Setup Webhook** dialog instead of assembling it by hand. The IDs are internal, and Notra checks the URL against the organization and integration on every delivery.

### Set up the webhook

**1. Open the repository in Notra**

Go to **Integrations**, then **GitHub**, then open the repository you connected. Notra also shows the Setup Webhook dialog right after you add a repository.

**2. Copy the Payload URL and Secret**

The dialog shows three values: the **Payload URL**, the content type (`application/json`) and the **Secret**. Notra generates the secret the first time you open the dialog and masks it until you focus the field, so use the copy buttons to grab each value.

**3. Add the webhook on GitHub**

In your repository on GitHub, open **Settings**, then **Webhooks**, then **Add webhook**. Paste the Payload URL, set the content type to `application/json`, paste the Secret and choose **Let me select individual events**, then select **Pushes** and **Releases**.

**4. Confirm in Notra**

Click **I've added the webhook**. GitHub sends a `ping` event as soon as you save the webhook, and Notra answers it and writes a log entry so you can confirm the connection worked.

> [!NOTE]
>
> Without an inbound GitHub webhook you can still generate content manually, on a schedule or through `POST /v1/posts/generate`, because only GitHub event triggers need the inbound webhook.

### Rotate the secret

Open the repository page in Notra and use **Regenerate** in the webhook section. The old secret stops working immediately, so update the webhook on GitHub right after regenerating.

## Security

Notra verifies every delivery before reading the payload:

* **Signature.** GitHub signs the body with HMAC SHA-256 using your secret and sends it in the `X-Hub-Signature-256` header. Notra recomputes the signature and compares it in constant time, returning `400` for a missing header and `401` for a mismatch.
* **Ownership checks.** The organization, integration and repository IDs in the URL must match each other. Notra rejects deliveries to a disabled integration, or with IDs that do not belong together, with `403`.
* **Deduplication.** Notra remembers the `X-GitHub-Delivery` header for 24 hours. A redelivery of the same ID returns `200` with `"duplicate": true`, and Notra does not process it again.

## Responses

Notra answers every delivery with JSON, and GitHub shows the body under **Recent Deliveries** in your webhook settings.

```json Processed theme={"system"}
{
  "message": "Processed release event (published)",
  "event": "release",
  "delivery": "12345678-1234-1234-1234-123456789abc",
  "processed": {
    "type": "release",
    "action": "published",
    "data": { "tagName": "v1.2.0", "name": "Version 1.2.0", "body": "...", "prerelease": false, "draft": false, "publishedAt": "2026-09-01T14:30:00Z", "url": "https://github.com/owner/repo/releases/tag/v1.2.0" }
  },
  "repository": { "id": 123456, "fullName": "owner/repo" }
}
```

```json Ping theme={"system"}
{
  "message": "Pong! Webhook configured successfully",
  "event": "ping",
  "delivery": "12345678-1234-1234-1234-123456789abc"
}
```

```json Filtered theme={"system"}
{
  "message": "Event 'push' with action '' was filtered out",
  "event": "push",
  "action": "",
  "filtered": true
}
```

```json Ignored theme={"system"}
{
  "message": "Event type 'issues' is not supported",
  "event": "issues",
  "ignored": true
}
```

```json Duplicate theme={"system"}
{
  "message": "Webhook already processed (duplicate delivery)",
  "event": "push",
  "delivery": "12345678-1234-1234-1234-123456789abc",
  "duplicate": true
}
```

### Error responses

**400 Bad Request** `error`

Invalid URL parameters, missing `X-GitHub-Event` or `X-Hub-Signature-256` header, no webhook secret generated for the repository yet or a body that is not valid JSON in the expected shape.

**401 Unauthorized** `error`

The signature does not match the repository's secret, so regenerate the secret in Notra and update GitHub if the two drifted apart.

**403 Forbidden** `error`

The integration is disabled, does not belong to the organization in the URL or the repository does not belong to the integration.

**404 Not Found** `error`

Someone deleted the integration or repository.

**500 Internal Server Error** `error`

Notra could not finish processing the delivery, but GitHub keeps it in its history so you can redeliver it from the webhook settings page.

**501 Not Implemented** `error`

The provider segment in the URL is not `github`.

```json Invalid signature theme={"system"}
{ "error": "Invalid webhook signature" }
```

```json Integration disabled theme={"system"}
{ "error": "Integration is disabled" }
```

```json Missing event header theme={"system"}
{ "error": "Missing X-GitHub-Event header" }
```

```json Secret not generated theme={"system"}
{ "error": "Webhook secret not configured for this repository" }
```

## Logs

Notra writes every delivery, including rejected ones, to **Settings**, then **Logs** in the dashboard. Each entry shows the status, HTTP status code, GitHub delivery ID and payload summary, and Notra keeps entries for 7, 14 or 30 days depending on your plan.

## Polling alternatives

Post generation, brand analysis and GEO scans can send [outbound events](https://www.usenotra.com/docs/api/webhooks/outbound.md), though you can still poll them for status and progress if you prefer. Outbound subscriptions also cover post creation, edits, deletion, publishing and unpublishing, and new subscriptions only receive future events with no backfill.

> [card] [Poll post generation](https://www.usenotra.com/docs/api-reference/content/get-async-post-generation-status.md)
>
> `GET /v1/posts/generate/{jobId}` returns the job and its event log. Stop polling when `job.status` is `completed`, `failed` or `skipped`, and read `job.postId` once the job completes.

> [card] [Poll brand analysis](https://www.usenotra.com/docs/api-reference/content/get-async-brand-identity-generation-status.md)
>
> `GET /v1/brand-identities/generate/{jobId}` reports `queued`, `running`, `completed` or `failed` along with the current step.

> [card] Poll GEO scans
>
> `POST /v1/projects/{projectId}/geo/scans` returns a `statusUrl` and a `Location` header, so poll `GET /v1/projects/{projectId}/geo/scans/{scanId}` until `scan.status` leaves `running`.

> [card] Stream agent sessions
>
> `GET /v2/eve/v1/session/{sessionId}/stream` is a durable, replayable newline-delimited JSON stream, and you can pass `startIndex` to resume from a known position.

```bash curl theme={"system"}
JOB_ID=$(curl -s https://api.usenotra.com/v1/posts/generate \
  -H "Authorization: Bearer $NOTRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contentType":"changelog","lookbackWindow":"last_7_days"}' | jq -r '.job.id')

until curl -s "https://api.usenotra.com/v1/posts/generate/$JOB_ID" \
  -H "Authorization: Bearer $NOTRA_API_KEY" \
  | jq -e '.job.status | IN("completed","failed","skipped")' > /dev/null; do
  sleep 10
done
```

```typescript TypeScript theme={"system"}
const headers = { Authorization: `Bearer ${process.env.NOTRA_API_KEY}` };

const queued = await fetch("https://api.usenotra.com/v1/posts/generate", {
  method: "POST",
  headers: { ...headers, "Content-Type": "application/json" },
  body: JSON.stringify({ contentType: "changelog", lookbackWindow: "last_7_days" }),
}).then((res) => res.json());

const jobId: string = queued.job.id;
const terminal = new Set(["completed", "failed", "skipped"]);

let job = queued.job;
while (!terminal.has(job.status)) {
  await new Promise((resolve) => setTimeout(resolve, 10_000));
  const status = await fetch(`https://api.usenotra.com/v1/posts/generate/${jobId}`, { headers })
    .then((res) => res.json());
  job = status.job;
}

if (job.status === "completed") {
  const { post } = await fetch(`https://api.usenotra.com/v1/posts/${job.postId}`, { headers })
    .then((res) => res.json());
  console.log(post.title);
}
```

> [!TIP]
>
> Polling counts against the standard per-key rate limits, so ten seconds between checks is enough because generation jobs usually take a few minutes.

## Next steps

> [card] [Event reference](https://www.usenotra.com/docs/api/webhooks/events.md)
>
> Which GitHub events Notra processes, how they are filtered and what the processed payload looks like

> [card] [Event triggers](https://www.usenotra.com/docs/automation/event-based.md)
>
> Turn webhook events into generated content


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.