import { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
await novu.events.cancel("transactionId");
use Novu\SDK\Novu;
$novu = new Novu(<NOVU_API_KEY>);
$transactionId = "transactionId";
$novu->cancelEvent($transactionId);
require 'novu'
client = Novu::Client.new('<NOVU_API_KEY>')
client.cancel_triggered_event('transactionId')
package main
import (
"context"
"fmt"
novu "github.com/novuhq/go-novu/lib"
"log"
)
func main() {
apiKey := "<NOVU_API_KEY>"
ctx := context.Background()
novuClient := novu.NewAPIClient(apiKey, &novu.Config{})
transactionId := "<transaction_id>";
resp, err := novuClient.EventApi.CancelTrigger(ctx, transactionId)
if err != nil {
log.Fatal("novu error", err.Error())
return
}
}
curl --request DELETE \
--url https://api.novu.co/v1/events/trigger/<transaction_id> \
--header 'Authorization: ApiKey <NOVU_API_KEY>'
from novu.api import EventApi
url = "https://api.novu.co"
api_key = "<NOVU_API_KEY>"
novu = EventApi(url, api_key).delete("transactionId");
import co.novu.common.base.Novu;
import co.novu.api.events.responses.CancelEventResponse;
public class Main {
public static void main(String[] args) {
String apiKey = "<NOVU_API_KEY>";
Novu novu = new Novu(apiKey);
String transactionId = "<REPLACE_WITH_TRANSACTION_ID>";
CancelEventResponse response = novu.cancelTriggeredEvent(transactionId);
}
}
using Novu.DTO;
using Novu.Models;
using Novu;
var novuConfiguration = new NovuClientConfiguration
{
/**
* Defaults to https://api.novu.co/v1
*/
Url = "https://novu-api.my-domain.com/v1",
ApiKey = "12345",
};
var novu = new NovuClient(novuConfiguration);
var cancelled = await novu.Event.TriggerCancelAsync("triggerTransactionId");
{
data: true
}
Events
Cancel triggered event
Using a previously generated transactionId during the event trigger, will cancel any active or pending workflows. This is useful to cancel active digests, delays etc…
DELETE
/
v1
/
events
/
trigger
/
{transactionId}
import { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
await novu.events.cancel("transactionId");
use Novu\SDK\Novu;
$novu = new Novu(<NOVU_API_KEY>);
$transactionId = "transactionId";
$novu->cancelEvent($transactionId);
require 'novu'
client = Novu::Client.new('<NOVU_API_KEY>')
client.cancel_triggered_event('transactionId')
package main
import (
"context"
"fmt"
novu "github.com/novuhq/go-novu/lib"
"log"
)
func main() {
apiKey := "<NOVU_API_KEY>"
ctx := context.Background()
novuClient := novu.NewAPIClient(apiKey, &novu.Config{})
transactionId := "<transaction_id>";
resp, err := novuClient.EventApi.CancelTrigger(ctx, transactionId)
if err != nil {
log.Fatal("novu error", err.Error())
return
}
}
curl --request DELETE \
--url https://api.novu.co/v1/events/trigger/<transaction_id> \
--header 'Authorization: ApiKey <NOVU_API_KEY>'
from novu.api import EventApi
url = "https://api.novu.co"
api_key = "<NOVU_API_KEY>"
novu = EventApi(url, api_key).delete("transactionId");
import co.novu.common.base.Novu;
import co.novu.api.events.responses.CancelEventResponse;
public class Main {
public static void main(String[] args) {
String apiKey = "<NOVU_API_KEY>";
Novu novu = new Novu(apiKey);
String transactionId = "<REPLACE_WITH_TRANSACTION_ID>";
CancelEventResponse response = novu.cancelTriggeredEvent(transactionId);
}
}
using Novu.DTO;
using Novu.Models;
using Novu;
var novuConfiguration = new NovuClientConfiguration
{
/**
* Defaults to https://api.novu.co/v1
*/
Url = "https://novu-api.my-domain.com/v1",
ApiKey = "12345",
};
var novu = new NovuClient(novuConfiguration);
var cancelled = await novu.Event.TriggerCancelAsync("triggerTransactionId");
{
data: true
}
Enter your API key in the
Authorization field like the example shown below:E.g ApiKey 18d2e625f05d80e If
false value is returned in response, it means that event has already been completed its execution or cancelled before. Already completed event can not be cancelled. If true value is returned in response, then it means that event execution has been cancelled successfully. Any digest or delay step with pending exection will also be cancelled.import { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
await novu.events.cancel("transactionId");
use Novu\SDK\Novu;
$novu = new Novu(<NOVU_API_KEY>);
$transactionId = "transactionId";
$novu->cancelEvent($transactionId);
require 'novu'
client = Novu::Client.new('<NOVU_API_KEY>')
client.cancel_triggered_event('transactionId')
package main
import (
"context"
"fmt"
novu "github.com/novuhq/go-novu/lib"
"log"
)
func main() {
apiKey := "<NOVU_API_KEY>"
ctx := context.Background()
novuClient := novu.NewAPIClient(apiKey, &novu.Config{})
transactionId := "<transaction_id>";
resp, err := novuClient.EventApi.CancelTrigger(ctx, transactionId)
if err != nil {
log.Fatal("novu error", err.Error())
return
}
}
curl --request DELETE \
--url https://api.novu.co/v1/events/trigger/<transaction_id> \
--header 'Authorization: ApiKey <NOVU_API_KEY>'
from novu.api import EventApi
url = "https://api.novu.co"
api_key = "<NOVU_API_KEY>"
novu = EventApi(url, api_key).delete("transactionId");
import co.novu.common.base.Novu;
import co.novu.api.events.responses.CancelEventResponse;
public class Main {
public static void main(String[] args) {
String apiKey = "<NOVU_API_KEY>";
Novu novu = new Novu(apiKey);
String transactionId = "<REPLACE_WITH_TRANSACTION_ID>";
CancelEventResponse response = novu.cancelTriggeredEvent(transactionId);
}
}
using Novu.DTO;
using Novu.Models;
using Novu;
var novuConfiguration = new NovuClientConfiguration
{
/**
* Defaults to https://api.novu.co/v1
*/
Url = "https://novu-api.my-domain.com/v1",
ApiKey = "12345",
};
var novu = new NovuClient(novuConfiguration);
var cancelled = await novu.Event.TriggerCancelAsync("triggerTransactionId");
{
data: true
}
Was this page helpful?
⌘I