# API Documentation: /embed-metadata & /strip - metadata

## Endpoints
        `POST /embed-metadata`
`POST /strip-metadata`

## Description
**embed-metadata**: Embeds realistic EXIF camera data into JPEG images alongside enriched XMP and IPTC metadata, making AI-generated images appear camera-captured from a metadata analysis perspective. Supported input formats: JPEG, PNG, WebP, GIF, BMP, TIFF. Output format is always JPEG.

**strip-metadata**: Removes all unnecessary metadata (EXIF, XMP, IPTC, COM) from the image to make it undetectable as AI-generated. Requires only `image_path`.

## Request Body (JSON)
| Field | Type | Required | Description | Default |
|---|---|---|---|---|
| `image_path` | string | Yes | Public URL OR Base64 string of the source image | |
| `title` | string | Yes | Image title / headline (max 200 chars) | |
| `description` | string | No | Caption / abstract (max 2000 chars) | |
| `keywords` | array | No | Array of strings (max 50 items) | `[]` |
| `category` | string | No | Category label | |
| `creator` | string | No | Author / byline | |
| `copyright` | string | No | Copyright notice | |
| `camera_profile` | string | No | Specific camera profile id (e.g. `sony-a7iv-85`, `nikon-z8-35`, `canon-r5-50`, `fuji-xt5-23`) | Random |
| `software` | string | No | Override the Software tag in EXIF | Camera profile default |
| `location` | object | No | Specific GPS location object (`lat`, `lon`, `city`, `country`) | Random from 20 world cities |

*Note: For `/strip-metadata`, only `image_path` is required. All other fields are ignored.*

## Authentication
Every API request requires an API key generated from the dashboard:
`Authorization: Bearer YOUR_API_KEY`
The admin key is only for the dashboard and must never be used in cURL requests.

## Example cURL Request
```bash
curl -X POST http://imagemetadata.n8nbd.publicvm.com/embed-metadata \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
    "image_path": "https://tmpfiles.org/dl/1234/photo.jpg",
    "title": "A beautiful sunset",
    "description": "Sunset over the mountains.",
    "keywords": ["sunset", "mountains", "nature"],
    "category": "Nature",
    "creator": "Fuad Naser Bondhon",
    "copyright": "© 2026 Fuad Naser Bondhon",
    "camera_profile": "sony-a7iv-85",
    "software": "Adobe Lightroom Classic 13.4.1",
    "location": {
        "lat": 48.8566,
        "lon": 2.3522,
        "city": "Paris",
        "country": "France"
    }
}'
```

## Response
Returns a JSON object containing the `metadata_image_url` (valid for 1 hour), file details, and applied `exif_context`.
