Skip to main content
PATCH
/
webhook_endpoints
/
{id}
JavaScript
import Moonbase from '@moonbaseai/sdk';

const client = new Moonbase({
  apiKey: process.env['MOONBASE_API_KEY'], // This is the default and can be omitted
});

const endpoint = await client.webhookEndpoints.update('id', {
  status: 'disabled',
  url: 'https://updated.example.com',
});

console.log(endpoint.id);
{
  "id": "1CLJt2v17V1yuCdrUwA4PW",
  "type": "webhook_endpoint",
  "url": "https://updated.example.com",
  "status": "disabled",
  "subscriptions": [
    {
      "type": "webhook_subscription",
      "event_type": "activity/item_created"
    }
  ],
  "created_at": "2025-02-17T16:00:00.000Z",
  "updated_at": "2025-02-17T16:00:00.000Z"
}

Authorizations

Authorization
string
header
required

Your Moonbase API key.

Path Parameters

id
string
required

The ID of the Webhook Endpoint to update.

Body

application/json

The WebhookEndpoint values to update.

Parameters for updating a webhook endpoint.

url
string

The HTTPS URL where webhook events will be sent.

status
enum<string>

Indicates whether the endpoint is enabled.

Available options:
disabled,
enabled
subscriptions
WebhookSubscriptionUpdateParams · object[]

An array of event types that this endpoint should receive notifications for.

Response

Update succeeded.

A Webhook Endpoint is an HTTP endpoint that receives webhooks. You can configure which events are sent to each endpoint by creating WebhookSubscription objects.

type
string
required

String representing the object’s type. Always webhook_endpoint for this object.

Allowed value: "webhook_endpoint"
id
string
required

Unique identifier for the object.

url
string
required

The HTTPS URL where webhook events will be sent.

status
enum<string>
required

Indicates whether the endpoint is enabled.

Available options:
disabled,
enabled
subscriptions
WebhookSubscription · object[]
required

An array of WebhookSubscription objects representing the events this endpoint will receive.

created_at
string<date-time>
required

Time at which the object was created, as an ISO 8601 timestamp in UTC.

updated_at
string<date-time>
required

Time at which the object was last updated, as an ISO 8601 timestamp in UTC.

secret
string

The signing secret used to verify webhook authenticity. This value is only shown when creating the endpoint and starts with whsec_.