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

# Webhook Sink

> Pipe every report into your own infrastructure with a generic outbound webhook.

The webhook integration POSTs the full report to your URL after every successful run. Use it to:

* Build your own dashboard
* Forward into a Slack/Telegram/Discord bot you already maintain
* Trigger downstream automations (Zapier, n8n, Cursor agents)
* Archive runs into your own database

## Setup

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X PUT https://api.appeeky.com/v1/cofounder/integrations/webhook \
  -H "X-API-Key: $APPEEKY_KEY" \
  -d '{
    "credentials": { "url": "https://your-server.com/cofounder-hook" },
    "integrationConfig": { "secret": "shared-secret-for-verification" }
  }'
```

The endpoint is tested before saving — a `test.connection` event is POSTed and we expect a 2xx/3xx response.

## Enable

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
PUT /v1/cofounder/preferences
{ "enabledIntegrations": ["webhook"] }
```

## Payload — `report.created`

Every successful run fires:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
POST https://your-server.com/cofounder-hook
Content-Type: application/json
User-Agent: Appeeky-Cofounder/1.0
X-Cofounder-Secret: <your secret if configured>

{
  "event": "report.created",
  "ownerEmail": "you@example.com",
  "appId": "6479581124",
  "reportId": "uuid",
  "timestamp": "2026-05-02T08:00:00Z",
  "report": { ...full DailyReport object... }
}
```

## Payload — `webhook_post` action

When the LLM proposes a `webhook_post` action (rare, used for narrative events):

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "event": "competitor.major_move",
  "summary": "Acme shipped v3.0 with AI subtitle and dropped price 30%",
  "timestamp": "2026-05-02T08:00:00Z"
}
```

## Verifying the secret

If you set `secret`, every request includes it as `X-Cofounder-Secret`. Compare it server-side:

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
app.post("/cofounder-hook", (req, res) => {
  if (req.headers["x-cofounder-secret"] !== process.env.COFOUNDER_SECRET) {
    return res.status(401).end();
  }
  // process req.body
  res.status(200).end();
});
```

The secret is stored in `cofounder_integrations.config` and never exposed via the API.

## Failure handling

* HTTP 4xx/5xx → logged with `last_error` on the integration row, but the run still completes
* Network failure → logged, run still completes
* We don't retry — your endpoint is responsible for being available, or queue your own retry layer

## Disable

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
PUT /v1/cofounder/preferences { "enabledIntegrations": [] }
```

(remove `"webhook"` from the array). To delete credentials entirely:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
DELETE /v1/cofounder/integrations/webhook
```
