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

# Partner webhooks

> Save an address, choose the events you get, answer a call, and know how a failed one is tried again

A partner account can have Widgetic call its own server when something happens: an invoice is paid, credits run low, a customer's widget is published. Each call is a signed `POST` with a JSON body. [Events](https://docs.widgetic.com/docs/webhooks/events.md) lists every event, and each one has a page in the [API reference](https://docs.widgetic.com/api-reference/events/invoice-paid.md) with the fields of its call.

> [!NOTE]
>
> Partner webhooks are for [partner accounts](https://docs.widgetic.com/docs/api-keys.md#what-makes-a-key-a-partner-key). A workspace that is not a partner can be called when a visitor sends an entry: see [MCP events](https://docs.widgetic.com/docs/webhooks/mcp-events.md). The partner [integration guide](https://docs.superhuman.com/d/_do4kTYR8IRR/_sufIff3d) covers notifications and webhooks in section 4, and [section 11](https://docs.superhuman.com/d/_do4kTYR8IRR/_su6FYM6T) covers how a failed delivery is tried again.

## Set up a webhook

**1. Make an address that takes a POST**

Widgetic only calls an address that is:

* `https`, on the standard port (443), with no user name or password in it;
* the name of a public website: not an IP address, not a single word such as `intranet`, and not a name that ends in `.local`, `.internal`, `.lan` or another suffix of private networks;
* at most 2000 characters long.

It must not redirect: a redirect counts as a failed call. Widgetic also checks where the name leads each time it connects, so a name that points at a private address is refused. To try a receiver that runs on your own machine, put a tunnel in front of it.

**2. Save it in your notification settings**

Send `webhookUrl` to `PUT /partners/{partnerId}/notifications/settings`, with an API key that has full access. The first time you save an address, the answer holds your signing secret as `webhookSecret`. **It is shown once**, so store it now, where your receiver can read it.

**3. Send a test event**

Try your receiver before a real event comes: see [Send a test event](#send-a-test-event).

**4. Check every call**

Verify the signature, and handle each event once: see [Verify signatures](https://docs.widgetic.com/docs/webhooks/verify-signatures.md).

```bash theme={"theme":"css-variables"}
curl -sS -X PUT "https://api.widgetic.com/v1/partners/$WIDGETIC_PARTNER_ID/notifications/settings" \
  -H "Authorization: Bearer $WIDGETIC_PARTNER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "webhookUrl": "https://yourcompany.com/widgetic/events",
    "webhookEvents": null
  }'
```

```json theme={"theme":"css-variables"}
{
  "success": true,
  "data": {
    "settings": {
      "partnerId": "7d5f3c1a-2b64-4c0e-9a51-6f1e2d3c4b5a",
      "webhookUrl": "https://yourcompany.com/widgetic/events",
      "webhookSecretSet": true
    },
    "webhookSecret": "whsec_EXAMPLE_SHOWN_ONCE_KEEP_IT_SAFE"
  }
}
```

The answer also holds the other settings: this shows only what matters here. A setting you leave out of the body stays as it was, so send only what changes.

| Setting | What it does |
| - | - |
| `webhookUrl` | Where the signed calls go. `null`, or an empty text, switches the webhook off |
| `webhookEvents` | The events sent to your webhook. `null` means every event, those about your managed users included and those added later. A list names exactly the events you get, so add a new event to it to receive it |

The same route sets where the emails go: see [Notifications](https://docs.widgetic.com/docs/partners/notifications.md#choose-where-they-go).

## What a call looks like

The body is JSON, and the headers are those of the [Standard Webhooks](https://www.standardwebhooks.com) scheme, so any of its libraries can verify a call. This is one as it arrives:

```http theme={"theme":"css-variables"}
POST /widgetic/events HTTP/1.1
Host: yourcompany.com
Content-Type: application/json
User-Agent: WidgeticPartnerEvents/1.0 (+https://widgetic.com)
webhook-id: evt_5f0c2a9e4b7d4c1e8a3b6d9f1c2e4a7b
webhook-timestamp: 1794303005
webhook-signature: v1,fQ/swWKfYIS0aZxwAxGHXeqqHLkpWilAGZ+twOS2Ot8=
x-widgetic-event: invoice.paid
```

```json theme={"theme":"css-variables"}
{
  "id": "evt_5f0c2a9e4b7d4c1e8a3b6d9f1c2e4a7b",
  "type": "invoice.paid",
  "createdAt": "2026-11-10T09:30:05.000Z",
  "partnerId": "7d5f3c1a-2b64-4c0e-9a51-6f1e2d3c4b5a",
  "data": {
    "invoiceNumber": "TEST-0001",
    "subtotal": 100,
    "taxAmount": 19,
    "total": 119,
    "currency": "EUR",
    "dueDate": "2026-11-15T00:00:00.000Z",
    "hostedInvoiceUrl": "https://example.com/widgetic/invoices/TEST-0001",
    "purpose": "contract",
    "paidAt": "2026-11-10T09:30:00.000Z"
  }
}
```

Widgetic sends the body as one line, without spaces, and the signature covers exactly those bytes. The signature above is made with the example secret of [Verify signatures](https://docs.widgetic.com/docs/webhooks/verify-signatures.md#check-your-code-against-a-known-call).

| Header | What it holds |
| - | - |
| `webhook-id` | The event's `id`. It is the same on every retry and every replay, so use it to drop an event you already handled |
| `webhook-timestamp` | When the call was signed, in seconds since 1970 |
| `webhook-signature` | `v1,` and the base64 HMAC-SHA256 of `<webhook-id>.<webhook-timestamp>.<the raw body>`, under your secret. While a rotated secret overlaps, two signatures are listed, separated by a space |
| `x-widgetic-event` | The event type, for example `invoice.paid`, so that you can route a call before you read its body |
| `user-agent` | `WidgeticPartnerEvents/1.0 (+https://widgetic.com)` |
| `content-type` | `application/json` |

| Field of the body | What it holds |
| - | - |
| `id` | `evt_` and 32 hexadecimal characters: the same as the `webhook-id` header |
| `type` | What happened, for example `invoice.paid`: see [Events](https://docs.widgetic.com/docs/webhooks/events.md) |
| `createdAt` | When the event was told, in ISO 8601 and UTC. A call sent again by a replay carries the time of the replay |
| `partnerId` | Your partner account |
| `data` | The facts of the event, named in camelCase. The page of each event in the [API reference](https://docs.widgetic.com/api-reference/events/invoice-paid.md) lists them |

## Answer and retries

Answer with a `2xx` within 10 seconds, and do the work afterwards. Widgetic reads at most 16 KiB of your answer and ignores what it says, so keep it short.

| Your address answers | What Widgetic does |
| - | - |
| A `2xx` status | The delivery is done |
| `410 Gone` or `413 Payload Too Large` | The delivery ends at once, with no more tries |
| Anything else: another status, a redirect, no answer in time, or no connection | The call is tried again, as in the table below |

A call is tried 8 times in all, the last one about 45 hours after the first. Each wait begins when the attempt before it failed, and your address is read again for every attempt, so a receiver you mend in the meantime still gets the event.

| Attempt | When it is made | About this long after the event |
| - | - | - |
| 1 | When the event is told | At once |
| 2 | 1 minute after attempt 1 failed | 1 minute |
| 3 | 5 minutes after attempt 2 failed | 6 minutes |
| 4 | 30 minutes after attempt 3 failed | 36 minutes |
| 5 | 2 hours after attempt 4 failed | 2 hours 36 minutes |
| 6 | 6 hours after attempt 5 failed | 8 hours 36 minutes |
| 7 | 12 hours after attempt 6 failed | 20 hours 36 minutes |
| 8 | 1 day after attempt 7 failed | 1 day 20 hours 36 minutes |

Delivery is **at least once**. If your answer is lost, the same event arrives again with the same `webhook-id`. A slow receiver, or one that is down for a while, does not lose an event, but your code has to be able to meet one twice, and to meet events in a different order than they happened, because a retried event arrives after newer ones. Keep the ids you handled and drop a repeat.

## Send a test event

`POST /partners/{partnerId}/notifications/test-event` makes one call, now, to your saved address, with made-up data of the type you name, and tells you how it went. Use it to write your receiver, above all the signature check, before a real event happens.

```bash theme={"theme":"css-variables"}
curl -sS -X POST "https://api.widgetic.com/v1/partners/$WIDGETIC_PARTNER_ID/notifications/test-event" \
  -H "Authorization: Bearer $WIDGETIC_PARTNER_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "eventType": "invoice.paid" }'
```

```json theme={"theme":"css-variables"}
{
  "success": true,
  "data": {
    "delivered": true,
    "statusCode": 200,
    "durationMs": 182
  }
}
```

| Field of the answer | What it holds |
| - | - |
| `delivered` | `true` when your address answered with a `2xx` status |
| `statusCode` | The status your address answered with, or `null` when it did not answer |
| `durationMs` | How long the call took, in milliseconds |
| `error` | Why the call did not arrive, in a few words (`timeout`, `status 500`, `unreachable`). Left out when it arrived |

A test call is made like every other, with these differences:

* Its `id` starts with `evt_test_` and is new every time, so a receiver that remembers ids can tell a test from a real event.
* It is sent once and is not tried again, and it is not kept in your delivery log.
* It is sent whatever `webhookEvents` says.
* Its `data` is made up, in the shape a real event of that type carries.

It needs an API key with full access, a partner administrator, and an `Idempotency-Key`. You can send 5 a minute: more are refused with `429`, and `Retry-After` says when to try again. Without a saved address and secret the answer is `409`.

## Rotate the secret

`POST /partners/{partnerId}/notifications/webhook-secret` makes a new secret and returns it once as `webhookSecret`. Use it when the secret was lost or may have leaked. The old secret keeps signing for 1 day, next to the new one, so that your receiver can switch without a call being rejected: during that time each call carries two signatures, and the code of [Verify signatures](https://docs.widgetic.com/docs/webhooks/verify-signatures.md#rotate-a-secret) accepts either. Rotating again within that time ends the overlap with the first secret.

Send an `Idempotency-Key` with it, and retry with the **same** key if the answer was lost: you get the same answer, secret included, and no second secret is made. The call needs an API key with full access.

## See what was sent

The delivery log lists every call to your webhook, with whether it was delivered, when it is tried again, how many attempts it had, the status your address answered with and why the last attempt failed. You can send a delivery again, for example after you mended your receiver, and it keeps the `webhook-id`. See [See what was sent](https://docs.widgetic.com/docs/partners/notifications.md#see-what-was-sent).

## Errors

| Status | Code | When | What to do |
| - | - | - | - |
| 400 | `INVALID_NOTIFICATION_SETTINGS` | The settings are refused: the address does not meet the rules above, or there are more than 5 email recipients. `details.problems` lists what is wrong | Correct it |
| 400 | `VALIDATION_FIELD_INVALID` or `VALIDATION_FIELD_REQUIRED` | A field is missing or has the wrong form: an event name that does not exist, the `eventType` of a test event, or the `Idempotency-Key` header of a test event, a replay or a secret rotation | Correct it. `param` names the field |
| 403 | `API_KEY_SCOPE_MISSING` | Your key is limited to some scopes and the call needs more: changing the settings, rotating the secret, sending a test event and replaying a delivery need full access | Use a key with full access |
| 409 | `BUSINESS_STATE_CONFLICT` | A test event or a replay, and no webhook address or signing secret is saved yet | Save an address first |
| 429 | `RATE_LIMIT_USER_EXCEEDED` | Too many test events or replays in a short time, counted for each person | Wait for the seconds in `Retry-After` |
| 503 | `WEBHOOK_SIGNING_UNAVAILABLE` | This server cannot sign webhooks yet (`webhookSigningAvailable` is `false` in the settings) | Write to [the support team](https://docs.widgetic.com/docs/introduction.md#need-help). Email and the dashboard list work meanwhile |

> [card] [Verify signatures](https://docs.widgetic.com/docs/webhooks/verify-signatures.md)
>
> Check a call in TypeScript, Python, Go, Java, C#, Ruby or PHP.

> [card] [Events](https://docs.widgetic.com/docs/webhooks/events.md)
>
> Every event, when it happens, and whether it is also emailed.

> [card] [Notifications](https://docs.widgetic.com/docs/partners/notifications.md)
>
> Emails, the dashboard list and the delivery log.


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