Skip to main content
The Bodyguard Analyze API classifies text, images, and usernames for harmful or undesirable content. All requests are made over HTTPS to:
api.bodyguard.ai is a global endpoint that should be used by default. api.bodyguard.ai is located in the Bruxelles (Belgium) area.

Regional endpoints

For lower latency, you can send requests directly to a specific region:
Regional endpoints expose the same API as the global endpoint — only the base URL changes. Your API key works across all regions.

Quickstart

The following example analyzes a text message. Replace <your-api-key> and <your-channel-id> with values provided by Bodyguard.
To interpret the response, see the text classifications taxonomy.

Authentication

All requests must include an Authorization header using the ApiKey scheme. The scheme name is case-sensitive — ApiKey must be written exactly as shown.

Required request headers

Your API key is provided by Bodyguard. Keep it secret and never expose it in client-side code.

Authentication errors

All authentication failures return a 401 Unauthorized response with the AUTHENTICATION_ERROR code and one of the following reasons: The reason is returned inside the error envelope’s details.authenticationError.reason field. See Errors for the full response format and a worked example.

Versioning

Endpoints live under a versioned path — for example, /analyze/v1/text. The /v1/ endpoints are stable and Bodyguard commits to their API stability. Any breaking change will be introduced under a new version path (for example /v2/), allowing you to migrate on your own schedule.

Rate limits

Rate limits are enforced per organisation. Each endpoint has its own independent quota. Quotas are customer-specific and negotiated as part of your contract. When your organisation exceeds a quota, the API returns 429 Too Many Requests with the QUOTA_ERROR code. The response envelope’s details.quotaError.violations array identifies which specific quota was exceeded.
Need a quota adjustment? Contact us.

Errors

All errors follow a consistent JSON envelope:
The details object contains structured information specific to the error type and has exactly one field whose name matches the error code (e.g. badRequestError for BAD_REQUEST_ERROR). The Content-Type of error responses is always application/json.

Error codes

Example: bad request

Example: authentication failure

Example: transient failure

Retry TRANSIENT_ERROR responses with exponential backoff. All other error codes should not be retried without addressing the underlying cause.

Next steps

Key concepts

Learn the core building blocks of the Bodyguard API: organizations, sources, channels, references, and publication dates.