Unknown

Create Flag

Create a flag for a product.

This function is used to create a flag for a product or an image. A flag is a request for a product or an image to be reviewed. A flag is associated with a ticket. A ticket is created if it does not exist for this product or image. A ticket can be associated with multiple flags.

POST
/api/v1/flags
barcode?Barcode

Barcode of the product, if the flag is about a product or a product image. In case of a search issue, this field is null.

typeIssueType

Type of the issue

Value in"product" | "image" | "search"
urlUrl

URL of the product or of the flagged image

user_idUser Id

Open Food Facts User ID of the flagger

sourceSourceType

Source of the flag. It can be a user from the mobile app, the web or a flag generated automatically by robotoff.

Value in"mobile" | "web" | "robotoff"
confidence?Confidence

Confidence score of the model that generated the flag, this field should only be provided by Robotoff.

image_id?Image Id

ID of the flagged image

flavorFlavor

Flavor (project) associated with the ticket

Value in"off" | "obf" | "opff" | "opf" | "off-pro"
reason?Reason

Reason for flagging provided by the user. The field is optional.

comment?Comment

Comment provided by the user during flagging. This is a free text field.

created_at?Created At

Creation datetime of the flag

Formatdate-time

Response Body

curl -X POST "https://loading/api/v1/flags" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "product",
    "url": "string",
    "user_id": "string",
    "source": "mobile",
    "flavor": "off"
  }'
null
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}