Docs
Node SDK

webhooks.get

Read a webhook in the authenticated project environment.

Import and client

TypeScript
import { RelayServer } from '@relayrtc/node'
 
const relay = new RelayServer({
  apiUrl: process.env.RELAYRTC_API_URL!,
  apiKey: process.env.RELAYRTC_SECRET_KEY!,
})

Requirements

A secret key with webhooks:read. The requested resource must belong to that key's project environment.

Parameters

OptionTypeDefault / requirementPurpose
endpointIdstringRequiredID returned when creating the webhook.
projectIdstringKey projectMust match the key's project.
environmentIdstringKey environmentMust match the key's environment.

Every method accepts RequestOptions as its final argument. Optional scope parameters go before RequestOptions. They cannot expand the key’s project or environment.

Example

TypeScript
const endpointId = 'webhook_example'
const result = await relay.webhooks.get(endpointId)

Returns

Promise<WebhookEndpoint>. Returns a webhook endpoint, without its secret.

REST equivalent

GET /v1/webhooks/{endpointId}. Failures throw RelayApiError.