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.
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
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"
}
]
}
A maximum of 100 messages can be analyzed at the same time. Text max length is limited to 1000 characters by default, and can be customized for each client upon request at business@bodyguard.ai.
Each message reference is unique per channel – This means that if you set the same reference multiple times on a given channel, updates will be applied instead of creating new messages.
Important notes about the publishedAt
field:
- It CANNOT be updated
- It MUST always be consistent.
- Precision level is in milliseconds.