JavaScript
import ModerationAPI from '@moderation-api/sdk';
const client = new ModerationAPI({
secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted
});
const action = await client.actions.delete('id');
console.log(action.id);import os
from moderation_api import ModerationAPI
client = ModerationAPI(
secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted
)
action = client.actions.delete(
"id",
)
print(action.id)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
action = moderation_api.actions.delete("id")
puts(action)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ModerationAPI\Client;
use ModerationAPI\Core\Exceptions\APIException;
$client = new Client(secretKey: getenv('MODAPI_SECRET_KEY') ?: 'My Secret Key');
try {
$action = $client->actions->delete('id');
var_dump($action);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Actions;
ModerationApiClient client = new();
ActionDeleteParams parameters = new() { ID = "id" };
var action = await client.Actions.Delete(parameters);
Console.WriteLine(action);{
"deleted": true,
"id": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}Delete an action
Delete an action and all of its webhooks.
JavaScript
import ModerationAPI from '@moderation-api/sdk';
const client = new ModerationAPI({
secretKey: process.env['MODAPI_SECRET_KEY'], // This is the default and can be omitted
});
const action = await client.actions.delete('id');
console.log(action.id);import os
from moderation_api import ModerationAPI
client = ModerationAPI(
secret_key=os.environ.get("MODAPI_SECRET_KEY"), # This is the default and can be omitted
)
action = client.actions.delete(
"id",
)
print(action.id)require "moderation_api"
moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")
action = moderation_api.actions.delete("id")
puts(action)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use ModerationAPI\Client;
use ModerationAPI\Core\Exceptions\APIException;
$client = new Client(secretKey: getenv('MODAPI_SECRET_KEY') ?: 'My Secret Key');
try {
$action = $client->actions->delete('id');
var_dump($action);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using ModerationApi;
using ModerationApi.Models.Actions;
ModerationApiClient client = new();
ActionDeleteParams parameters = new() { ID = "id" };
var action = await client.Actions.Delete(parameters);
Console.WriteLine(action);{
"deleted": true,
"id": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the action to delete.
Was this page helpful?
⌘I