Developer docs

    API reference

    Every endpoint and field of the GemstoneAI Enterprise API, generated from the published OpenAPI spec.

    Base URL https://api.gemstoneaiapp.com/public/v1. Every route takes Authorization: Bearer gsk_… except /health. The machine-readable spec is at openapi.json, and Swagger lets you call each route with your sandbox key.

    Where a route answers with more than one success code (201 created, 202 accepted, 200 on a replay), the product guides list each one, along with the error codes your code should branch on.

    Health

    Liveness probe. No authentication.

    GET/health

    Liveness probe

    Always returns 200 if the public API is reachable. No auth required.

    Responses

    • 200Successful Response

    Cases

    Scan API, Intake. Store an item under your own reference (`external_id`): statement, claims and photos. Re-sending the same content changes nothing; new content adds a revision. CSV batches with a media manifest.

    POST/cases

    Create a case under your own reference

    Sending the same case again returns the stored case and changes nothing.

    Scope: cases:write

    Body application/json · CaseIn

    external_idrequiredstringYour own case, lot or listing reference.
    titlestring | null
    productstring | null
    submitted_bystring | null
    statementstring | nullThe submitter's own words, unedited.
    attachmentslist[AttachmentIn]
    claimslist[ClaimIn]

    Responses

    • 200Successful Response · CaseOut
    • 422Validation error

    GET/cases

    Read a case by your reference

    Scope: cases:read

    Parameters

    external_idrequiredstringquery

    Responses

    • 200Successful Response · CaseOut
    • 422Validation error

    DELETE/cases

    Delete a case and everything under it

    Scope: cases:write

    Parameters

    external_idrequiredstringquery

    Responses

    • 204Successful Response
    • 422Validation error

    POST/case-revisions

    Add a revision to an existing case

    Earlier revisions are kept as they were. Identical content adds no revision.

    Scope: cases:write

    Body application/json · CaseIn

    external_idrequiredstringYour own case, lot or listing reference.
    titlestring | null
    productstring | null
    submitted_bystring | null
    statementstring | nullThe submitter's own words, unedited.
    attachmentslist[AttachmentIn]
    claimslist[ClaimIn]

    Responses

    • 200Successful Response · CaseOut
    • 422Validation error

    POST/case-batches

    Import a CSV of cases with a media manifest

    Sending the same file and manifest again returns the first receipt with replayed=true. A bad row is reported in `invalid` and does not stop the other rows.

    Scope: cases:write

    Body multipart/form-data

    filerequiredfileCSV with an external_id column.
    manifeststringJSON list of {external_id, kind, source_ref, label}.Default "[]"

    Responses

    GET/case-batches/{batch_id}

    Read an import receipt

    Scope: cases:read

    Parameters

    batch_idrequiredintegerpath

    Responses

    Assessments

    Scan API. Assess one revision of a case. Text only answers 201 at once; photos answer 202 and you poll. Usage against the monthly quota and the unit ledger.

    POST/case-assessments

    Assess one revision of a case

    Scope: assessments:write

    Parameters

    Idempotency-Keystring | nullheader

    Body multipart/form-data

    external_idrequiredstring
    revisioninteger | nullRevision number; the current revision when omitted.
    imageslist[file]

    Responses

    GET/case-assessments

    List a case's assessments, newest first

    Scope: cases:read

    Parameters

    external_idrequiredstringquery

    Responses

    GET/case-assessments/{assessment_id}

    Read one assessment

    Scope: cases:read

    Parameters

    assessment_idrequiredintegerpath

    Responses

    GET/assessment-usage

    This month's completed assessments against the workspace quota

    Scope: cases:read

    Responses

    • 200Successful Response
    • 422Validation error

    GET/assessment-units

    The completed-unit ledger for one month (UTC)

    Scope: cases:read

    Parameters

    monthstring | nullquery
    formatstringqueryDefault "json"

    Responses

    • 200Successful Response
    • 422Validation error

    Review

    Intake. The review queue: assign, correct a field (writes a revision), escalate, decide on one exact revision, export the approved revision with a receipt.

    GET/review/queue

    Cases for review, most recently changed first

    Scope: cases:read

    Parameters

    statusstring | nullquery
    assigneestring | nullquery
    escalatedboolean | nullquery
    limitintegerqueryDefault 50
    offsetintegerqueryDefault 0

    Responses

    • 200Successful Response
    • 422Validation error

    GET/review/case

    One case with its evidence, reviewed assessment and audit trail

    Scope: cases:read

    Parameters

    external_idrequiredstringquery

    Responses

    • 200Successful Response
    • 422Validation error

    POST/review/assign

    Assign or unassign a case

    Scope: cases:review

    Body application/json · AssignIn

    external_idrequiredstring
    actorrequiredstringThe person acting, as your system names them.
    actor_rolestring | null
    assigneestring | nullEmpty to unassign.

    Responses

    • 200Successful Response
    • 422Validation error

    POST/review/edit

    Correct one field; writes a new revision

    Scope: cases:review

    Body application/json · EditIn

    external_idrequiredstring
    actorrequiredstringThe person acting, as your system names them.
    actor_rolestring | null
    revisionrequiredintegerThe revision the reviewer was looking at.
    fieldrequiredstring
    valuerequiredstring
    reasonrequiredstring
    handling_secondsinteger | nullTime spent on this correction; counts in the pilot ledger.

    Responses

    • 200Successful Response
    • 422Validation error

    POST/review/escalate

    Escalate a case, or clear an escalation

    Scope: cases:review

    Body application/json · EscalateIn

    external_idrequiredstring
    actorrequiredstringThe person acting, as your system names them.
    actor_rolestring | null
    reasonstring | null
    clearbooleanDefault false

    Responses

    • 200Successful Response
    • 422Validation error

    POST/review/decision

    Approve, decline, request evidence or refer one exact revision

    Scope: cases:review (approve and decline also need cases:approve)

    Body application/json · DecisionIn

    external_idrequiredstring
    actorrequiredstringThe person acting, as your system names them.
    actor_rolestring | null
    revisionrequiredinteger
    dispositionrequiredapprove | decline | request_evidence | refer
    reasonstring | null
    handling_secondsinteger | null

    Responses

    • 200Successful Response
    • 422Validation error

    POST/review/export

    Export the approved revision with a receipt

    Scope: cases:approve

    Body application/json · Actor

    external_idrequiredstring
    actorrequiredstringThe person acting, as your system names them.
    actor_rolestring | null

    Responses

    • 200Successful Response
    • 422Validation error

    Outcomes and pilot ledger

    Intake. Record what you actually did with each item, import history, set pilot terms and read per-case rows and totals.

    POST/case-outcomes

    Record one outcome event

    Scope: cases:write

    Body application/json · OutcomeIn

    event_idrequiredstringYour id for this event. Immutable.
    external_idrequiredstring
    outcome_typerequiredaction | result | cost | time
    occurred_atrequiredstring (date-time)
    actionstring | nullWhat your team did, e.g. accepted, declined, listed.
    resultstring | nullThe true result, only when known, e.g. sold, returned.
    amountnumber | null
    currencystring | null
    cost_typestring | null
    handling_secondsinteger | null
    cohortstring | nulle.g. baseline, assisted, holdout.
    sourcestring | null
    correction_ofstring | null
    notestring | null
    recorded_bystring | null

    Responses

    • 200Successful Response
    • 422Validation error

    GET/case-outcomes

    A case's outcome events, oldest first

    Scope: cases:read

    Parameters

    external_idrequiredstringquery

    Responses

    • 200Successful Response
    • 422Validation error

    POST/case-outcomes/import

    Import historical outcomes from CSV

    Each good row is stored once; a row already stored is counted as replayed. Bad rows are listed and skipped.

    Scope: cases:write

    Body multipart/form-data

    filerequiredfileCSV: event_id, external_id, outcome_type, occurred_at, action, result, amount, currency, cost_type, handling_seconds, cohort, source, correction_of, note.

    Responses

    • 200Successful Response
    • 422Validation error

    PUT/pilot-terms

    Set what one billable unit is and costs (adds a new version)

    Scope: cases:approve

    Body application/json · TermsIn

    eligiblerequiredall | assessed | reviewed | approved
    unit_pricerequirednumber
    currencystringDefault "USD"
    unit_labelstring | null
    baseline_minutesnumber | null
    notestring | null
    created_bystring | null

    Responses

    • 200Successful Response
    • 422Validation error

    GET/pilot-terms

    The current pilot terms

    Scope: cases:read

    Responses

    • 200Successful Response
    • 422Validation error

    GET/pilot-ledger

    Per-case rows and totals for the pilot

    Totals are plain sums over `rows`; `method` says how each column is derived.

    Scope: cases:read

    Parameters

    cohortstring | nullquery
    sincestring (date-time) | nullquery
    untilstring (date-time) | nullquery
    formatjson | csvqueryDefault "json"

    Responses

    • 200Successful Response
    • 422Validation error

    Listing checks

    Verify. Rules-only checks of a listing's title, description, item specifics and variants for conflicting metal, origin and treatment claims. Nothing is stored.

    POST/listing-checks

    Check one listing's claims for conflicts

    Scope: listings:check

    Body application/json · ListingIn

    listing_idstring | null
    titlestring | null
    descriptionstring | nullPlain text or HTML.
    item_specificsobject | list[object]A name -> value map, or a list of {name, value|values}.
    variantslist[VariantIn]
    variantstring | nullCheck only the variant with this sku.

    Responses

    • 200Successful Response
    • 422Validation error

    POST/listing-checks/batch

    Check up to 100 listings

    Scope: listings:check

    Body application/json · BatchIn

    listingsrequiredlist[ListingIn]

    Responses

    • 200Successful Response
    • 422Validation error

    Listing policy and reviews

    Verify. Versioned rule packs per market and category (with shadow packs), recorded listing reviews, flag actions and review metrics.

    POST/listing-reviews

    Adjudicate one listing under the rule pack in force

    Scope: listings:check (mode enforce also needs listings:review)

    Body application/json · ReviewIn

    listing_idstring | null
    titlestring | null
    descriptionstring | nullPlain text or HTML.
    item_specificsobject | list[object]A name -> value map, or a list of {name, value|values}.
    variantslist[VariantIn]
    variantstring | nullCheck only the variant with this sku.
    marketstringYour marketplace or site, e.g. ebay_us.Default "*"
    categorystringe.g. fine_jewelry, watches.Default "*"
    modeenforce | previewDefault "enforce"
    supersedesinteger | nullThe review this resubmission replaces; flags it no longer raises are marked corrected.
    actorstring | null

    Responses

    • 200Successful Response
    • 422Validation error

    GET/listing-reviews

    List reviews

    Scope: listings:review

    Parameters

    stateopen | complete | nullquery
    listing_idstring | nullquery
    limitintegerqueryDefault 50
    offsetintegerqueryDefault 0

    Responses

    • 200Successful Response
    • 422Validation error

    GET/listing-reviews/metrics

    Completion time, false prompts, incremental upheld flags, shadow disagreement

    Scope: listings:admin

    Parameters

    sincestring (date-time) | nullquery
    untilstring (date-time) | nullquery

    Responses

    • 200Successful Response
    • 422Validation error

    GET/listing-reviews/{decision_id}

    One review with its flag history

    Scope: listings:review

    Parameters

    decision_idrequiredintegerpath

    Responses

    • 200Successful Response
    • 422Validation error

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

    Dismiss, uphold or escalate one flag

    Scope: listings:review (clearing an escalation needs listings:escalations)

    Parameters

    decision_idrequiredintegerpath
    flag_idrequiredstringpath

    Body application/json · FlagActionIn

    actionrequireddismiss | uphold | escalate
    actorrequiredstring
    actor_rolestring | null
    reasonstring | null

    Responses

    • 200Successful Response
    • 422Validation error

    GET/rule-packs

    Rule pack versions

    Scope: listings:admin

    Responses

    • 200Successful Response
    • 422Validation error

    POST/rule-packs

    Publish a new rule pack version for a market and category

    Scope: listings:admin

    Body application/json · PackIn

    marketstringDefault "*"
    categorystringDefault "*"
    statusactive | shadowDefault "active"
    effective_fromstring (date-time) | nullUTC. Defaults to now; a future date schedules the pack.
    rulesobjectcode -> block | warn | escalate | off (or {action}).
    escalate_signedbooleanDefault true
    notestring | null
    created_bystring | null

    Responses

    • 201Successful Response
    • 422Validation error

    POST/rule-packs/{pack_id}/retire

    Retire a rule pack version

    Scope: listings:admin

    Parameters

    pack_idrequiredintegerpath

    Responses

    • 200Successful Response
    • 422Validation error

    Schemas

    Actor

    external_idrequiredstring
    actorrequiredstringThe person acting, as your system names them.
    actor_rolestring | null

    AssessmentOut

    idrequiredinteger
    external_idrequiredstring
    revisionrequiredinteger
    statusrequiredstring
    moderequiredstring
    photo_countrequiredinteger
    rules_versionstring | null
    resultobject | null
    error_codestring | null
    error_messagestring | null
    created_atany
    completed_atany
    attemptsintegerDefault 0
    next_attempt_atany
    sandboxbooleanDefault false
    outcomestring | null

    AssignIn

    external_idrequiredstring
    actorrequiredstringThe person acting, as your system names them.
    actor_rolestring | null
    assigneestring | nullEmpty to unassign.

    AttachmentIn

    kindrequiredphoto | document | text
    source_refrequiredstringYour URL or object key for the file.
    labelstring | null
    keystring | nullA name claims in this request can point at.

    AttachmentOut

    idrequiredinteger
    kindrequiredstring
    labelrequiredstring | null
    source_refrequiredstring

    BatchIn

    listingsrequiredlist[ListingIn]

    BatchReceipt

    batch_idrequiredinteger
    replayedrequiredboolean
    filenamerequiredstring | null
    rowsrequiredinteger
    createdrequiredinteger
    revisedrequiredinteger
    relabeledintegerDefault 0
    unchangedrequiredinteger
    invalidrequiredlist[object]
    manifest_errorsrequiredlist[object]

    CaseIn

    external_idrequiredstringYour own case, lot or listing reference.
    titlestring | null
    productstring | null
    submitted_bystring | null
    statementstring | nullThe submitter's own words, unedited.
    attachmentslist[AttachmentIn]
    claimslist[ClaimIn]

    CaseOut

    external_idrequiredstring
    productrequiredstring | null
    titlerequiredstring | null
    statusrequiredstring
    current_revisionrequiredinteger
    created_atrequiredstring (date-time)
    updated_atrequiredstring (date-time)
    revisionsrequiredlist[RevisionOut]
    decisionsrequiredlist[DecisionOut]
    outcomestring | nullOn a write: created, unchanged, relabeled (title or product only) or revised.

    ClaimIn

    fieldrequiredstring
    valuerequiredstring
    source_kindrequiredstated | seen | document | unknown | reviewerstated: someone said it. seen: visible in a photo. document: a paper says it.
    source_labelstring | nullWho said it, or where it was seen.
    attachmentstring | nullThe `key` of the attachment this claim rests on.

    ClaimOut

    fieldrequiredstring
    valuerequiredstring
    source_kindrequiredstring
    source_labelrequiredstring | null
    attachment_idrequiredinteger | null

    DecisionIn

    external_idrequiredstring
    actorrequiredstringThe person acting, as your system names them.
    actor_rolestring | null
    revisionrequiredinteger
    dispositionrequiredapprove | decline | request_evidence | refer
    reasonstring | null
    handling_secondsinteger | null

    DecisionOut

    revisionrequiredinteger | null
    dispositionrequiredstring
    reasonrequiredstring | null
    decided_byrequiredstring
    handling_secondsrequiredinteger | null
    created_atrequiredstring (date-time)

    EditIn

    external_idrequiredstring
    actorrequiredstringThe person acting, as your system names them.
    actor_rolestring | null
    revisionrequiredintegerThe revision the reviewer was looking at.
    fieldrequiredstring
    valuerequiredstring
    reasonrequiredstring
    handling_secondsinteger | nullTime spent on this correction; counts in the pilot ledger.

    EscalateIn

    external_idrequiredstring
    actorrequiredstringThe person acting, as your system names them.
    actor_rolestring | null
    reasonstring | null
    clearbooleanDefault false

    FlagActionIn

    actionrequireddismiss | uphold | escalate
    actorrequiredstring
    actor_rolestring | null
    reasonstring | null

    ListingIn

    listing_idstring | null
    titlestring | null
    descriptionstring | nullPlain text or HTML.
    item_specificsobject | list[object]A name -> value map, or a list of {name, value|values}.
    variantslist[VariantIn]
    variantstring | nullCheck only the variant with this sku.

    OutcomeIn

    event_idrequiredstringYour id for this event. Immutable.
    external_idrequiredstring
    outcome_typerequiredaction | result | cost | time
    occurred_atrequiredstring (date-time)
    actionstring | nullWhat your team did, e.g. accepted, declined, listed.
    resultstring | nullThe true result, only when known, e.g. sold, returned.
    amountnumber | null
    currencystring | null
    cost_typestring | null
    handling_secondsinteger | null
    cohortstring | nulle.g. baseline, assisted, holdout.
    sourcestring | null
    correction_ofstring | null
    notestring | null
    recorded_bystring | null

    PackIn

    marketstringDefault "*"
    categorystringDefault "*"
    statusactive | shadowDefault "active"
    effective_fromstring (date-time) | nullUTC. Defaults to now; a future date schedules the pack.
    rulesobjectcode -> block | warn | escalate | off (or {action}).
    escalate_signedbooleanDefault true
    notestring | null
    created_bystring | null

    ReviewIn

    listing_idstring | null
    titlestring | null
    descriptionstring | nullPlain text or HTML.
    item_specificsobject | list[object]A name -> value map, or a list of {name, value|values}.
    variantslist[VariantIn]
    variantstring | nullCheck only the variant with this sku.
    marketstringYour marketplace or site, e.g. ebay_us.Default "*"
    categorystringe.g. fine_jewelry, watches.Default "*"
    modeenforce | previewDefault "enforce"
    supersedesinteger | nullThe review this resubmission replaces; flags it no longer raises are marked corrected.
    actorstring | null

    RevisionOut

    numberrequiredinteger
    submitted_byrequiredstring | null
    statementrequiredstring | null
    created_atrequiredstring (date-time)
    attachmentsrequiredlist[AttachmentOut]
    claimsrequiredlist[ClaimOut]

    TermsIn

    eligiblerequiredall | assessed | reviewed | approved
    unit_pricerequirednumber
    currencystringDefault "USD"
    unit_labelstring | null
    baseline_minutesnumber | null
    notestring | null
    created_bystring | null

    VariantIn

    skustring | null
    optionsobject