# Media

Advisory checks for media that never went through the capture SDK.

Related guide: [Synthetic-media screening](https://provenanceauth.com/docs/attest/concepts/synthetic-media-screening.md)

## Endpoints

- `POST /v1/attest/media/verify_c2pa`: [Check a C2PA manifest](#post-v1-attest-media-verify-c2pa)
- `POST /v1/attest/media/screen`: [Screen media](#post-v1-attest-media-screen)

## Events

Sent to your [webhook endpoints](https://provenanceauth.com/docs/integrate/webhooks.md) when they subscribe:

- `attest.media_screening.completed`

## Check a C2PA manifest

`POST /v1/attest/media/verify_c2pa`

Checks a C2PA manifest's structure and its signature against the embedded signer certificate. The result is advisory and kept separate from risk_score.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | no | Retry a create safely: the same key + request returns the stored response (24 h, per caller). |
| `manifest_base64` | body | string | yes | Base64 COSE-Sign1 C2PA manifest. |

### Returns

The manifest check. It's advisory.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
curl -X POST "$PROVENANCE_API/v1/attest/media/verify_c2pa" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "manifest_base64": "hFgnogEmGCGCWQFOMIIBSjCB8KADAgECAhQ" }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/attest/media/verify_c2pa`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ "manifest_base64": "hFgnogEmGCGCWQFOMIIBSjCB8KADAgECAhQ" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/attest/media/verify_c2pa", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}, json={
    "manifest_base64": "hFgnogEmGCGCWQFOMIIBSjCB8KADAgECAhQ"
}).json()
```

### Response 200

```json
{
  "c2pa_present": true,
  "c2pa_valid": true,
  "signer_subject": "CN=Pellowmarsh Camera Signing, O=Pellowmarsh, C=US",
  "claim_generator": "Pellowmarsh Camera/4.2 c2pa-rs/0.36",
  "assertions": [
    "c2pa.actions",
    "c2pa.hash.data",
    "stds.exif"
  ],
  "advisory_factor": "c2pa_present_valid"
}
```

## Screen media

`POST /v1/attest/media/screen`

Asks a third-party detector whether an image or video looks AI-generated. For media that never went through the capture SDK. The score is advisory and kept separate from risk_score.

Auth: an API key, as `Authorization: Bearer <key>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | no | Retry a create safely: the same key + request returns the stored response (24 h, per caller). |
| `image_base64` | body | string | yes | The image bytes, base64-encoded. |

### Returns

The synthetic-media score and its factors.

### Errors

- [`authentication_required`](https://provenanceauth.com/docs/platform/errors.md#authentication_required)
- [`detector_not_configured`](https://provenanceauth.com/docs/platform/errors.md#detector_not_configured)
- [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope)
- [`invalid_json`](https://provenanceauth.com/docs/platform/errors.md#invalid_json)
- [`media_too_large`](https://provenanceauth.com/docs/platform/errors.md#media_too_large)
- [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid)
- [`parameter_missing`](https://provenanceauth.com/docs/platform/errors.md#parameter_missing)
- [`rate_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#rate_limit_exceeded)
- [`resource_missing`](https://provenanceauth.com/docs/platform/errors.md#resource_missing)
- [`screening_provider_error`](https://provenanceauth.com/docs/platform/errors.md#screening_provider_error)
- [`spend_limit_exceeded`](https://provenanceauth.com/docs/platform/errors.md#spend_limit_exceeded)
- [`usage_limit_reached`](https://provenanceauth.com/docs/platform/errors.md#usage_limit_reached)

### Request

**curl**

```bash
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
curl -X POST "$PROVENANCE_API/v1/attest/media/screen" \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "image_base64": "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAP" }'
```

**Node**

```ts
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/attest/media/screen`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ "image_base64": "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAP" }),
})).json();
```

**Python**

```python
import os
import httpx

api = os.environ["PROVENANCE_API"]
data = httpx.post(f"{api}/v1/attest/media/screen", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}, json={
    "image_base64": "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAP"
}).json()
```

### Response 200

```json
{
  "id": "med_01M5R0D2B5E8H1K4N7Q0T3W6YC",
  "object": "media_screening",
  "media_type": "image",
  "synthetic_media_score": 12,
  "synthetic_media_factors": [
    {
      "factor": "generator_artifacts",
      "points": 12,
      "description": "Faint upsampling artifacts in the frequency domain."
    }
  ],
  "detector": "hive-v2",
  "screened_at": "2026-10-24T22:46:10.031Z",
  "cache_hit": false
}
```
