Skip to main content

REST API

The REST API is the command surface of Face Matcher. You use it to create watchlists, enroll members, identify or verify faces on still images, run liveness checks, and to register and configure cameras and edge streams. Requests and responses are JSON over HTTP using the standard GET, POST, PUT and DELETE methods, so any language with an HTTP client can talk to it. Data querying is deliberately thin on this side; for reporting and event history use the GraphQL API.

Base URL and Swagger UI​

Where the client runsBase URL
On the host or elsewhere on the networkhttp://localhost:8098 (replace localhost with the server address)
In a container on face-matcher-networkhttp://api:8080

All endpoints live under /api/v1/. The container always listens on port 8080; Compose publishes it on 8098 on the host, so never use 8098 for in-network traffic. The API ships with a Swagger UI at the base URL, which is the authoritative, version-matched reference for every endpoint and schema: open http://localhost:8098 in a browser, expand a group, pick an endpoint, click Try it out, fill in the request and click Execute.

Swagger UI showing the POST /api/v1/Watchlists endpoint with its request body schema

Swagger UI with a request prepared and the Execute button

Swagger UI showing the JSON response of an executed request

Authentication is off by default. When you enable OAuth2/OIDC with Authentication__*, every call needs a bearer token and Swagger UI gains an Authorize button; see the Authentication guide.

Feature sets​

The api service exposes one of four feature sets, selected with the FeatureManagement__* variables in section 3.2 of .env. Full is the default and the one Station requires. The reduced sets are for deployments that expose the API to a third party and want to limit its surface.

Feature setVariableWhat it exposes
Full (default)FeatureManagement__Full=trueEvery endpoint group below
WatchlistFeatureManagement__Watchlist=trueAPI-only identification: watchlists, watchlist members, search, verification, liveness and detection on still images, no camera management
EdgeFeatureManagement__Edge=trueEdge stream management and the data they produce (including pedestrians)
DetectionFeatureManagement__Detection=trueThe Detect endpoint only

Set exactly one of them to true. FeatureManagement__ReadOnlyWatchlists=true additionally disables PUT, POST and DELETE on the Watchlists and WatchlistMembers groups, which is useful on a Follower where watchlists are managed centrally.

Endpoint groups​

GroupMethodsPurpose
CameraGET, POST, PUT, DELETERegister, configure and remove RTSP cameras; list their tracklets and frames; enable the enhanced preview
DetectionPOSTRun the detectors on a still image and return bounding boxes without matching
EdgeStreamGET, POST, PUT, DELETERegister and configure edge streams and their watchlist synchronization
FaceGET, POST, DELETERetrieve stored faces and their templates; search the face history by image; verify two images (1:1); run a liveness check
FrameGET, DELETERetrieve or delete full frames captured from cameras and edge streams
ImageGETDownload any stored image (face crop, frame, pedestrian, object) by its image data ID, optionally resized
PedestrianGET, DELETERetrieve pedestrian detections and their attributes
SetupGET, PUTGlobal configuration: data storage and save strategies, database cleanup, feature flags, preview colours, search-session cleanup, watchlist autolearn
TrackletGET, DELETERetrieve tracklets (one tracked person across consecutive frames)
VersionGETServer and database version
WatchlistsGET, POST, PUT, DELETECreate and manage watchlists; identify (1:N) by image or by template
WatchlistMembersGET, POST, PUT, DELETERegister and manage watchlist members and their faces; link and unlink members to watchlists

The Setup group is split in Swagger UI into SetupDataStorage, SetupDbCleanup, SetupFeatures, SetupPreview, SetupSearchSessionsCleanup and SetupWatchlistAutoLearn. The data storage and cleanup endpoints are described under Data retention.

Enrollment limits and image download​

A single POST /api/v1/WatchlistMembers/Register request accepts up to 50 images (WatchlistMemberRegistration__MaxImages=50). Images can be sent inline as Base64 or referenced by an HTTP(S) URI that the API downloads for you. Downloads are governed by the ImageDownload__* settings in .env:

SettingDefaultMeaning
ImageDownload__AllowedHosts*Comma-separated hosts the API may download from, for example images.example.com,*.cdn.com:8443. Restrict this before exposing the API.
ImageDownload__TimeoutMs10000Per-image download timeout
ImageDownload__MaxImageSizeBytes10485760Largest accepted image (10 MB)
ImageDownload__MaxParallelDownloads5Parallel downloads within one registration request

Every enrollment image passes face validation (FaceValidation__*: minimum face size 30 px, yaw, pitch and roll within ±20°, minimum quality) before a template is stored; see Enrollment image quality. For a step-by-step walkthrough of the enrollment and identification calls, continue with Enroll and identify via REST.