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

# Webhook Events

### Event Headers

<ParamField header="x-conector-id" type="string" required>
  The unique identifier of the connector
</ParamField>

<ParamField header="x-owner-id" type="string" required>
  The unique identifier of the owner
</ParamField>

<ParamField header="x-idempotency-key" type="string" required>
  A unique key to ensure idempotency of the webhook request
</ParamField>

### Event Body

<ResponseField name="event" type="enum<string>" required>
  The event type : `widgetCardView::created`, `widgetCardView::updated` or
  `widgetCardView::deleted`
</ResponseField>

<ResponseField name="data" type="Card Resource" required>
  <Expandable title="properties">
    <ResponseField name="object" type="enum<string>" default="resource" required>
      Available options: resource
    </ResponseField>

    <ResponseField name="model" type="enum<string>" default="widgetCardView" required>
      The model identifier
    </ResponseField>

    <ResponseField name="id" type="string" required>
      The unique identifier
    </ResponseField>

    <ResponseField name="fields" type="object" required>
      <Expandable title="properties">
        <ResponseField name="triggeredBy" type="string">
          User that opened the widget
        </ResponseField>

        <ResponseField name="genericContact" type="string">
          Contact on which the widget is opened
        </ResponseField>

        <ResponseField name="genericCompany" type="string">
          Company on which the widget is opened
        </ResponseField>

        <ResponseField name="crmOpportunity" type="string">
          Opportunity on which the widget is opened
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="createdAt" type="string" required>
      The creation timestamp
    </ResponseField>

    <ResponseField name="updatedAt" type="string" required>
      The last update timestamp
    </ResponseField>

    <ResponseField name="rawResource" type="any | null">
      The raw resource data
    </ResponseField>

    <ResponseField name="warnings" type="object[]">
      <Expandable title="properties">
        <ResponseField name="code" type="string" required>
          The warning code
        </ResponseField>

        <ResponseField name="message" type="string">
          The warning message
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

### Expected Response

<Warning>This webhook expects a synchronous response with a JSON body as defined below</Warning>

<ResponseField name="cards" type="card[]" required>
  Array of cards to display in the widget

  <Expandable title="items">
    <ResponseField name="title" type="string" required>
      Title of the card
    </ResponseField>

    <ResponseField name="contents" type="content[]" required>
      Array of content items to display in the card

      <Expandable title="items">
        <ResponseField name="text" type="object">
          <Expandable title="properties">
            <ResponseField name="type" type="'text'" required>Type of the content</ResponseField>

            <ResponseField name="label" type="string" required>
              Label for the text content
            </ResponseField>

            <ResponseField name="value" type="string" required>
              Text value to display
            </ResponseField>

            <ResponseField name="link" type="string" />
          </Expandable>
        </ResponseField>

        <ResponseField name="status" type="object">
          <Expandable title="properties">
            <ResponseField name="type" type="'status'" required>Type of the content</ResponseField>

            <ResponseField name="label" type="string" required>
              Label for the status content
            </ResponseField>

            <ResponseField name="value" type="string" required>
              Status text to display
            </ResponseField>

            <ResponseField name="status" type="enum<default|success|warning|danger|info>" required>
              Visual style of the status. Available options: default, success, warning, danger, info
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="actions" type="action[]">
      <Expandable title="items">
        <ResponseField name="type" type="enum<openUrl|openUrlInIframe>" required>
          Type of action. Available options: openUrl, openUrlInIframe
        </ResponseField>

        <ResponseField name="label" type="string" required>
          Label for the action button
        </ResponseField>

        <ResponseField name="url" type="string" required>
          URL to open when clicked
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="link" type="string" />
  </Expandable>
</ResponseField>

<ResponseField name="root" type="object">
  <Expandable title="properties">
    <ResponseField name="actions" type="action[]" required>
      Array of actions available at the root level

      <Expandable title="items">
        <ResponseField name="type" type="enum<openUrl|openUrlInIframe>" required>
          Type of root action. Available options: openUrl, openUrlInIframe
        </ResponseField>

        <ResponseField name="label" type="string" required>
          Label for the root action button
        </ResponseField>

        <ResponseField name="url" type="string" required>
          URL to open when clicked
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```json Webhook Event theme={null}
  {
    "event": "widgetCardView::created",
    "data": {
      "object": "resource",
      "model": "widgetCardView",
      "id": "<string>",
      "fields": {
        "triggeredBy": {
          "object": "resourceRef",
          "model": "<string>",
          "id": "<string>"
        },
        "genericContact": {
          "object": "resourceRef",
          "model": "<string>",
          "id": "<string>"
        },
        "genericCompany": {
          "object": "resourceRef",
          "model": "<string>",
          "id": "<string>"
        },
        "crmOpportunity": {
          "object": "resourceRef",
          "model": "<string>",
          "id": "<string>"
        }
      },
      "createdAt": "2025-03-06T09:05:04.611Z",
      "updatedAt": "2025-03-06T09:15:04.611Z",
      "rawResource": null,
      "warnings": []
    }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Expected Response  theme={null}
  {
    "cards": [
      {
        "title": "<string>",
        "contents": [
          {
            "type": "text",
            "label": "<string>",
            "value": "<string>",
            "link": "<string>"
          },
          {
            "type": "status",
            "label": "<string>",
            "value": "<string>",
            "status": "<enum: default | success | warning | danger | info>"
          }
        ],
        "actions": [
          {
            "type": "<enum: openUrl | openUrlInIframe>",
            "label": "<string>",
            "url": "<string>"
          }
        ],
        "link": "<string>"
      }
    ],
    "root": {
      "actions": [
        {
          "type": "<enum: openUrl | openUrlInIframe>",
          "label": "<string>",
          "url": "<string>"
        }
      ]
    }
  }
  ```
</ResponseExample>
