guides / Getting Started
Florian avatar


Quick start

Whether you’re a developer, non-coder or business user, you will easily be able to understand how to start using Bodyguard’s API.

The API closely follows REST semantics. It uses JSON to encode objects and relies on standard HTTP codes to signal operation outcomes.

The API documentation below describes all use cases. We recommend that you use graphical tools like Postman to test our API with your own analysis.


Make sure that you have already created an account on Bodyguard (contact us at and have access to the dashboard.

Analyze content in less than 5 minutes

Step 1: Obtain your API key and Channel ID

Your account is represented as an organization and you can create as many sources you need. Then, you have to create a channel and generate a specific API key.

Step 2: Make a test API request

To check that your integration is working correctly, make a test API request using your API Key and channel ID to create an analysis request.


All API requests must be authenticated and made over TLS

Using REST

The following example is written in Javascript.
More languages snippets (Python, Go, PHP, Java, etc) will be available soon.

import request from 'request'

const options = {
  method: 'POST',
  url: '',
  headers: {
    'X-Api-Key': '__GENERATED_API_KEY__',
    'Content-Type': 'application/json'
  body: JSON.stringify({
    channelId: "__GENERATED_CHANNEL_ID__",
    contents: [
        text : "Einstein is an asshole",
        publishedAt: "2022-10-07T11:34:26.312Z"

request(options, (error, response) => {
  if (error) {
    throw new Error(error)

Bodyguard returns an analysis object in response of your API request :

    "data": [
            "text": "Einstein is an asshole",
            "reference": "bodyguard/fc9dec31-695d-47cc-b919-68dd711bd607",
            "type": "HATEFUL",
            "severity": "HIGH",
            "recommendedAction": "REMOVE",
            "meta": {
                "directedAt": "SINGLE_PERSON",
                "classifications": [
            "language": "en",
            "analyzedAt": "2022-10-07T11:34:29.873Z",
            "publishedAt": "2022-10-07T11:34:26.312Z"

What's next?

The power of Bodyguard's API allows you to get more than a simple analysis. From message batches to contextual informations (authors, etc) there is so much to discover.

Don't hesitate to take a look at this documentation to unleash the power of our API.