Skip to main content
POST

Authorizations

Authorization
string
header
required

API key authentication. Provide your key in the Authorization header with the ApiKey scheme:

Body

application/json
channelId
string<uuid>
required

Identifier of the channel the text belongs to. Provided by Bodyguard.

text
string
required

The text content to analyze.

Maximum string length: 10000
Example:

"I love this product!"

publishedAt
string<date-time>

Publication date of the message. Defaults to the current date and time if omitted. This value must be stable across retries or resubmissions of the same message — changing it will cause the message to be duplicated in Bodyguard's records. Dates before 2020-01-01 are not supported.

reference
string

Your own stable identifier for this piece of content (e.g. a comment ID from your database). Bodyguard echoes it back in webhooks and stored results, making it easy to correlate analysis with your own records. If omitted, a random reference is automatically generated.

Maximum string length: 256

A public URL pointing to the content, if available.

language
string

Hint about the content language as an ISO 639-1 code (e.g. en, fr). If omitted, language is auto-detected.

Required string length: 2
Example:

"en"

post
object

Metadata about the post the analyzed content belongs to. Optional, but strongly recommended: it powers context-aware moderation based on the post topic, which can't work without it. This information also appears on the Dashboard analytics through post-level data.

author
object

Metadata about the author of the content. Optional, but strongly recommended: some features only work with it — for example, spam management is tracked per author. This information also appears on the Dashboard analytics through author-level data.

Response

200 - application/json

Analysis completed.

textAnalysis
object

Moderation result for a piece of text.