triggerWebhook()

Signature
client.triggerWebhook(
  id: string,
  body?: unknown,
  opts?: {
    token?:     string
    signature?: string
    headers?:   Record<string, string>
  }
): Promise<WebhookTriggerResponse>

Parameters#

ParamTypeDescription
idstringUUID of the job
bodyunknownRequest body (JSON-serialised and forwarded as-is)
opts.tokenstringPer-job webhook token set when the job was created
opts.signaturestringHMAC-SHA256 signature (sha256=<hex>). See computeHmacSignature()
opts.headersRecord<string, string>Additional HTTP headers to include in the request

Usage#

ts
import { VeloraClient } from '@rimora/velora'
import fetch from 'node-fetch'

const client = new VeloraClient({
  apiKey: process.env.VELORA_API_KEY,
  fetch: fetch as any
})

// Fire with a per-job token for simple auth
const result = await client.triggerWebhook(
  '9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c',
  { event: 'user.signup', userId: 'u_123' },
  { token: process.env.JOB_WEBHOOK_TOKEN }
)

console.log(result.msg)

Response#

WebhookTriggerResponse
{
  "id": "9f4a1c2b-3d4e-5f6a-7b8c-9d0e1f2a3b4c",
  "msg": "Webhook triggered"
}
This endpoint does not require your Velora API key to be passed in the Authorization header. All authentication is handled by opts.token or opts.signature. This makes it safe to call from browser-side code using only a public webhook token.

Required scope#

None — this is a public endpoint. Authenticity is verified via the token or HMAC signature.

Common errors#

StatuserrorCause
401invalid_tokenToken is missing or does not match the job
401invalid_signatureHMAC signature verification failed
404not_foundJob does not exist

© 2026 Velora · API Documentation