# Phone photo auto-backup — API contract Written 2026-08-04, for the mobile developer. This is the server-side contract for "photos taken on the phone appear on the server automatically", i.e. what the Immich app does today. **The mobile app is not built here.** This document is the boundary: everything below is either already live or explicitly listed as missing, so the app can be built against it rather than reverse-engineered from the web client. --- ## The short version **Almost all of this already exists.** Officer proxies a self-hosted Immich through the `officer-photos` sidecar, and the sidecar's route allow-list already permits the `assets` resource for `GET POST PUT DELETE` (`src/servers/sidecar/photos/routes.ts:22`). Immich's own upload and dedupe endpoints are therefore already reachable through Officer, with Officer's auth in front and the Immich API key never leaving the sidecar. So the work is not "build a photo ingest service". It is: use the endpoints below, and close the three gaps at the bottom. --- ## Topology ``` phone app officer officer-photos Immich ───────── ─────── ────────────── ────── Authorization: → userMiddleware (JWT) → allow-list by first → x-api-key Bearer injects X-Officer-User method in the sidecar) ``` The phone holds a **platform JWT** — the same credential `monorepo-mobile/packages/core/src/services/ api.ts:58` already sends as `Authorization: Bearer `. It never holds an Immich key and never talks to Immich directly. Base path for everything below: **`/api/photos/_officer/…`**, which maps to `/api/…`. So `/api/photos/_officer/assets` is Immich's `POST /api/assets`. --- ## Endpoints ### 1. Is the library reachable at all ``` GET /api/photos/_health → 200 { ok: true, configured: true, account: "