Bulk Reporting
18 min
the bulk reporting api allows you to submit multiple cases to nima in a single request, enabling efficient processing of large volumes of reports overview the bulk reporting api enables you to submit multiple reports in a single api call process reports more efficiently with reduced api overhead maintain transactional integrity across multiple submissions scale your integration for high volume reporting scenarios api endpoint post {endpoint moderation} how it works the bulk action api accepts an array of items in the request body processes multiple reports in a single transaction returns a summary response indicating the number of cases created example request below is an example payload showing how to submit multiple cases { "items" \[ { "priority" "severe", "channel" "user report", "reason for request" "lorem abuse reason for request", "customerspecific" { }, "content" { "content id" "{{$randompassword}}", "title" "dangerous customisation of characters {{$randompassword}}", "body" "caseylegacy", "rawtext" "caseylegacy", "token" "", "type" { "id" "txt", "name" "text" }, "status" "published", "customerspecific" {} }, "reporter" { "id" "{{$randompassword}}", "name" "reporter james", "lang" "en", "phonenumber" "070 123456", "emailaddress" "joel\@tremau com", "customerspecific" {} }, "reportee" { "id" "{{$randompassword}}", "name" "reportee john", "lang" "en", "phonenumber" "070 564123", "emailaddress" "joel\@tremau com", "customerspecific" {} }, "location" { "city" "stockholm", "postalcode" "111 57", "region" "stockholm", "countrycode" "se", "ipaddress" "192 168 0 1", "customerspecific" {} }, "label" \[ "terrorist propaganda" ] }, { "priority" "severe", "channel" "user report", "reason for request" "lorem abuse reason for request", "customerspecific" { }, "content" { "content id" "{{$randompassword}}", "title" "dangerous customisation of characters {{$randompassword}}", "body" "caseysupporter01", "rawtext" "caseysupporter01", "token" "", "type" { "id" "txt", "name" "text" }, "status" "published", "customerspecific" {} }, "reporter" { "id" "{{$randompassword}}", "name" "reporter james", "lang" "en", "phonenumber" "070 123456", "emailaddress" "joel\@tremau com", "customerspecific" {} }, "reportee" { "id" "{{$randompassword}}", "name" "reportee john", "lang" "en", "phonenumber" "070 564123", "emailaddress" "joel\@tremau com", "customerspecific" {} }, "location" { "city" "stockholm", "postalcode" "111 57", "region" "stockholm", "countrycode" "se", "ipaddress" "192 168 0 1", "customerspecific" {} }, "label" \[ "terrorist propaganda" ] } ] } api response success response the api returns a summary indicating the number of cases successfully scheduled for moderation { "message" "2 cases scheduled for moderation" } request structure while proactive detection in nima and automated moderation will moderate the majority of harmful content and check all content posted, it may be the case that your users will report content in nima, you can integrate your existing and current user reporting flow to make sure user reports are promptly reviewed by human moderators note this reporting flow is separate from the dsa reporting flow, which is instead detailed here \[link to be added] overview the user reports api of nima allows you to connect your reporting flows to nima this enables your moderation team to review user generated content reports from your platform and take action on flagged content through a centralized console api endpoint post {endpoint moderation} the review workflow to integrate user reports from your platform into nima, use the user reports api the workflow is as follows a user flags content on your platform your system sends the report to nima via the user reports api nima routes the report into a dedicated moderation queue your moderators review the report in the nima console and take appropriate action api integration making a request submit user reports by making a post request to /queues/process file the request must include the required headers and a json payload containing the report details curl location g '{{url}}/queues/process file' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data raw '{ "priority" "severe", "channel" "user report", "reason for request" "lorem abuse reason for request", "customerspecific" {}, "content" { "content id" "098765434567", "title" "content title", "body" "an optional text description of the submitted content ", "url" "https //images unsplash com/photo 1585589266882 2cb137ba7db6?ixlib=rb 4 0 3\&ixid=m3wxmja3fdb8mhxwag90by1wywdlfhx8fgvufdb8fhx8fa%3d%3d\&auto=format\&fit=crop\&w=725\&q=80", "token" "a livestreaming video token when content type is livestream", "type" { "id" "img" }, "status" "published", "customerspecific" { "post likes" "12", "post views" "12" } }, "reporter" { "id" "321", "name" "reporter james", "phonenumber" "070 123456", "emailaddress" "reporter\@tremau net", "customerspecific" { "reporter account creation date" "2023 04 03", "reporter account verified" "true" } }, "reportee" { "id" "123", "name" "reportee john", "phonenumber" "070 564123", "emailaddress" "reportee\@tremau net", "customerspecific" { "reportee account creation date" "2023 04 03", "reportee account verified" "true" } }, "location" { "city" "stockholm", "postalcode" "111 57", "region" "stockholm", "countrycode" "se", "ipaddress" "192 168 0 1", "customerspecific" {} }, "label" \[ "nudity" ] }' request parameters global parameters parameter type required description reason for request string yes user explains why he or she is reporting content or profile priority string yes priority of the incoming request \['severe','high','medium','low'] channel string yes channel specifies means by which report was made, in this case "user report" takes from the following values \['email', 'trusted flagger', 'automated detection', 'lea', 'user report'] in order to use automated detection features, channel must be set to 'automated detection' customerspecific object no global customerspecific attributes ai detection providers will inject moderation results here before the case is placed into nima label string\[] no main reason and policy infringement content is being reported for (example "hateful content", "terrorism", "child abuse", etc ) content parameter type required description content title string yes a title for the piece of content content content id string yes id corresponding to content that has been uploaded and reported by a user content url string yes publicly available url of reported content content type object yes content type sits as an object like this "type" {"id" "txt"} content type can have the following values const video stream = "video stream"; const video static = "video static"; const img = "image"; const audio = "audio"; const txt = "text"; const iframe = "iframe"; const pdf = "pdf"; const file = 'file' where the id is the enum in caps content rawtext string no raw text is used when the content type is 'txt' and is used for automated text moderation via ai detection providers if rawtext is supplied, then language is required content language string no necessary if rawtext is supplied content token string no used for livestreaming content status string no status of the content on client platform content customerspecific object no customer specific key value attributes that will be passed back in webhook responses upon receipt of moderation action being applied specifically for the content reporter parameter type required description reporter name string yes name of the reporter reporter id string yes user id of the reporter as it appears in your database fallback to the reporter emailaddress when id equals 0, anonymous or unknown reporter phonenumber string no reporter phone number reporter lang string no language the reporter's set to reporter emailaddress string yes user email of the reporter for communication purposes (statement of reasons sent by email, appeals, etc ) reporter customerspecific object no customer specific key value attributes that will be passed back in webhook responses upon receipt of moderation action being applied specifically for the reporter reportee parameter type required description reportee name string yes the name of the individual who is being reported reportee id string yes user id of the reportee (content uploader) as it appears in your database fallback to the reportee emailaddress when id equals 0, anonymous or unknown reportee lang string no the language of the individual being reported reportee phonenumber string no phone number of reportee reportee emailaddress string yes user email of the reportee for communication purposes (statement of reasons sent by email, appeals, etc ) reportee customerspecific object no reportee customer specific attributes location the location attribute is optional if provided, it can contain any of the following location data points parameter type required examples location postalcode string no "pt12 zpe" location city string no "london" location region string no "middlesex" location countrycode string (use iso codes, i e gb) no "gb","fr" location ipaddress string no "192 168 2 1" location customerspecific object no {"key" "value"} a note on customerspecific the global, content, reportee and reporter attributes all possess an optional field which accepts an object customerspecific key value pairs will always be accepted; however, to observe these customerspecific attributes in the metadata on the moderation dashboard, you must configure these custom attributes in the "admin settings > custom attributes" configuration page api response the api returns a structured response to confirm successful processing or indicate validation errors success response a successful call to /queues/process file returns the following response { "message" "success", "ok" true } error response if mandatory fields are missing or contain invalid data, the api will return a validation error detailing the specific failures { "statuscode" 400, "message" \[ "content title must be a string", "content title should not be empty" ], "error" "bad request" } error handling the following error may occur when submitting user reports exception reason output response status badrequestexception missing mandatory fields in the request body object with missing fields will be provided 400 key points array format wrap all reports in an items array individual structure each item must contain all required fields (content, reporter, reportee, etc ) validation all items are validated before processing if any item fails validation, the entire request may be rejected transaction the bulk submission is processed as a single transaction