Enrich

Given a model (e.g. wristwatch) and either a file from Vision (in input.file), a set of attributes, or both, Enrich returns normalized attributes plus per-field details: which values were derived and how confident the API is. When called without a file, Enrich normalizes and fills in missing attribute values based on the attributes you supply — no image required.

Simplest request — after uploading a file to Vision:

POST
/v1/enrich
{
  "model": "wristwatch",
  "input": { "file": { "fileId": "f47ac10b-58cc-4372-a567-0e02b2c3d479" } }
}

Response (200):

{
  "model": "wristwatch@0.2",
  "normalizedAttributes": {
    "assetType": "wristwatch",
    "brand": "Rolex",
    "strap": "steel",
    "dialColor": "black"
  },
  "candidates": [],
  "enriched": [
    { "attribute": "strap", "value": "steel", "confidence": 0.9, "source": "VISUAL_MATCH" }
  ],
  "confidence": 0.82,
  "warnings": []
}

Pass normalizedAttributes directly to POST /v1/valuations as attributes, or show them to the user for editing first.

When to use Enrich

Use caseApproach
You only have an imageVision → Enrich → get suggested attributes
You want to show "what we detected" before valuingEnrich → show normalizedAttributes and enriched → valuate
You want a valuation in one stepPOST /v1/valuations with input.file; server enriches internally
You have all attributes and no imageSkip Enrich; call Valuations with attributes only

Prerequisites: upload a file

Upload an image:

POST
/v1/files
{
  "imageUrl": "https://example.com/photos/watch-front.jpg"
}

Response (200):

{
  "fileId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "status": "completed",
  "objects": [{ "assetType": "wristwatch" }],
  "usage": { "creditUsed": 1 }
}

If the same image was processed before, the server returns a cached result (creditUsed: 0).

Request and response

Request body:

FieldTypeRequiredDescription
modelstringYesWhat to enrich for: "car" | "wristwatch" | "ring" for the current default version, or a pinned version such as "wristwatch@0.2" (see GET /v1/models).
inputobjectNoUnstructured evidence about the item. Required if no attributes are provided. Unknown fields return 422 (unknownField).
input.textstringNoA description of the item in your own words, up to 2000 characters, e.g. "Rolex Submariner 2019, box and papers". The API reads the model's attributes from it and lists each one in enrichment.enriched with source TEXT.
input.fileobjectNoA file to read attributes from.
input.file.fileIdstringYes*ID from POST /v1/files. *Required when input.file is set.
attributesobjectNoInitial or partial attributes. Required if no input is provided. Enrichment merges them with derived values; values you send always take precedence over what's read from input.

Response (200):

{
  "model": "wristwatch@0.2",
  "normalizedAttributes": { "..." : "..." },
  "candidates": [ "..." ],
  "enriched": [ "..." ],
  "confidence": 0.92,
  "warnings": [ "..." ]
}

Response fields explained

FieldDescription
modelThe model version that was used, e.g. "wristwatch@0.2". Even if you sent "wristwatch", this is the pinned version. Send it as model to POST /v1/valuations so the attributes are valued against the same schema they were normalized into.
normalizedAttributesMerged result of your input + enriched values, in the schema of model. Use directly as attributes in POST /v1/valuations.
enrichedAttributes that were derived (not only copied from input). Each item: attribute, value, confidence (0–1), source.
candidatesPossible values when the system is unsure. Same shape as enriched items.
confidenceOverall confidence (0–1) for the enrichment result.
warningsOptional { "code": "...", "message": "..." } items (e.g. ambiguous options, conflicts, or ATTRIBUTES_INCOMPLETE).

Enriched item shape:

{
  "attribute": "strap",
  "value": "steel",
  "confidence": 0.95,
  "source": "VISUAL_MATCH"
}

Examples by category

Wristwatch — image only

{
  "model": "wristwatch",
  "input": { "file": { "fileId": "f47ac10b-58cc-4372-a567-0e02b2c3d479" } }
}

Response (200):

{
  "model": "wristwatch@0.2",
  "normalizedAttributes": {
    "brand": "Rolex",
    "model": "Submariner",
    "strap": "steel",
    "case": "steel",
    "bezel": "steel",
    "movement": "automatic",
    "dialColor": "black",
    "caseDiameter": 41
  },
  "candidates": [
    { "attribute": "referenceNumber", "value": "116610LN", "confidence": 0.75, "source": "watch-database" }
  ],
  "enriched": [
    { "attribute": "strap", "value": "steel", "confidence": 0.9, "source": "VISUAL_MATCH" },
    { "attribute": "dialColor", "value": "black", "confidence": 0.85, "source": "VISUAL_MATCH" },
    { "attribute": "movement", "value": "automatic", "confidence": 0.7, "source": "MOST_POPULAR" }
  ],
  "confidence": 0.82,
  "warnings": [
    { "code": "AMBIGUOUS_OPTION", "message": "Multiple referenceNumber options available; send one to lock valuation range." }
  ]
}

Wristwatch — with initial attributes (brand + model)

Seeding brand and model lets enrichment narrow reference number and other fields more confidently.

{
  "model": "wristwatch",
  "attributes": {
    "brand": "Rolex",
    "model": "Submariner"
  },
  "input": { "file": { "fileId": "f47ac10b-58cc-4372-a567-0e02b2c3d479" } }
}

Response (200):

{
  "model": "wristwatch@0.2",
  "normalizedAttributes": {
    "brand": "Rolex",
    "model": "Submariner",
    "referenceNumber": "116610LN",
    "strap": "steel",
    "case": "steel",
    "bezel": "steel",
    "movement": "automatic",
    "dialColor": "black",
    "caseDiameter": 41
  },
  "candidates": [],
  "enriched": [
    { "attribute": "referenceNumber", "value": "116610LN", "confidence": 0.92, "source": "WATCH_DATABASE" },
    { "attribute": "strap", "value": "steel", "confidence": 0.95, "source": "VISUAL_MATCH" }
  ],
  "confidence": 0.91,
  "warnings": []
}

Car — license plate from image

Vision detects the plate; Enrich calls the car registry to fill brand, model, color, year, mileage.

{
  "model": "car",
  "attributes": {},
  "input": { "file": { "fileId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" } }
}

Response (200):

{
  "model": "car@0.1",
  "normalizedAttributes": {
    "licensePlate": "ABC123",
    "brand": "Volvo",
    "model": "XC60",
    "color": "black",
    "yearOfManufacture": 2020,
    "odometerReading": 52000
  },
  "candidates": [],
  "enriched": [
    { "attribute": "brand", "value": "Volvo", "confidence": 1, "source": "car-registry" },
    { "attribute": "model", "value": "XC60", "confidence": 1, "source": "car-registry" }
  ],
  "confidence": 1,
  "warnings": []
}

Ring — image + partial attributes

Providing style and material as seeds lets enrichment narrow materialPurity and condition more confidently.

{
  "model": "ring",
  "attributes": {
    "style": "solitairering",
    "material": "white gold"
  },
  "input": { "file": { "fileId": "b2c3d4e5-f6a7-8901-bcde-f12345678901" } }
}

Response (200):

{
  "model": "ring@0.1",
  "normalizedAttributes": {
    "style": "solitairering",
    "material": "white gold",
    "materialPurity": "18k",
    "engraving": false,
    "weight": 3.8,
    "condition": "very_good",
    "diamondCarat": 0.5
  },
  "candidates": [
    { "attribute": "condition", "value": "excellent", "confidence": 0.4, "source": "VISUAL_MATCH" }
  ],
  "enriched": [
    { "attribute": "materialPurity", "value": "18k", "confidence": 0.85, "source": "VISUAL_MATCH" },
    { "attribute": "weight", "value": 3.8, "confidence": 0.7, "source": "VISUAL_ESTIMATE" },
    { "attribute": "diamondCarat", "value": 0.5, "confidence": 0.72, "source": "VISUAL_ESTIMATE" }
  ],
  "confidence": 0.76,
  "warnings": [
    { "code": "AMBIGUOUS_OPTION", "message": "condition could be very_good or excellent; confirm with customer." }
  ]
}

Using Enrich with Valuations

Pattern A: Enrich first, then valuate (two calls)

Use when you want to show the user the enriched attributes and let them edit before valuing.

RESP=$(curl -s -X POST https://api.gemmai.io/v1/files \
  -H "Content-Type: application/json" \
  -d '{"imageUrl": "https://example.com/watch.jpg"}')
FILE_ID=$(echo "$RESP" | jq -r '.fileId')

Pattern B: Single valuate call (enrich inside)

Use when you want one round-trip and don't need to show enrichment details.

{
  "model": "wristwatch",
  "attributes": { "brand": "Rolex" },
  "input": { "file": { "fileId": "f47ac10b-58cc-4372-a567-0e02b2c3d479" } }
}

The server runs enrichment internally. The response contains the valuation and the attributes used after enrichment.

Attributes only (no image)

You can call Enrich without a file to normalize and fill in missing values from the attributes you supply — useful for cleaning up user input or resolving partial data before valuing.

{
  "model": "wristwatch",
  "attributes": {
    "brand": "rolex",
    "model": "submariner"
  }
}

Enrich normalizes casing, resolves common aliases, and may fill in fields it can infer confidently (e.g. movement for a well-known reference). The source on enriched fields will be MOST_POPULAR, WATCH_DATABASE, or similar — never VISUAL_MATCH when there is no image.

Warnings and confidence

  • confidence (0–1): Higher means the enriched attributes are more reliable. Low confidence often accompanies candidates or warnings.
  • AMBIGUOUS_OPTION: Multiple valid values exist for a field; sending one as attributes narrows the range.
  • CONFLICT_DERIVED: A value you sent conflicts with what was derived from the image; show both to the user for confirmation.
  • LOW_IMAGE_QUALITY: Vision could not analyze the image reliably; results may be incomplete.
  • ATTRIBUTES_INCOMPLETE: normalizedAttributes would not pass the model's schema yet, so POST /v1/valuations would return 400. The message lists the missing and invalid fields. Ask the user for them before valuing.

Error handling

400 — Missing model:

{ "error": "app", "message": "\"model\" or \"attributes.assetType\" is required, e.g. \"car\" or \"car@0.1\"", "details": null }

404 — Unknown model:

{ "error": "app", "message": "Unknown asset type: boat", "details": null }

400 — Invalid or missing file:

{ "error": "..." }

500 — Enrichment failed:

{ "error": "Enrichment failed" }

Typical causes: vision data missing for input.file, or external service unavailable.

Was this page helpful?