Skip to main content
POST
/
v1
/
webhooks
Subscribe to webhook events
const url = 'https://api.runmorph.dev/v1/webhooks';
const options = {
  method: 'POST',
  headers: {
    'x-api-key': '<api-key>',
    'x-api-secret': '<api-key>',
    'x-connector-id': '<api-key>',
    'x-owner-id': '<api-key>',
    'x-session-token': '<api-key>',
    'Content-Type': 'application/json'
  },
  body: '{"events":["genericCompany::created"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
[
  {
    "object": "webhook",
    "model": "<string>",
    "trigger": "<string>",
    "createdAt": "<string>",
    "updatedAt": "<string>"
  }
]

Connectors Setup

Some connectors require a specific setup to support webhook subscription.
HubSpot requires two global webhooks to be configured at the HubSpot App level in your HubSpot developer portal.

Main Webhook Setup

  1. Navigate to Developer Hub > Your App
  2. Go to the “Webhooks” section
  3. Add the following webhook URL:
https://api.runmorph.dev/v1/hook/{orgId}/prod/hubspot/global/main

Card View Webhook Setup

If you plan to use the WidgetCardView model, you’ll need to configure an additional global webhook:
  1. Navigate to the “CRM Card” section
  2. Click “Create a new card”
  3. In the “Data fetch URL” field, enter:
https://api.runmorph.dev/v1/hook/{orgId}/prod/hubspot/global/cardView
Replace {orgId} with your actual organization ID in both webhook URLs.

Authorizations

x-api-key
string
header
required
x-api-secret
string
header
required
x-connector-id
string
header
required
x-owner-id
string
header
required
x-session-token
string
header
required

Body

events
enum<string>[]
required
Minimum length: 1

Response

Created

object
enum<string>
required
Available options:
webhook
model
string
required
trigger
string
required
createdAt
string
required
updatedAt
string
required