Submit to CSAM Detection API

Thorn Overview

Hive's partnership with Thorn allows Hive customers to easily integrate Thorn's API to match against other known CSAM (Child Sexual Abuse Material) or SE (Sexual Exploitation) examples in Thorn's database along with our proprietary CSAM detection API, which uses embeddings to detect novel child sexual abuse material (CSAM) content.

The Combined CSAM Detection API, which runs two models, Hash Matching and Classifier, is available to use on Moderation Dashboard. Please reach out to sales at [email protected] to get access to this API and have it mapped to your Moderation Dashboard.


Submit to Thorn

Sync Request

https://api.hivemoderation.com/api/v2/task/sync

Async Request

https://api.hivemoderation.com/api/v2/task/async

Sync Request (v1 - Maintenance Mode)

https://api.hivemoderation.com/api/v1/task/sync

Async Request (v1 - Maintenance Mode)

https://api.hivemoderation.com/api/v1/task/async

The process of integrating Thorn with Moderation Dashboard is different than integrating with other models. This is because we want to make sure to check for the presence of CSAM before allowing other models to run with potential CSAM content as the input, preventing the content from being saved elsewhere.

Field (*required)TypeDescription
thorn_enabledBooleanBoolean to send content to Thorn models.
modelsarrayNote: If thorn_enabled is true, models is optional, as in some cases, you might only want to submit content to verify the existence of CSAM content.

Instead of including an additional model in the models parameter, you include a boolean flag thorn_enabled that will dictate whether the content is ran through the Thorn models (additional models are optional).

CSAM Detected

If CSAM is detected, you will see the following key in your results:

csam_results: [] 

This can contain either: thorn_classification (our classifier results detected the potential for CSAM), thorn_hash_matching (a direct hash match to Thorn’s database was detected), or both. As stated in the v2 API documentation, you can include a legacy=1 flag with your API request to include all Hive model results in your response.


Additional Models

If CSAM has been detected, additional models will not be run. You will see the status skipped_due_to_thorn in these models' project_status_map. This also means all rules and actions will fail to be checked and trigger as well. In short, it short circuits the moderation flow.


CSAM Not Detected

If CSAM was not detected, then moderation continues. If other models were included, these models will run as normal, along with thresholds, rules, and actions.


Example Responses (Thorn Sync Responses)

Sync Response (CSAM Detected)

{
    "csam_results": ["thorn_classification"],
    "task_ids": [
        "547cf2d1-2c61-11f0-9668-7f39add00f22",
        "547cf2d1-2c61-11f0-bc2b-f9bfed1d4eae"
    ],
    "post_id": "hive-test-apr-8-4",
    "user_id": "hive-test-may-8-4",
    "project_status_map": {
        "32952": {
            "moderation_type": "visual",
            "status": "skipped_due_to_thorn"
        },
        "103334095": {
            "moderation_type": "thorn_matching",
            "task_id": "547cf2d1-2c61-11f0-9668-7f39add00f22",
            "status": "success"
        },
        "106905548": {
            "moderation_type": "thorn_detection",
            "task_id": "547cf2d1-2c61-11f0-bc2b-f9bfed1d4eae",
            "status": "success"
        }
    },
    "content_id": "1MtXir3z6njZ934qeXnoN3_2025-05-08T23:08:18.911Z_0U0TVGlciG0X2elhbKOSb8",
    "triggered_rules": [],
    "triggered_background_rules": []
}

Sync Response (CSAM Not Detected)

{
    "task_ids": [
        "c2793dd1-2c65-11f0-ba54-fb336acfcddb"
    ],
    "post_id": "hive-test-apr-8-6",
    "user_id": "hive-test-may-8-6",
    "project_status_map": {
        "32952": {
            "moderation_type": "visual",
            "task_id": "c2793dd1-2c65-11f0-ba54-fb336acfcddb",
            "status": "success"
        },
        "103334095": {
            "moderation_type": "thorn_matching",
            "task_id": "c22ca470-2c65-11f0-8ac1-914d0a274209",
            "status": "success"
        },
        "106905548": {
            "moderation_type": "thorn_detection",
            "task_id": "c22ca471-2c65-11f0-a182-d3aadeba5f46",
            "status": "success"
        }
    },
    "content_id": "0ftt2JonxGhwJVS135LNUz_2025-05-08T23:40:00.915Z_0U0TVGlciG0X2elhbKOSb8",
    "triggered_rules": [
        {
            "rule_id": "425kaOnTOSUhDtFlwlmUT8",
            "rule_name": "[visual] Send to Review",
            "action_params": [
                {
                    "id": "4OVAJyKBUsnmJAO5sMc0VA",
                    "policies": [],
                    "action_reason_ids": []
                },
                {
                    "id": "send_post_to_review",
                    "policies": [],
                    "action_reason_ids": []
                }
            ]
        }
    ],
    "triggered_background_rules": []
}

Example Responses (Thorn Async Responses)

Thorn responses are separate from the model responses. Moderation Dashboard will return a separate callback with just Thorn results. Please refer to the sample responses below:

Initial API Response

{
   "task_ids": [
       "task_id_1",
       "task_id_2"
   ],
   "post_id": "jan7-4",
   "user_id": "jan7-4",
   "project_status_map": {
       "32952": {
           "moderation_type": "visual",
           "status": "awaiting_thorn"
       },
       "42913": {
           "moderation_type": "demographic",
           "status": "awaiting_thorn"
       },
       "103021708": {
           "moderation_type": "thorn_matching",
           "task_id": "task_id_1",
           "status": "pending"
       },
       "104408158": {
           "moderation_type": "thorn_detection",
           "task_id": "task_id_2",
           "status": "pending"
       }
   },
   "message": "We received your submission."
}

Callback API Response (CSAM DETECTED)

{
  "task_ids": [
       "97c6dfe1-c250-11ef-8763-637c0a853f6c123214",
       "97c706f0-c250-11ef-8b28-35b4e9d11bff123241"
  ],
  "csam_results": ["thorn_classification"],
  "post_id": "dec24-1-1",
  "user_id": "dec24-1-1",
  "project_status_map": {
    "103021708": {
      "moderation_type": "thorn_matching",
      "task_id": "97c6dfe1-c250-11ef-8763-637c0a853f6c123214",
      "status": "success"
    },
    "104408158": {
      "moderation_type": "thorn_detection",
      "task_id": "97c706f0-c250-11ef-8b28-35b4e9d11bff123241",
      "status": "success"
    }
  },
  "content_id": "2GutgpFiNETBp5fLzDlxPj_2024-12-24T23:44:40.911Z_0U0TVGlciG0X2elhbKOSb8",
  "triggered_rules": [],
  "triggered_background_rules": []
}

Thorn Callback API Response (NO CSAM)

{
  "task_ids": [
    "task_1",
    "task_2",
    "task_3",
    "task_4"
  ],
  "post_id": "jan7-7",
  "user_id": "jan7-7",
  "project_status_map": {
    "32952": {
      "moderation_type": "visual",
      "task_id": "task_1,
      "status": "pending"
    },
    "42913": {
      "moderation_type": "demographic",
      "task_id": “task_2",
      "status": "pending"
    },
    "103021708": {
      "moderation_type": "thorn_matching",
      "task_id": "task_3",
      "status": "success"
    },
    "104408158": {
      "moderation_type": "thorn_detection",
      "task_id": "task_4",
      "status": "success"
    }
  }
}

Full Callback API Response with Thorn Results (NO CSAM)

{
  "task_ids": [
    "task_1",
    "task_2",
    "task_3",
    "task_4"
  ],
  "post_id": "jan7-7",
  "user_id": "jan7-7",
  "project_status_map": {
    "32952": {
      "moderation_type": "visual",
      "task_id": "task_1",
      "status": "success"
    },
    "42913": {
      "moderation_type": "demographic",
      "task_id": "task_2",
      "status": "success"
    },
    "103021708": {
      "moderation_type": "thorn_matching",
      "task_id": "task_3",
      "status": "success"
    },
    "104408158": {
      "moderation_type": "thorn_detection",
      "task_id": "task_4",
      "status": "success"
    }
  },
  "content_id": "4A8UGOc2Y8YF36WUf5EyvH_2025-01-08T06:20:15.446Z_0U0TVGlciG0X2elhbKOSb8",
  "triggered_rules": [],
  "triggered_background_rules": []
}

CSAM Review Feed

On the Settings page, under Thorn/NCMEC, you can enable the NCMEC Review Feed. This will display only CSAM in the Review Feed for images flagged by Thorn. CSAM images will automatically be sent to the Review Feed for Review.

More information can be found on the Review Feeds page.