How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Fix Kits · Kin Score · 36 check points

Fix Kit: Upsert

Give agents one safe create-or-update operation that says which branch ran. Four Kin Score checks almost nobody passes.

$149
One check · 36 points
  • Effort: A day or two: a contract change plus a response field.
  • Who needs it: of the providers each check applies to (apis.io, scored 2026-11-21, rubric 0.28.1): 98% miss “The response says which branch ran”; 97% miss “The caller declares the key to match on”; 96% miss “A named create-or-update operation”; 97% miss “Duplicate handling is stated at all”.
  • You get: the full kit (PDF and Markdown): how to find what your API really does, step-by-step fix, starter schemas, an OpenAPI Overlay that applies it across your contract, a script that checks your work exactly the way the scorer does, and docs-platform notes.

What the check measures

Agents retry, and agents sync. Without a create-or-update operation, every write needs a search-and-branch in front of it: look the record up, create it if it’s missing, update it if it isn’t. The first time an agent skips that lookup, or two agents race it, your customer’s data grows a duplicate. An upsert lets the caller say “make this record look like this, keyed on an ID I already hold” in one call. And if the response says whether it created or updated, the caller can reconcile without reading the record back.

The facet asks four questions of the OpenAPI contracts in your catalog repo. Only POST, PUT and PATCH operations are looked at, and paths ending in /read, /search, /query, /list, /export, /download, /delete, /archive, /purge, /merge, /validate, /preview, /clone, /revert, /publish (and /batch/read, /batch/archive, /batch/delete) are skipped, so a lookup endpoint that takes idProperty doesn’t count as an upsert.

Check Points What earns it
The response says which branch ran (upsert_outcome_discriminator) 14 A 2xx response schema on a write operation has a property named new, is_new, isnew, was_created, wascreated, is_created, iscreated or created_new typed boolean or string; or created, action or operation typed boolean; or outcome, result_type or recordstatus typed boolean, or string with a short enum (6 values or fewer) that includes created, create, new, inserted, insert, added or add and no read verb (get, read, list, search and so on)
The caller declares the key to match on (upsert_alternate_key) 10 A write operation has a parameter (path, query or header) or a request-body property named one of: idProperty, external_id, externalId, external_key, externalKey, match_on, lookup_field, unique_key, conflict_target, on_conflict, id_type, dedupe_key, merge_key, natural_key, alternate_key, idempotency_key, primary_key_field (case-insensitive, underscores as listed)
A named create-or-update operation (upsert_named) 8 A write operation’s path, operationId or summary contains the word upsert, or create or update, update or create, create or replace or add or update (spaces, _, - or nothing between the words)
Duplicate handling is stated at all (upsert_declared_conflict) 4 A write operation has a parameter or body property named upsert, on_conflict, duplicate_handling, skip_duplicates, allow_update, overwrite, if_exists, update_if_exists, create_if_missing, duplicate_strategy, merge_strategy, dedupe or deduplicate; or its summary or description says create-if-absent (“creates the contact if it does not exist”, “if it already exists, it is updated”); or the word upsert appears only in its description

Body properties are read up to three levels deep, through $ref, items, allOf, anyOf and oneOf. Response schemas are read on the first three 2xx responses.

The rules are in engine/upsert-surface.py and the detector it imports (upsert_scan.py), which write upsert-surface.json; signals/score.rb (upsert_has?) reads that file. The facet applies when at least one contract parses and has at least one write operation.

What doesn’t count:

  • A 200 vs 201 split. The scanner records it and the rubric pays nothing for it, because a documented 200/201 pair says nothing about which branch actually ran. Document it anyway (Step 4); just don’t expect points from it.
  • Schema names. A response schema called UpsertContactResponse on a plain create earns nothing. Only the path, operationId, summary and description are read for naming.
  • Contracts API Evangelist wrote for you (openapi/_ae-authored/). Your credit has to come from a document you publish.

The rule above is the public rubric (rubric page). The kit sells the working method: the steps, starters, overlay and check script.

What a kit does and doesn't do. A kit teaches the fix. Your score changes only when you publish the change and the public apis.io pipeline reads it, so ask for a re-check from your provider page once it's live. Buying never moves a score. Want it applied to your own contract instead? Use Ask about this on your apis.io provider page for a tailored fix plan; the kit price is credited against it.