Delete an entire translation group and all its translations
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
await novu.translations.groups.delete("workflow", "welcome-email");
}
run();The standalone function version of this method:
import { NovuCore } from "@novu/api/core.js";
import { translationsGroupsDelete } from "@novu/api/funcs/translationsGroupsDelete.js";
// Use `NovuCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const novu = new NovuCore({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const res = await translationsGroupsDelete(novu, "workflow", "welcome-email");
if (res.ok) {
const { value: result } = res;
} else {
console.log("translationsGroupsDelete failed:", res.error);
}
}
run();| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
resourceType |
operations.TranslationControllerDeleteTranslationGroupEndpointPathParamResourceType | ✔️ | Resource type | workflow |
resourceId |
string | ✔️ | Resource ID | welcome-email |
idempotencyKey |
string | ➖ | A header for idempotency purposes | |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<void>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |
Retrieves a single translation group by resource type (workflow, layout) and resource ID (workflowId, layoutId)
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.translations.groups.retrieve("workflow", "welcome-email");
console.log(result);
}
run();The standalone function version of this method:
import { NovuCore } from "@novu/api/core.js";
import { translationsGroupsRetrieve } from "@novu/api/funcs/translationsGroupsRetrieve.js";
// Use `NovuCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const novu = new NovuCore({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const res = await translationsGroupsRetrieve(novu, "workflow", "welcome-email");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("translationsGroupsRetrieve failed:", res.error);
}
}
run();| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
resourceType |
operations.TranslationControllerGetTranslationGroupEndpointPathParamResourceType | ✔️ | Resource type | workflow |
resourceId |
string | ✔️ | Resource ID | welcome-email |
idempotencyKey |
string | ➖ | A header for idempotency purposes | |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.TranslationGroupDto>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4XX, 5XX | */* |