Skip to main content
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 wordlist = await client.wordlist.retrieve('id');

console.log(wordlist.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
)
wordlist = client.wordlist.retrieve(
    "id",
)
print(wordlist.id)
require "moderation_api"

moderation_api = ModerationAPI::Client.new(secret_key: "My Secret Key")

wordlist = moderation_api.wordlist.retrieve("id")

puts(wordlist)
<?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 {
  $wordlist = $client->wordlist->retrieve('id');

  var_dump($wordlist);
} catch (APIException $e) {
  echo $e->getMessage();
}
using System;
using ModerationApi;
using ModerationApi.Models.Wordlist;

ModerationApiClient client = new();

WordlistRetrieveParams parameters = new() { ID = "id" };

var wordlist = await client.Wordlist.Retrieve(parameters);

Console.WriteLine(wordlist);
{
  "id": "<string>",
  "name": "<string>",
  "words": [
    "<string>"
  ],
  "createdAt": "<string>",
  "organizationId": "<string>",
  "userId": "<string>",
  "strict": true
}
{
  "code": "BAD_REQUEST",
  "message": "Invalid input data",
  "issues": []
}
{
  "code": "UNAUTHORIZED",
  "message": "Authorization not provided",
  "issues": []
}
{
  "code": "FORBIDDEN",
  "message": "Insufficient access",
  "issues": []
}
{
  "code": "NOT_FOUND",
  "message": "Not found",
  "issues": []
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "issues": []
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

ID of the wordlist to get

Response

Successful response

id
string
required

ID of the wordlist

name
string | null
required

Name of the wordlist

words
string[]
required

Words in the wordlist

createdAt
string
required

Creation date of the wordlist

organizationId
string
required

ID of the organization

userId
string | null
required

ID of the user

strict
boolean
required

Strict mode