{
  "openapi": "3.0.3",
  "info": {
    "title": "Visual Verification API Reference",
    "version": "",
    "description": "Below you will find the technical specifications, request schemas, and response models for our endpoints.\n\nChoose an endpoint from the sidebar to view code samples and run test requests.\n"
  },
  "tags": [
    {
      "name": "Endpoints",
      "description": "Verify whether image or video content was generated or signed by Bria."
    }
  ],
  "servers": [
    {
      "url": "https://engine.prod.bria-api.com"
    }
  ],
  "paths": {
    "/v2/image/verify": {
      "post": {
        "summary": "Verify Image",
        "tags": [
          "Endpoints"
        ],
        "operationId": "verify-image",
        "description": "Checks whether an image was generated or signed by Bria, via its C2PA manifest and Bria's invisible watermark.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "image"
                ],
                "properties": {
                  "image": {
                    "type": "string",
                    "description": "A publicly accessible image URL, or a base64-encoded image. Accepts JPEG, PNG, GIF, or WEBP; only PNG and JPEG are checked for the invisible watermark."
                  }
                }
              },
              "examples": {
                "by url": {
                  "description": "This sample is a plain input image, not signed or watermarked, so this request returns `verified: false`. Point `image` at your own Bria-generated or signed asset to see a `true` result.",
                  "value": {
                    "image": "https://labs-assets.bria.ai/sandbox-example-inputs/remove_background_example.jpg"
                  }
                },
                "by base64": {
                  "description": "A 1x1 PNG placeholder, not signed or watermarked, so this request also returns `verified: false`. Swap in your own base64-encoded Bria asset.",
                  "value": {
                    "image": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncSuccessResponse"
                },
                "examples": {
                  "trusted by C2PA": {
                    "value": {
                      "result": {
                        "verified": true,
                        "c2pa": {
                          "present": true,
                          "is_trusted": true,
                          "validation_state": "Trusted"
                        },
                        "invisible_watermark_detected": false
                      },
                      "request_id": "a1b2c3d4e5f6"
                    }
                  },
                  "signed, but not by Bria": {
                    "value": {
                      "result": {
                        "verified": false,
                        "c2pa": {
                          "present": true,
                          "is_trusted": false,
                          "validation_state": "Valid"
                        },
                        "invisible_watermark_detected": false
                      },
                      "request_id": "9f8e7d6c5b4a"
                    }
                  },
                  "not from Bria": {
                    "value": {
                      "result": {
                        "verified": false,
                        "c2pa": {
                          "present": false,
                          "is_trusted": false
                        },
                        "invisible_watermark_detected": false
                      },
                      "request_id": "f6e5d4c3b2a1"
                    }
                  },
                  "GIF or WEBP, watermark check skipped": {
                    "value": {
                      "result": {
                        "verified": false,
                        "c2pa": {
                          "present": false,
                          "is_trusted": false
                        }
                      },
                      "request_id": "3c2b1a0f9e8d"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "460": {
            "$ref": "#/components/responses/FailedToDownload"
          },
          "5XX": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/v2/video/verify": {
      "post": {
        "summary": "Verify Video",
        "tags": [
          "Endpoints"
        ],
        "operationId": "verify-video",
        "description": "Checks whether a video was generated or signed by Bria, via its C2PA manifest and Bria's invisible watermark.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "video"
                ],
                "properties": {
                  "video": {
                    "type": "string",
                    "format": "uri",
                    "description": "A publicly accessible video URL. Accepts MP4, MOV, or M4V."
                  }
                }
              },
              "examples": {
                "by url": {
                  "description": "This sample is a plain input video, not signed or watermarked, so this request returns `verified: false`. Point `video` at your own Bria-generated or signed asset to see a `true` result.",
                  "value": {
                    "video": "https://labs-assets.bria.ai/sandbox-example-inputs/3446608-sd_426_240_25fps.mp4"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncSuccessResponse"
                },
                "examples": {
                  "signed and watermarked by Bria": {
                    "value": {
                      "result": {
                        "verified": true,
                        "c2pa": {
                          "present": true,
                          "is_trusted": true,
                          "validation_state": "Trusted"
                        },
                        "invisible_watermark_detected": true
                      },
                      "request_id": "a1b2c3d4e5f6"
                    }
                  },
                  "watermark only, no C2PA manifest": {
                    "value": {
                      "result": {
                        "verified": true,
                        "c2pa": {
                          "present": false,
                          "is_trusted": false
                        },
                        "invisible_watermark_detected": true
                      },
                      "request_id": "b2c3d4e5f6a1"
                    }
                  },
                  "not from Bria": {
                    "value": {
                      "result": {
                        "verified": false,
                        "c2pa": {
                          "present": false,
                          "is_trusted": false
                        },
                        "invisible_watermark_detected": false
                      },
                      "request_id": "f6e5d4c3b2a1"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/VideoWorkerBusy"
          },
          "460": {
            "$ref": "#/components/responses/FailedToDownload"
          },
          "5XX": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "BadRequest": {
        "description": "Bad request (e.g. `image`/`video` sent as an explicit `null`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "The media exceeds the 100 MB size limit.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "FailedToDownload": {
        "description": "The URL couldn't be fetched: unreachable, timed out, returned a non-2xx status, or resolves to a private/internal address (URLs are fetched server-side and rejected if they don't resolve to a public address).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": 460,
                "message": "Failed to fetch media from URL: HTTP 404",
                "details": "460 Unknown Error: Failed to fetch media from URL: HTTP 404"
              },
              "request_id": "a1b2c3d4e5f6"
            }
          }
        }
      },
      "UnsupportedMediaType": {
        "description": "The media type isn't supported for this operation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": 415,
                "message": "C2PA verification is not supported for media type: application/pdf",
                "details": "415 Unsupported Media Type: C2PA verification is not supported for media type: application/pdf"
              },
              "request_id": "a1b2c3d4e5f6"
            }
          }
        }
      },
      "ValidationError": {
        "description": "The request body failed validation: e.g. a missing `image`/`video` field, or a value that doesn't meet the field's format (`video` must be a URL; `image` may be a URL or base64).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": 422,
                "message": "The request was well-formed but was unable to be followed due to semantic errors.",
                "details": "['image -> Must be a valid URL or base64-encoded string']"
              },
              "request_id": "a1b2c3d4e5f6"
            }
          }
        }
      },
      "VideoWorkerBusy": {
        "description": "The service is temporarily at capacity. Retry with backoff.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "An unexpected server-side failure. Retry; if it persists, contact support and quote the `request_id`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "schemas": {
      "SyncSuccessResponse": {
        "type": "object",
        "description": "Fields that have no value (e.g. `result.c2pa.validation_state` when no C2PA manifest is present) are omitted from the response entirely rather than sent as `null`.",
        "required": [
          "result",
          "request_id"
        ],
        "properties": {
          "result": {
            "type": "object",
            "required": [
              "verified",
              "c2pa"
            ],
            "properties": {
              "verified": {
                "type": "boolean",
                "description": "True if either the C2PA or the invisible-watermark signal confirms Bria origin."
              },
              "c2pa": {
                "type": "object",
                "description": "The result of checking the media's embedded C2PA manifest against Bria's trust anchor. See the [C2PA specification](https://c2pa.org/specifications/specifications/1.3/specs/C2PA_Specification.html) for the manifest structure.",
                "required": [
                  "present",
                  "is_trusted"
                ],
                "properties": {
                  "present": {
                    "type": "boolean",
                    "description": "Whether the media carries an embedded C2PA manifest at all."
                  },
                  "is_trusted": {
                    "type": "boolean",
                    "description": "Whether the manifest's signing certificate chains up to Bria's own trust anchor. `true` only when `validation_state` is `Trusted`; `false` when `Valid`, `Invalid`, or no manifest is present at all."
                  },
                  "validation_state": {
                    "type": "string",
                    "enum": [
                      "Invalid",
                      "Valid",
                      "Trusted"
                    ],
                    "description": "The manifest's C2PA signature validation outcome; omitted when `present` is `false`. `Invalid` means the signature itself is broken or the media was tampered with after signing. `Valid` means the signature is cryptographically intact but the signer isn't on Bria's trust list — it may be another vendor's legitimate C2PA credential or a self-signed one, so it's not evidence of Bria origin; `is_trusted` is `false` here. `Trusted` means the signing certificate chains all the way up to the exact certificate Bria registered as its own trust anchor — only this case sets `is_trusted` to `true`."
                  }
                },
                "additionalProperties": true
              },
              "invisible_watermark_detected": {
                "type": "boolean",
                "description": "Bria's invisible-watermark check result. Omitted when the check didn't run at all — for images, this happens for formats the check can't round-trip through (GIF and WEBP); video always runs the check, so this field is always present there. `true`/`false` means the check ran and did or didn't detect the watermark."
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "A unique identifier for this request, echoed back for support/debugging."
          }
        }
      },
      "ErrorObject": {
        "type": "object",
        "required": [
          "code",
          "message",
          "details"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "example": 400
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error",
          "request_id"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorObject"
          },
          "request_id": {
            "type": "string"
          }
        }
      }
    }
  }
}