Developer docs

    Verify

    Catch listings whose own words disagree about metal, stone origin or treatment, before they go live, with a pointer to the exact text and a proposed fix.

    Scopes: listings:check to run checks and preview reviews, listings:review to record reviews and act on flags, listings:escalations to clear an escalated flag, listings:admin for rule packs and metrics.

    Check a listing

    Send the listing as your marketplace holds it: title, description (plain text or HTML), item specifics and variants. The check runs on rules only: it uses no photos and stores nothing.

    POST/listing-checks

    curl -X POST "$GEMSTONEAI_BASE/listing-checks" \
      -H "Authorization: Bearer $GEMSTONEAI_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "listing_id": "L-1001",
        "title": "14K Solid Gold Sapphire Ring",
        "description": "Gold plated sterling silver band. Lab created sapphire.",
        "item_specifics": {"Metal": "Sterling Silver", "Main Stone Creation": "Natural"}
      }'
    Response (first of three conflicts)
    {
      "rules_version": "listing-claims-1",
      "listing_id": "L-1001",
      "checked_variants": [],
      "metal_varies_by_variant": false,
      "stone_varies_by_variant": false,
      "conflicts": [
        {
          "code": "metal_solid_vs_not_solid",
          "severity": "high",
          "field": "metal",
          "message": "Sources disagree on the metal: solid or platinum against plated, filled, vermeil or silver.",
          "evidence": [
            {
              "pointer": "title",
              "span": [
                0,
                3
              ],
              "quote": "14K",
              "reads_as": "solid_gold"
            },
            {
              "pointer": "description",
              "span": [
                0,
                11
              ],
              "quote": "Gold plated",
              "reads_as": "plated"
            }
          ],
          "proposed_correction": {
            "pointer": "title",
            "span": [
              0,
              3
            ],
            "current": "14K",
            "suggested": "Gold plated",
            "action": "replace",
            "why": "Without a stamp or test, keep the lower claim; the higher one needs proof."
          },
          "variants": null
        }
      ],
      "summary": {
        "high": 3,
        "medium": 0,
        "low": 0
      }
    }

    Read a conflict

    • code and severity (high, medium, low): what disagrees and how much it matters. summary counts them.
    • evidence: each side of the disagreement, with a pointer to where it was found (title, description, item_specifics.Metal, variants[1].options.Metal), the character span, the quote and how it reads_as.
    • proposed_correction: the text to change, the suggested wording (or null when only the seller can say), an action of replace or confirm, and why. Without proof, the lower claim is kept.
    • variants: the SKUs the conflict applies to, or null for the whole listing.

    Codes

    CodeRaised when
    metal_solid_vs_not_solidSolid gold or platinum against plated, filled, vermeil or silver.
    metal_solid_and_plated_in_one_textOne text says both solid and plated.
    metal_karat_mismatchTwo different karats.
    metal_purity_with_plated_or_filledA karat purity beside a plated or filled description.
    metal_kind_mismatchDifferent metals, such as gold against platinum.
    metal_shared_text_vs_variantShared text names a metal one variant does not have.
    stone_natural_vs_not_naturalNatural against lab-grown, simulated or moissanite.
    stone_shared_text_vs_variantShared text names a stone origin one variant does not have.
    treatment_untreated_vs_treatedUntreated against a disclosed treatment.
    treatment_composite_called_naturalA glass-filled (composite) stone called natural.
    signed_piece_reviewThe listing names a maker or house, or says signed. Escalates when escalate_signed is on.

    Variants and batches

    Each variant is checked on its own against the shared text, so a listing sold in 14k gold and in silver is not flagged for offering both; it is flagged when the shared title or description names a metal one option does not have. Identical claims across options are never flagged. Send variant with a SKU to check only that option.

    POST/listing-checks/batch

    curl -X POST "$GEMSTONEAI_BASE/listing-checks/batch" \
      -H "Authorization: Bearer $GEMSTONEAI_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "listings": [
          {
            "listing_id": "L-1001",
            "title": "14K Solid Gold Sapphire Ring",
            "item_specifics": {"Metal": "Sterling Silver"}
          },
          {
            "listing_id": "L-2002",
            "title": "Diamond Stud Earrings",
            "description": "Solid 14k gold studs.",
            "variants": [
              {"sku": "E-14K", "options": {"Metal": "14k Yellow Gold"}},
              {"sku": "E-SS", "options": {"Metal": "Sterling Silver"}}
            ]
          }
        ]
      }'

    Up to 100 listings per request.

    Rule packs

    A rule pack maps each code to block, warn, escalate or off for one market and category, from an effective date. Publishing adds a new version; earlier versions are kept. Without a pack, high severity blocks and the rest warn.

    POST/rule-packs

    curl -X POST "$GEMSTONEAI_BASE/rule-packs" \
      -H "Authorization: Bearer $GEMSTONEAI_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "market": "ebay_us",
        "category": "fine_jewelry",
        "status": "active",
        "rules": {
          "metal_solid_vs_not_solid": "block",
          "metal_karat_mismatch": "block",
          "stone_natural_vs_not_natural": "escalate",
          "metal_shared_text_vs_variant": "warn",
          "treatment_untreated_vs_treated": "warn"
        },
        "note": "Fine jewelry policy, December",
        "created_by": "policy-team"
      }'
    • market and category default to *. effective_from defaults to now; a future date schedules the pack.
    • status: shadow runs the pack beside the live one on every review without deciding anything, so you can see what a policy change would do first.
    • escalate_signed (on by default) escalates listings that name a maker or house.
    • GET /rule-packs lists versions; POST /rule-packs/{pack_id}/retire retires one.

    Listing reviews

    A review runs the check, applies the pack in force, and records the decision with the checker and pack versions it was made under, plus what the shadow pack would have done.

    POST/listing-reviews

    curl -X POST "$GEMSTONEAI_BASE/listing-reviews" \
      -H "Authorization: Bearer $GEMSTONEAI_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "listing_id": "L-1001",
        "title": "14K Solid Gold Sapphire Ring",
        "description": "Gold plated sterling silver band. Lab created sapphire.",
        "item_specifics": {"Metal": "Sterling Silver", "Main Stone Creation": "Natural"},
        "market": "ebay_us",
        "category": "fine_jewelry",
        "mode": "enforce",
        "actor": "trust-desk-4"
      }'
    Response (shortened)
    {
      "id": 311,
      "listing_id": "L-1001",
      "market": "ebay_us",
      "category": "fine_jewelry",
      "mode": "enforce",
      "rule_version": "listing-claims-1+ebay_us/fine_jewelry/v3",
      "outcome": "escalate",
      "initial_outcome": "escalate",
      "open_flags": 3,
      "flags": [
        {
          "flag_id": "f1",
          "code": "metal_solid_vs_not_solid",
          "severity": "high",
          "action": "block",
          "state": "open",
          "message": "…"
        }
      ],
      "shadow": {
        "pack_version": "ebay_us/fine_jewelry/v4",
        "outcome": "block",
        "agrees": false,
        "flags": [
          {
            "code": "metal_solid_vs_not_solid",
            "action": "block"
          }
        ]
      },
      "supersedes": null,
      "completed_at": null
    }
    • outcome is the strongest action among open and upheld flags: pass, warn, block or escalate. initial_outcome is what it was when recorded.
    • mode: preview (needs only listings:check) returns seller_messages: what to tell the seller and the fix for each flag, before they publish.
    • supersedes on a resubmission names the earlier review; flags the new version no longer raises are marked corrected.
    • GET /listing-reviews lists reviews (state open or complete, listing_id); GET /listing-reviews/{id} returns one with its flag history.

    Act on flags

    POST/listing-reviews/{decision_id}/flags/{flag_id}

    curl -X POST "$GEMSTONEAI_BASE/listing-reviews/311/flags/f1" \
      -H "Authorization: Bearer $GEMSTONEAI_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "action": "uphold",
        "actor": "trust-desk-4",
        "reason": "No stamp shown; seller confirmed plated"
      }'

    dismiss marks a false prompt, uphold confirms it, escalate sends it to a specialist. Clearing an escalated flag needs a key with listings:escalations; without it the answer is 403 escalation_scope_required. A review is complete when no flag is open.

    Metrics

    GET/listing-reviews/metrics

    curl "$GEMSTONEAI_BASE/listing-reviews/metrics?since=2026-11-01T00%3A00%3A00Z" \
      -H "Authorization: Bearer $GEMSTONEAI_KEY"

    Counted from the record, not estimated: decisions by outcome, flags raised, dismissed, upheld and corrected by the seller, the false prompt rate (dismissed over dismissed plus upheld), median and 90th percentile completion time, flags a pack raised that the baseline would not (incremental_upheld), and shadow disagreement by code.