Dashboard API Reference

The Moderation API is the interface you will use to send user generated data to the Dashboard. It will then return a response with the rules that were auto-triggered along with additional data depending on your needs.

Authentication

Each Dashboard application has a unique API key that will need to be included in the API request. The API key will be sent via email after getting access to the Dashboard.

  • Include the API Key in the header of your POST request ('authorization: token <YOUR_API_KEY>')

Submitting a Task to the Dashboard via API

The Dashboard supports both synchronous (sync) and asynchronous (async) API interface protocols.
Our technical team is happy to help you determine the submission process that best fits your use case.

As a general guideline:

Sync API

Async API

A synchronous endpoint is preferred for users who have real-time needs, low latency requirements, and are submitting continuous / cyclical requests.

The synchronous endpoint keeps the HTTP request open until results have finished processing and then sends the results directly in the response message.

The asynchronous endpoint is preferred for users who are submitting their volume in large batches users submitting tasks containing large files (i.e. longer videos or audio clips).

The asynchronous endpoint immediately sends a response acknowledging receipt of the task, along with a unique ‘task_id’. It then closes the connection. Once the task is completed, Hive will send a POST request to the provided callback_url containing the completed task’s results.

Sync Request:
POST: https://api.hivemoderation.com/api/arbiter/task/sync/v1

Form Data (all required):

  • text_data (string): Use text_data to submit raw text
  • patron_id (string): Use patron_id to send the ID of the user that published the content
  • post_id (string): Use post_id to send the ID tied to the post that was published
curl --location --request POST 'https://api.hivemoderation.com/api/arbiter/task/sync/v1' \
--header 'accept: application/json' \
--header 'authorization: token 61HwvNnf9DTeJf8pmXO86limo2doMQgO' \
--form 'text_data="\"546-855-5512 This is my number you ass\""' \
--form 'patron_id="5128"' \
--form 'post_id="45465165"'

Async Request:
POST: https://api.hivemoderation.com/api/arbiter/task/async/v1

Form Data (all required):

  • text_data (string): Use text_data to submit raw text
  • patron_id (string): Use patron_id to send the ID of the user that published the content
  • post_id (string): Use post_id to send the ID tied to the post that was published
  • callback_url (string): callback url where the Dashboard will post task response to
curl --location --request POST 'https://api.thehive.ai/api/arbiter/task/async' \
--header 'accept: application/json' \
--header 'authorization: token 61HwvNnf9DTeJf8pmXO86limo2doMQgO' \
--form 'text_data="\"546-855-5512 This is my number you ass\""' \
--form 'patron_id="5128"' \
--form 'post_id="45465165"' \
--form 'callback_url="https://webhook.site/b96c3c11-ddf6-442c-89eb-ff209705b1db"'

Responses

Dashboard API Sample Response:

{
    "patron_id": "1111-122-331",
    "post_id": "23145",
    "task_id": "538e5b30-4d7a-11ec-a5d3-5de59255ac47",
    "rules_triggered": [
        {
            "rule_id": "5phrGLaFGCoURyvTn9AryD",
            "rule_name": "Post has text in Deny List"
        }
    ]
}

Dashboard API Legacy Response: The dashboard supports a legacy version of the API response that includes additional data returned from the model in the response (model scores, profanity, pii entities). You can choose to receive this response by including "?legacy=1 " parameter at the end of the POST URL.

POST: https://api.hivemoderation.com/api/arbiter/task/sync/v1?legacy=1

Example Response:

Inset JSON here

Error Codes