Skip to main content
POST
/
hooks
/
subscribe
JavaScript
import DroidrunCloud from 'droidrun-cloud';

const client = new DroidrunCloud({
  apiKey: 'My API Key',
});

const response = await client.hooks.subscribe({ targetUrl: 'https://example.com' });

console.log(response.id);
{
  "events": [
    "<string>"
  ],
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "service": "<string>",
  "subscribed": true,
  "url": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer token via Authorization header

Body

application/json

Request model for subscribing to webhooks.

targetUrl
string<uri>
required

The webhook URL to send notifications to

Required string length: 1 - 2083
events
string[] | null

List of task events to subscribe to (created, running, completed, failed, cancelled, paused)

service
string | null

Service that receives the webhook

Response

Successful Response

Response model after successful subscription.

id
string<uuid>
required

The subscription ID

subscribed
boolean
required

Whether subscription was successful

url
string
required

The webhook URL

events
string[] | null

List of subscribed events

service
string | null

Service that receives the webhook