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

# Overview

> Get notified of changes by receiving events at your webhook URL.

<Tip>
  Webhooks are available to
  [Entreprise](https://brandfetch.com/developers/pricing) customers, if you're
  interested [contact us](https://brandfetch.com/developers/contact/sales).
</Tip>

## Why use webhooks

When building Brandfetch integrations, you might want your applications to receive events as they occur for brands you're interested in, so that your backend systems can execute actions accordingly.

To enable webhook events, you need to [register webhook endpoints](/webhooks/setup#register-your-endpoint). After you register them, Brandfetch can push real-time event data to your application’s webhook endpoint when things happen. Brandfetch uses HTTPS to send webhook payloads to your app as a JSON payload that includes an Event object. The implementation follows the v1 of the [Standard Webhooks](https://github.com/standard-webhooks/standard-webhooks/blob/main/spec/standard-webhooks.md) specification.

Receiving webhook events is particularly useful for listening to asynchronous events such as when a brand’s logo changes, a company detail is updated, or when we index new data.

## Event overview

<Info>
  Brandfetch implements version 1.0.0 of [the Standard
  Webhooks](https://github.com/standard-webhooks/standard-webhooks/blob/main/spec/standard-webhooks.md)
  specification.
</Info>

Brandfetch generates event data that we can send you to inform you of brand activity.

When an event occurs, Brandfetch generates a new event object. A single API request might result in the creation of multiple events. For example, if we re-index a brand, you may receive `brand.company.updated` and `brand.updated` events.

By registering webhook endpoints with Brandfetch, you enable us to automatically send event payloads as part of POST requests to the registered webhook endpoint hosted by your application. After your webhook endpoint receives the event payload, your app can run backend actions (for example, updating your database after you receive a `brand.updated` event).

### Event payload

The event object we send to your webhook endpoint provides a snapshot of the object that changed. They might include a `delta` property that indicates the change, when applicable.

See the full [list of event types](/webhooks/event-types) that we can send to your webhook.

### Example event payload

The following event shows a subscription update at the end of a trial.

<CodeGroup>
  ```JSON JSON theme={null}
  {
    "type": "brand.updated",
    "timestamp": "2024-01-01T00:00:00.000000Z",
    "urn": "urn:brandfetch:organization:0123:webhook:1234:event:2345",
    "data": {
      "object": { "__typename": "Brand", "id": "id123456", "domain": "brandfetch.com", "verified": true, ... },
      "delta": { "verified": { "old": false, "new": true } }
    }
  }
  ```

  ```TypeScript TypeScript theme={null}
  interface WebhookEventPayload {
    readonly type: string;
    readonly timestamp: string;
    readonly urn: string;
    readonly data: {
      readonly object: Record<string, string>;
      readonly delta: Record<string, { readonly old: any; readonly new: any }>;
    };
  }
  ```
</CodeGroup>

### Event type

You receive events for all of the event types your webhook endpoint is listening for in your configuration. Use the received event type to determine what processing your application needs to perform. The `data.object` corresponding to each event type varies, but typically will be the namespace object (e.g. a Brand given brand.updated where `brand.*` is the event namespace.)

### Data object and previous attributes delta

Event payloads may include a `data.delta` property which will indicate which fields changed. For `*.updated` events, the event payload always includes the `data.delta` property which will allow you to inspect what’s been updated on the object.

The delta attributes in the example `brand.updated` event above indicates that the brand has a previous value of `verified: false`. The `data.object` property shows that the verified field has been set to `true` which indicates that the brand has been `verified` by Brandfetch's curation team.
