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

# Types of webhooks available with Affinity's API

> Help center reference

<Note>
  **Reference** — lookup information.
</Note>

Get notified of events in your Affinity account by setting up webhooks with [Affinity's API V1](https://api-docs.affinity.co/#webhooks) (not available for API V2 at this time).

**Note**: If you're currently trialing Affinity, you will **not** be able to access the Affinity API (and therefore set up webhooks) until you purchase one of the following tiers: **Scale**, **Advanced**, or **Enterprise**. Please see [Getting started with the Affinity API + FAQs](/s/article/Getting-started-with-the-Affinity-API-faqs).

## Important Callouts

* Payload responses are formatted the same for each webhook event (created, updated, deleted), except for the ones with a "**Note:**" mentioned.
* Setting up webhooks for Affinity is only available using Affinity's API V1 at this time, not API V2. Please see the section titled "Differences between API V1 and API V2" in the article [Getting started with the Affinity API + FAQs](/s/article/Getting-started-with-the-Affinity-API-faqs).

## Frequently Asked Questions

### Do webhooks count toward my API credits?

* Creating, updating, and deleting the webhook URL or making any changes to the subscription will count towards your API credits.
* API events sent to your URL do **not** count towards your API credits.

### What events do not trigger webhooks?

* Auto-enriched field values will not trigger webhooks (this includes [Affinity Data](/s/article/Affinity-Data), [PitchBook](/s/article/How-to-integrate-Affinity-with-Pitchbook), [Dealroom.co](/s/article/Dealroom-co-data-in-Affinity) fields, and the [enriched fields](/s/article/Enriched-Global-and-List-specific-Fields) provided by Affinity).
  * Webhooks will only get triggered within auto-enriched fields if a user decides to manually add values to these fields or delete these manually-added values in the future.

### Do imports trigger webhooks?

**Yes.** [Importing data into Affinity](/s/article/How-to-import-your-data-into-Affinity) changes field values, and those changes fire webhooks like any other edit.

**Undoing an import also triggers webhooks**, because the undo changes values back to a previous state. Treat the undo as a second set of changes rather than a mirror image of the first — the data may have moved on between the import and the undo, so the events it generates will not necessarily be the exact inverse.

If you have webhook subscriptions, size the expected volume before running a large import — see the next question.

### How many webhooks will an import send?

Three things multiply:

1. **Rows actually changed.** Rows whose values do not change generate no events.
2. **One edit can produce more than one event.** A single field value change commonly arrives as a `field_value.deleted` for the old value followed by a `field_value.created` for the new one, rather than a single `field_value.updated`. Subscribe to all three event types and treat them as a stream of changes — don't assume one event per edit.
3. **Each subscription is delivered separately.** If three subscriptions listen for `field_value.created`, one created event leaves Affinity as three webhooks.

Put together, the volume is:

```text theme={null}
(rows changed) × (events per change — often 2, sometimes 1) × (subscriptions listening)
```

**Worked example** — an import that changes one field on 100 rows, with three subscriptions listening to both created and deleted:

* 100 rows × up to 2 events = **up to 200 events**
* 200 events × 3 subscriptions = **up to 600 webhooks**

Plan for the upper bound.

If you later undo the import, budget for a second wave of webhooks on top.

If you use webhooks to track ownership or status, expect to see removals as well as additions when values change. This is expected behaviour, and the resulting data in your CRM is correct.

## Types of Webhooks

### Organization

Please note that the "Organization merged" webhook will provide a different response.

```json theme={null}
{
  "type": "organization.created",
  "body": {
    "id": 64779194,
    "name": "Affinity",
    "domain": "affinity.co",
    "domains": ["affinity.co"],
    "crunchbase_uuid": null,
    "global": true
  },
  "sent_at": 1636645351
}
```

### Organization Merged

```json theme={null}
{
  "type": "organization.merged",
  "body": {
    "changer": {
      "id": 38706,
      "type": 1,
      "first_name": "John",
      "last_name": "Doe",
      "primary_email": "john@affinity.co",
      "emails": []
    },
    "removed_company": {
      "id": 64779194,
      "name": "Affinity",
      "domain": "affinity.co",
      "domains": ["affinity.co"],
      "crunchbase_uuid": null,
      "global": true
    },
    "company": {
      "id": 64779195,
      "name": "Affinity 2",
      "domain": "affinity.co",
      "domains": ["affinity.co"],
      "crunchbase_uuid": null,
      "global": false
    },
    "merged_at": "2021-11-15 13:45:16 -0800"
  },
  "sent_at": 1637012717
}
```

### Person

Please note that `organization_ids` is not returned when a `Person` is deleted.

```json theme={null}
{
  "type": "person.created",
  "body": {
    "id": 38706,
    "type": 0,
    "first_name": "John",
    "last_name": "Doe",
    "primary_email": "john@affinity.co",
    "emails": [],
    "organization_ids": []
  },
  "sent_at": 1636645209
}
```

### Opportunity

Please note that `organization_ids` and `person_ids` are not returned when an `Opportunity` is deleted.

```json theme={null}
{
  "type": "opportunity.created",
  "body": {
    "id": 7460748,
    "name": "Amazon - Project A",
    "person_ids": [],
    "organization_ids": []
  },
  "sent_at": 1636645558
}
```

### List

```json theme={null}
{
  "type": "list.created",
  "body": {
    "id": 450,
    "ip_address": "208.253.143.17"
  },
  "sent_at": 1636642627
}
```

### List Entry

```json theme={null}
{
  "type": "list_entry.created",
  "body": {
    "id": 16367,
    "list_id": 450,
    "creator_id": 38706,
    "entity_id": 287125,
    "entity_type": 1,
    "created_at": "2021-11-11 06:58:31 -0800",
    "entity": {
      "id": 84547971,
      "type": 1,
      "first_name": "John",
      "last_name": "Doe",
      "primary_email": "jdoe@jdoe.com",
      "emails": ["jdoe@jdoe.com", "jdoe2@jdoe2.com"]
    }
  },
  "sent_at": 1636642712
}
```

### Field

```json theme={null}
{
  "type": "field.created",
  "body": {
    "id": 59,
    "name": "Deals Amount",
    "list_id": 11,
    "value_type": 3,
    "allows_multiple": false,
    "track_changes": false,
    "dropdown_options": [],
    "ip_address": "206.253.143.17"
  },
  "sent_at": 1636644238
}
```

### Field Value

<Note>
  A single change may arrive as a `field_value.deleted` followed by a `field_value.created` rather than a `field_value.updated`. Don't rely on `field_value.updated` alone to catch every change — subscribe to all three event types.
</Note>

```json theme={null}
{
  "type": "field_value.created",
  "body": {
    "id": 250616,
    "field_id": 337,
    "list_entry_id": null,
    "entity_type": 38706,
    "value_type": 0,
    "entity_id": 91407761,
    "value": {
      "city": "San Francisco",
      "state": "California",
      "country": "United States",
      "continent": null,
      "street_address": null
    },
    "field": {
      "id": 318500,
      "name": "Location",
      "list_id": null,
      "value_type": 5,
      "allows_multiple": false,
      "track_changes": false,
      "dropdown_options": []
    }
  },
  "sent_at": 1636635565
}
```

### Notes

```json theme={null}
{
  "type": "note.created",
  "body": {
    "id": 22984,
    "creator_id": 860197,
    "person_ids": [38706, 89734],
    "is_meeting": false,
    "organization_ids": [],
    "opportunity_ids": [],
    "parent_id": null,
    "content": "Had a lunch meeting with Jane and John today.",
    "created_at": "2021-11-11 07:21:10 -0800",
    "ip_address": "206.253.143.17"
  },
  "sent_at": 1636644072
}
```

### File

```json theme={null}
{
  "type": "file.created",
  "body": {
    "id": 43212,
    "name": "JohnDoeFriends.csv",
    "size": 993,
    "person_id": 10,
    "organization_id": null,
    "opportunity_id": null,
    "created_at": "2021-11-11 07:54:36 -0800",
    "uploader_id": 64056952
  },
  "sent_at": 1636646078
}
```


## Related topics

- [Crunchbase data in Affinity](/s/article/Crunchbase-data-in-Affinity.md)
- [Affinity Data](/s/article/Affinity-Data.md)
- [What Are The Different Seat Types Available In Affinity](/s/article/What-are-the-different-seat-types-available-in-Affinity.md)
- [Getting Started With The Affinity API + FAQs](/s/article/Getting-started-with-the-Affinity-API-faqs.md)
- [What Data Is Accessible Via The Affinity API](/s/article/What-data-is-accessible-via-the-Affinity-API.md)
