> ## Documentation Index
> Fetch the complete documentation index at: https://docs.identifai.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Apply watermark

> Submit a media asset to have one or more watermarking policies applied to it. The request is processed asynchronously: the endpoint returns a submission identifier and its current status, and the watermarked asset becomes available once processing is complete.

The file to watermark must be uploaded in the `file` field of a `multipart/form-data` request.

Submit a media asset to have one or more **watermarking policies** applied to it.

The request must be sent as `multipart/form-data`, with the asset to watermark
uploaded in the **`file`** field. Processing is asynchronous: the endpoint
returns a submission `id` and its `status`, and the watermarked asset becomes
available once the `status` is `done`.

## Policies

Pass one or more values in the `policies` field. At least one is required.

| Policy                | Description                                                                                                                                                                |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `european-watermarks` | Visible and invisible watermarks following the European (EU AI Act) transparency approach.                                                                                 |
| `chinese-watermarks`  | Visible and invisible labels following the Chinese AIGC labelling regulation.                                                                                              |
| `aigc-metadata`       | Embeds AIGC / provenance metadata (`groundTruth`, `aigcLabel`, `producerId`, `contentProducer`, `contentPropagator`, `propagateId`, `author`) without altering the pixels. |
| `custom`              | Overlays a custom visible logo, configured through the `logoStorageUrl`, `logoStorageProvider`, `logoMargin`, `minLogoRatio` and `maxLogoRatio` parameters.                |

## Example request

```bash theme={null}
curl -X POST https://api.identifai.net/api/v2/watermark \
  -H "X-Api-Key: $IDENTIFAI_API_KEY" \
  -F "file=@/path/to/asset.png" \
  -F "policies[]=european-watermarks" \
  -F "policies[]=aigc-metadata" \
  -F "groundTruth=fully-ai-gen" \
  -F "aigcLabel=1" \
  -F "author=Jane Doe"
```

```json theme={null}
{
  "id": "674a3c9b8e2d4f12b7c9a8d3",
  "status": "new",
  "result": null
}
```


## OpenAPI

````yaml post /api/v2/watermark
openapi: 3.0.0
info:
  title: IdentifAI API v2
  version: 2.0.0
  description: >-
    API v2 for batch tampering detection on ticket images. This API allows you
    to submit multiple tickets for analysis and retrieve results for tampering
    detection.
servers:
  - url: https://api.identifai.net
security: []
tags:
  - name: Tampering Detection
    description: Batch tampering detection endpoints
  - name: Watermarking
    description: Apply watermarks and provenance metadata to media assets
paths:
  /api/v2/watermark:
    post:
      tags:
        - Watermarking
      summary: Apply watermark
      description: >-
        Submit a media asset to have one or more watermarking policies applied
        to it. The request is processed asynchronously: the endpoint returns a
        submission identifier and its current status, and the watermarked asset
        becomes available once processing is complete.


        The file to watermark must be uploaded in the `file` field of a
        `multipart/form-data` request.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The media asset to watermark. Upload it in this field.
                policies:
                  type: array
                  description: >-
                    One or more watermarking policies to apply to the asset. At
                    least one policy is required.


                    - `european-watermarks`: apply an invisible watermark
                    following the European (EU AI Act) transparency approach.

                    - `chinese-watermarks`: apply visible/invisible labels
                    following the Chinese AIGC labelling regulation.

                    - `aigc-metadata`: embed AIGC / provenance metadata (see
                    `AIGCMetadataType`) without altering the pixels.

                    - `custom`: overlay a custom visible logo, configured
                    through the `logo*` parameters.
                  items:
                    type: string
                    enum:
                      - european-watermarks
                      - chinese-watermarks
                      - aigc-metadata
                      - custom
                groundTruth:
                  type: string
                  description: >-
                    Declared nature of the content, embedded in the provenance
                    metadata.
                  enum:
                    - human
                    - artificial
                    - partially-ai-gen
                    - fully-ai-gen
                logoStorageUrl:
                  type: string
                  description: >-
                    `custom` policy: storage URL of the logo image to overlay on
                    the asset.
                logoStorageProvider:
                  type: string
                  description: >-
                    `custom` policy: identifier of the storage provider that
                    hosts `logoStorageUrl`.
                logoMargin:
                  type: number
                  description: >-
                    `custom` policy: margin, in pixels, between the logo and the
                    edges of the asset.
                minLogoRatio:
                  type: number
                  description: >-
                    `custom` policy: minimum size of the logo relative to the
                    asset (0-1).
                maxLogoRatio:
                  type: number
                  description: >-
                    `custom` policy: maximum size of the logo relative to the
                    asset (0-1).
                aigcLabel:
                  type: integer
                  description: >-
                    `aigc-metadata` policy: AIGC labelling level. `1` =
                    confirmed AI-generated, `2` = probably AI-generated, `3` =
                    suspicious / possibly AI-generated.
                  enum:
                    - 1
                    - 2
                    - 3
                producerId:
                  type: string
                  description: '`aigc-metadata` policy: identifier of the content producer.'
                contentProducer:
                  type: string
                  description: >-
                    `aigc-metadata` policy: name of the content producer (the
                    entity that generated the content).
                contentPropagator:
                  type: string
                  description: >-
                    `aigc-metadata` policy: name of the content propagator (the
                    entity that distributes the content).
                propagateId:
                  type: string
                  description: >-
                    `aigc-metadata` policy: identifier of the content
                    propagator.
                models:
                  type: array
                  description: >-
                    Optional list of watermarking model names to use. If
                    omitted, the default models available for your tier are
                    used.
                  items:
                    type: string
                author:
                  type: string
                  description: Author name to embed in the provenance metadata.
              required:
                - file
                - policies
      responses:
        '201':
          description: >-
            Submission accepted. Returns the submission identifier and its
            current status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WatermarkResult'
              example:
                id: 674a3c9b8e2d4f12b7c9a8d3
                status: new
                result: null
        '400':
          description: Bad request - Missing file or invalid parameters
          content:
            application/json:
              example:
                error: Invalid request
                message: policies must contain at least one valid value
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              example:
                error: Unauthorized
                message: Invalid or missing API key
        '403':
          description: >-
            The user is not authorized to access this API or did not accept the
            terms of service
          content:
            application/json:
              example:
                error: Forbidden
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              example:
                message: Too Many Attempts.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    WatermarkResult:
      type: object
      properties:
        id:
          type: string
          description: >-
            Identifier of the watermarking submission. Use it to poll `GET
            /api/v2/watermark/{id}`.
        status:
          type: string
          enum:
            - new
            - inprogress
            - done
            - errored
          description: >-
            Current status of the submission. `result` is populated only once
            the status is `done`.
        watermarks_errors:
          type: array
          description: >-
            Submission-level errors raised while preparing the watermarking job.
            Absent when there are none.
          items:
            type: string
        result:
          nullable: true
          description: >-
            Watermarking result. `null` while the submission is still being
            processed; populated once `status` is `done`.
          allOf:
            - $ref: '#/components/schemas/WatermarkApplicationResult'
      required:
        - id
        - status
        - result
    WatermarkApplicationResult:
      type: object
      properties:
        errors:
          type: array
          description: >-
            Errors raised while applying the requested policies. Empty when
            every policy was applied successfully.
          items:
            type: string
        applied_watermarks:
          type: array
          description: Policies that were successfully applied to the asset.
          items:
            type: string
            enum:
              - european-watermarks
              - chinese-watermarks
              - aigc-metadata
              - custom
        download_url:
          type: string
          description: >-
            Pre-signed URL to download the watermarked asset. Present only when
            at least one watermark was applied.
        expires_at:
          type: string
          format: date-time
          description: Expiration timestamp (ISO 8601) of `download_url`.
      required:
        - errors
        - applied_watermarks
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````