Activity
Track activity and engagement events
Track activity and engagement events for a specific delivery provider
POST
/
v2
/
inbound-webhooks
/
delivery-providers
/
{environmentId}
/
{integrationId}
TypeScript
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.activity.track({
environmentId: "<id>",
integrationId: "<id>",
requestBody: {
},
});
console.log(result);
}
run();using Novu;
using Novu.Models.Components;
using System.Collections.Generic;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
var res = await sdk.Activity.TrackAsync(
environmentId: "<id>",
integrationId: "<id>",
requestBody: new Dictionary<string, object>() {
}
);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use novu;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$response = $sdk->activity->track(
environmentId: '<id>',
integrationId: '<id>',
requestBody: [
]
);
if ($response->webhookResultDtos !== null) {
// handle response
}from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.activity.track(environment_id="<id>", integration_id="<id>", request_body={
})
# Handle response
print(res)package main
import(
"context"
"github.com/novuhq/novu-go/v3"
"log"
)
func main() {
ctx := context.Background()
s := v3.New(
v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
)
res, err := s.Activity.Track(ctx, "<id>", "<id>", map[string]any{
}, nil)
if err != nil {
log.Fatal(err)
}
if res.WebhookResultDtos != nil {
// handle response
}
}curl --request POST \
--url https://api.novu.co/v2/inbound-webhooks/delivery-providers/{environmentId}/{integrationId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.novu.co/v2/inbound-webhooks/delivery-providers/{environmentId}/{integrationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.novu.co/v2/inbound-webhooks/delivery-providers/{environmentId}/{integrationId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novu.co/v2/inbound-webhooks/delivery-providers/{environmentId}/{integrationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"event": {
"date": "<string>",
"externalId": "<string>",
"attempts": 123,
"response": "<string>",
"row": "<string>"
}
}
]Authorizations
API key authentication. Allowed headers-- "Authorization: ApiKey <novu_secret_key>".
Headers
A header for idempotency purposes
Path Parameters
The environment identifier
The integration identifier for the delivery provider
Body
application/json
Webhook event payload from the delivery provider
Generic webhook payload from delivery providers
Was this page helpful?
⌘I
TypeScript
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.activity.track({
environmentId: "<id>",
integrationId: "<id>",
requestBody: {
},
});
console.log(result);
}
run();using Novu;
using Novu.Models.Components;
using System.Collections.Generic;
var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");
var res = await sdk.Activity.TrackAsync(
environmentId: "<id>",
integrationId: "<id>",
requestBody: new Dictionary<string, object>() {
}
);
// handle responsedeclare(strict_types=1);
require 'vendor/autoload.php';
use novu;
$sdk = novu\Novu::builder()
->setSecurity(
'YOUR_SECRET_KEY_HERE'
)
->build();
$response = $sdk->activity->track(
environmentId: '<id>',
integrationId: '<id>',
requestBody: [
]
);
if ($response->webhookResultDtos !== null) {
// handle response
}from novu_py import Novu
with Novu(
secret_key="YOUR_SECRET_KEY_HERE",
) as novu:
res = novu.activity.track(environment_id="<id>", integration_id="<id>", request_body={
})
# Handle response
print(res)package main
import(
"context"
"github.com/novuhq/novu-go/v3"
"log"
)
func main() {
ctx := context.Background()
s := v3.New(
v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
)
res, err := s.Activity.Track(ctx, "<id>", "<id>", map[string]any{
}, nil)
if err != nil {
log.Fatal(err)
}
if res.WebhookResultDtos != nil {
// handle response
}
}curl --request POST \
--url https://api.novu.co/v2/inbound-webhooks/delivery-providers/{environmentId}/{integrationId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.novu.co/v2/inbound-webhooks/delivery-providers/{environmentId}/{integrationId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.novu.co/v2/inbound-webhooks/delivery-providers/{environmentId}/{integrationId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novu.co/v2/inbound-webhooks/delivery-providers/{environmentId}/{integrationId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"event": {
"date": "<string>",
"externalId": "<string>",
"attempts": 123,
"response": "<string>",
"row": "<string>"
}
}
]