Skip to main content

Publish With Response

publishWithResponse submits a face image captured by an edge detector to the facial-recognition engine and synchronously returns the faces it detected — each with a face ID, detection ID, bounding box, confidence, and quality score. This is the endpoint to use when you need the detection result back in the same request (unlike the fire-and-forget publish endpoint).

Optionally, set includePerson to have each matched face returned together with its person record — name, tags, and attributes — in the same response, so you don't need a follow-up call.

The endpoint is built to answer fast: a quick face-presence check runs before anything is published (an image with no detectable face returns immediately instead of waiting on the recognition pipeline), and the whole call is bounded by a configurable timeoutMs budget (default 5 seconds) so a slow pipeline fails fast rather than hanging your integration.

API Endpoint

  • HTTP Method: POST
  • Endpoint: /api/v1/faceEdge/publishWithResponse
  • Base URL (Cloud): https://customername.econnectcloud.com/identities
  • Base URL (On-prem): https://<server-host-or-ip>:5009

Authentication

Requires a JWT bearer token in the Authorization header. See Authentication.

Minimum Permission

The permission name and category below are what you'll see in the Identities web app under System → System settings → Roles.

PermissionCategory
Face PublishingFacial Recognition Services

Assign this permission to a Role, then assign the role to your integration User.

Request Body

Content-Type: application/json. Binary fields (e.g. expanded) are sent as base64-encoded strings.

Required Fields

FieldTypeDescription
expandedbyte[] (base64)The detected face image bytes captured by the edge detector.
detectorNamestringIdentifier of the detector/source that produced the image.
ianaTimeZonestringIANA time zone of the detection (e.g. America/Los_Angeles).
detectTimeUtcstring (ISO-8601 UTC)The UTC timestamp of the detection.

Processing Options

FieldTypeDefaultDescription
largestFaceOnlyboolfalseIf true, only the largest / most prominent face is returned.
allowDoubleDetectionboolfalseIf true, disables duplicate-detection prevention. Use sparingly to avoid spam.
timeoutMsint5000Fail-fast budget in milliseconds for the entire call (face-presence check + publish). Exceeding it returns 504 Gateway Timeout. Clamped to 25030000; zero or negative values fall back to the default. See below.
Set largestFaceOnly: true for most integrations

This is the option you'll care about most. When an image contains more than one face, largestFaceOnly: true returns only the dominant subject — which is almost always what an edge detector wants (the person at the door, the customer at the counter). Leave it false only when you genuinely need every face in the frame.

Face-Presence Gate & Fail-Fast Timeout

publishWithResponse always runs a face-presence gate before anything is published:

  1. A single-pass face detection checks the submitted image.
  2. No face found → the endpoint responds immediately with 200 OK and an empty detectedFaces array, and nothing is published — the publish is gated on the photo actually containing a face, so no-face frames never enter the recognition pipeline or its storage.
  3. Face(s) found → the image is published and the call waits for the recognition result.

The whole operation — gate plus publish — runs inside the timeoutMs budget (default 5000 ms). If the pipeline cannot answer inside the budget, the call fails fast with 504 Gateway Timeout instead of blocking your integration; the detection may still complete server-side, but no result is returned for that request.

Choosing a timeoutMs

The default of 5000 ms suits interactive integrations (kiosks, door readers) that need an answer now. Raise it (up to 30000 ms) for batch-style callers that prefer completeness over latency; lower it (down to 250 ms minimum) if your integration would rather retry than wait.

Person Inclusion Options

By default the response contains only face-level detection data. Set includePerson: true to enrich every matched face (a face linked to a known person) with a person object. The individual include* switches then choose which sections of the person record to return.

FieldTypeDefaultDescription
includePersonboolfalseMaster switch. When true, matched faces include a person object.
includeNamesboolfalseInclude the person's names / aliases.
includeAddressesboolfalseInclude the person's addresses.
includeTagsboolfalseInclude the person's tags.
includeFieldsboolfalseInclude the person's entity-field attributes.
excludeDisabledTagsbooltrueWhen true (default), tags whose definition is disabled are omitted from person.personTags, so downstream systems never trigger off a disabled tag. Set false to receive disabled tags too.
Each section is permission-gated

A section is returned only when it is requested AND the caller holds at least one of the permissions below. A requested section the caller isn't permitted to see is simply omitted (no error). includePerson itself only adds person data for faces that matched a known person — unknown faces are returned with face data only.

SwitchReturnsNeeds any one of these permissions
includeNamesperson.aliasesRead All Identity, Mutate All Identity, Read Aliases
includeAddressesperson.addressesRead All Identity, Mutate All Identity, Read Addresses
includeTagsperson.personTagsRead All Identity, Mutate All Identity, Mutate Tags, Read Tags
includeFieldsperson.entityFieldsRead All Identity, Mutate All Identity, Mutate Entity Fields, Read Entity Fields

These are in addition to the Face Publishing permission required by the endpoint itself.

Code Examples

# Define variables
API_URL="https://customername.econnectcloud.com/identities"
TOKEN="your_jwt" # from POST /api/v1/authenticate
FACE_FILE="face.jpg" # the detected face image

# byte[] fields are sent as base64 strings in JSON. "expanded" is required.
EXPANDED_B64=$(base64 -w 0 "$FACE_FILE")

REQUEST=$(cat <<EOF
{
"expanded": "$EXPANDED_B64",
"detectorName": "FrontDoorCam",
"ianaTimeZone": "America/Los_Angeles",
"detectTimeUtc": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"largestFaceOnly": true,
"timeoutMs": 5000,
"includePerson": true,
"includeNames": true,
"includeTags": true,
"includeFields": true
}
EOF
)

curl -sk -X POST "$API_URL/api/v1/faceEdge/publishWithResponse" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "$REQUEST" | jq

Raw Sample

Request

POST https://customername.econnectcloud.com/identities/api/v1/faceEdge/publishWithResponse
Authorization: Bearer <your_jwt_token>
Content-Type: application/json
{
"expanded": "base64_encoded_face_image",
"detectorName": "FrontDoorCam",
"ianaTimeZone": "America/Los_Angeles",
"detectTimeUtc": "2026-06-16T18:32:05Z",
"largestFaceOnly": true,
"timeoutMs": 5000,
"includePerson": true,
"includeNames": true,
"includeTags": true,
"includeFields": true
}

Response

200 OK — a FaceEdgePublishResponse containing every detected face (an empty array if none were found). When includePerson is requested, matched faces also carry a person object (which includes its own personId), populated with the requested, permitted sections:

{
"detectedFaces": [
{
"faceId": "5f9c2b7a-3e41-4d8a-9b6c-1a2b3c4d5e6f",
"detectId": "c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f",
"confidence": 0.987,
"faceQuality": 0.912,
"boundingBox": { "x": 320, "y": 145, "width": 96, "height": 96 },
"person": {
"personId": "0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
"friendlyName": "Jane Doe",
"aliases": [
{ "firstName": "Jane", "lastName": "Doe", "middleName": null, "title": null }
],
"personTags": [
{ "tagId": "4c5d6e7f-8091-2345-6789-abcdef012345", "created": "2026-01-15T12:00:00Z", "expires": null, "tag": { "name": "VIP" } }
],
"entityFields": [
{ "name": "LoyaltyTier", "stringValue": "Gold", "dateValue": null, "numberValue": null, "boolValue": null }
]
}
}
]
}

When includePerson is omitted (the default), the person object is absent and the response is exactly the face-level shape. Unknown (unmatched) faces are always returned without a person.

Response Fields

FieldTypeDescription
detectedFaces[].faceIdstringUnique identifier of the detected face.
detectedFaces[].detectIdstringIdentifier of this detection event.
detectedFaces[].confidencefloatDetection confidence, 0.01.0.
detectedFaces[].faceQualityfloatFace quality score, 0.01.0.
detectedFaces[].boundingBoxobject{ x, y, width, height } pixel coordinates of the face.
detectedFaces[].personobjectPerson record (including personId). Present only with includePerson on a matched face; contains only the requested, permitted sections (aliases, addresses, personTags, entityFields, friendlyName).
Tag names

A person.personTags[] entry carries the tagId plus a slim tag object. To fetch full tag details (description, default expiry), use the Tag Management endpoints.

Response Codes

CodeMeaning
200 OKDetection ran; detectedFaces contains the results. Empty means the face-presence gate found no face (nothing was published).
400 Bad RequestInvalid request — for example, expanded is missing ("Face bytes are empty").
401 UnauthorizedMissing or invalid JWT.
403 ForbiddenThe user lacks the Face Publishing permission.
500 Internal Server ErrorA server-side error occurred.
504 Gateway TimeoutThe recognition pipeline did not answer within the timeoutMs budget. Safe to retry.

How includePerson Is Resolved

Notes

  • expanded is required — the call fails fast with 400 if it is empty.
  • An empty detectedFaces array comes back in well under a second — the face-presence gate short-circuits no-face images before they reach the recognition pipeline, and nothing is published for them.
  • The call is bounded by timeoutMs (default 5000 ms). A 504 means the budget was exceeded — retry, or raise the budget if your integration can tolerate the wait.
  • Set largestFaceOnly: true when you expect a single subject and want just the best face.
  • Leave allowDoubleDetection: false (the default) in production so the same face isn't processed repeatedly.
  • includePerson adds person data inline only for matched faces; unknown faces return face data only.
  • A requested include* section the caller isn't permitted to see is omitted silently — it is not an error.
  • Disabled tags are excluded from person.personTags by default (excludeDisabledTags: true) so downstream systems never trigger off a disabled tag; set excludeDisabledTags: false to receive them.
  • For high-throughput feeds where you don't need the result, use publish instead.

Advanced

eConnect edge-model fields (leave unset)

The following request fields are highly proprietary and intended for eConnect's own edge models only. Partner integrations should not set them — leave them unset and let the platform handle recognition.

FieldTypeDescription
croppedAlignedbyte[] (base64)eConnect models only. Do not set.
embeddingsfloat[]eConnect models only. Do not set.
recognitionModelstringeConnect models only. Do not set.