# Configure Content Ingestion Webhook

## User Intent

"How do I get notified when content is ingested? Show me webhook configuration."

## Operation

**SDK Method**: Configure webhook in Developer Portal\
**Use Case**: Real-time content ingestion notifications

***

## Configuration

1. **Developer Portal** → Webhooks → Create Webhook
2. **URL**: Your webhook endpoint
3. **Events**: Select `content.ingested`, `content.updated`
4. **Secret**: Webhook signing secret

***

## Webhook Payload

```json
{
  "event": "content.ingested",
  "contentId": "content-123",
  "name": "document.pdf",
  "type": "FILE",
  "status": "COMPLETED",
  "timestamp": "2024-01-15T10:30:00Z"
}
```

***

## Handling Webhooks (TypeScript)

```typescript
import express from 'express';
import crypto from 'crypto';

const app = express();
app.use(express.json());

app.post('/graphlit-webhook', (req, res) => {
  // Verify signature
  const signature = req.headers['x-graphlit-signature'];
  const payload = JSON.stringify(req.body);
  const secret = process.env.WEBHOOK_SECRET!;
  
  const expectedSig = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  
  if (signature !== expectedSig) {
    return res.status(401).send('Invalid signature');
  }
  
  // Process event
  const { event, contentId } = req.body;
  console.log(`Received ${event} for ${contentId}`);
  
  // Your logic here
  
  res.status(200).send('OK');
});

app.listen(3000);
```

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.graphlit.dev/api-guides/use-cases/production/webhook-content-ingestion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
