API Reference / List the flags your account may send
API Reference

List the flags your account may send

GET/api/v1/flags

Per moderation type, every flag a request (or a live session) of your account may name in flags, including flags set up for your account only. A flag that is not in this list is refused with 400. Not cached: the list is your account's.

Responses#

200#

Your flags, per type.

  • text_moderation array of AccountFlag

  • image_moderation array of AccountFlag

  • video_moderation array of AccountFlag

  • audio_moderation array of AccountFlag

  • live_stream_moderation array of AccountFlag

text_moderation[] (AccountFlag)

  • key string required

    The flag's key: what flags takes.

  • name string required

    Its display name.

  • available boolean required

    Whether it can be checked right now. A flag that is not is still accepted; it comes back in unchecked.

image_moderation[] (AccountFlag)

  • key string required

    The flag's key: what flags takes.

  • name string required

    Its display name.

  • available boolean required

    Whether it can be checked right now. A flag that is not is still accepted; it comes back in unchecked.

video_moderation[] (AccountFlag)

  • key string required

    The flag's key: what flags takes.

  • name string required

    Its display name.

  • available boolean required

    Whether it can be checked right now. A flag that is not is still accepted; it comes back in unchecked.

audio_moderation[] (AccountFlag)

  • key string required

    The flag's key: what flags takes.

  • name string required

    Its display name.

  • available boolean required

    Whether it can be checked right now. A flag that is not is still accepted; it comes back in unchecked.

live_stream_moderation[] (AccountFlag)

  • key string required

    The flag's key: what flags takes.

  • name string required

    Its display name.

  • available boolean required

    Whether it can be checked right now. A flag that is not is still accepted; it comes back in unchecked.

401#

Missing, unknown, revoked or expired API key, or the account is not active.

{
  "error": "unauthorized",
  "message": "The API key is not valid."
}

429#

Too many requests in a minute. Wait Retry-After seconds. See Rate limits.

Header Retry-After: Seconds to wait.

{
  "error": "too_many_requests",
  "message": "Too many requests. Try again in a minute."
}

Request

curl -X GET https://api.detectivision.ai/api/v1/flags \
  -H "Api-Key: $DETECTIVISION_API_KEY"
import os, requests

r = requests.get(
    "https://api.detectivision.ai/api/v1/flags",
    headers={"Api-Key": os.environ["DETECTIVISION_API_KEY"]},
)
print(r.status_code, r.json())
const res = await fetch("https://api.detectivision.ai/api/v1/flags", {
  method: "GET",
  headers: {
    "Api-Key": process.env.DETECTIVISION_API_KEY,
  },
});
console.log(res.status, await res.json());

Response 200

{
  "text_moderation": [
    {
      "key": "hate",
      "name": "Hate",
      "available": true
    },
    {
      "key": "insult",
      "name": "Insult",
      "available": true
    }
  ],
  "image_moderation": [
    {
      "key": "scam",
      "name": "Scam",
      "available": true
    }
  ]
}