Analysis

Text analyses are a core part of Bodyguard.ai. This endpoint allows you to send us one or multiple text messages (batch) for diagnosis and recommendations.

POST/analyze

Create analyses

This endpoint allows you to analyze one or multiple messages.

  • Name
    channelId
    Type
    string *
    Description

    The moderation channel identifier you have created from your dashboard.

  • Name
    contents
    Type
    Object *
    Description

    A set of messages to analyze.

Request

POST
/analyze
curl --location --request POST 'bamboo.bodyguard.ai/api/analyze' \
--header 'X-Api-Key: __YOUR_API_KEY__' \
--header 'Content-Type: application/json' \
--data-raw '{
	"channelId": "__YOUR_CHANNEL_ID__",
	"contents": [
		{
			"text": "Einstein is an asshole",
			"publishedAt": "2022-10-01T01:50:27.256Z"
		},
		{
			"text": "Good job !",
			"publishedAt": "2022-09-23T03:21:56.332Z"
		}
	]
}'

Response

{
	"data": [
		{
			"text": "Einstein is an asshole",
			"reference": "bodyguard/00fa1bc5-2c4d-4135-a19b-0f01f103def3",
			"type": "HATEFUL",
			"severity": "HIGH",
			"recommendedAction": "REMOVE",
			"meta": {
				"directedAt": "SINGLE_PERSON",
				"classifications": ["INSULT"]
			},
			"language": "en",
			"analyzedAt": "2022-10-01T01:50:31.322Z",
			"publishedAt": "2022-10-01T01:50:27.256Z"
		},
		{
			"text": "Good job !",
			"reference": "bodyguard/a1571ce4-1803-4d68-9c93-e0416fbdb73b",
			"type": "SUPPORTIVE",
			"severity": "NONE",
			"recommendedAction": "KEEP",
			"meta": {
				"directedAt": "USER",
				"classifications": ["SUPPORTIVE"]
			},
			"language": "en",
			"analyzedAt": "2022-09-23T03:22:01.182Z",
			"publishedAt": "2022-09-23T03:21:56.332Z"
		}
	]
}