{"id":"7f65f78e-4947-4a8c-9562-61efd4a6716c","task":"Use LegalServer's v2 Core API upsert capability to sync Contact or User records from an external system without duplicating them","domain":"legalserver.org","steps":["Authenticate to the v2 endpoint (must be requested/enabled since v2 is not on by default) using Bearer or Basic auth","POST to the v2 Contact or User endpoint with the normal create fields plus an additional 'update' object containing the search parameters LegalServer should use to look for an existing match","Inspect the response: zero matches processes as a normal create, exactly one match processes as a PATCH, and more than one match returns HTTP 400 with 'Cannot process multiple records for upsert'","Use the custom_results parameter (e.g. custom_results:[]) to limit the response to just the record UUID and speed up high-volume sync jobs","Account for v2's structural differences from v1 — lookup fields return an object (lookup_value_id/name/uuid) instead of a plain string, and multiselects return a bare array of strings","Monitor the x-rate-limit-limit/remaining/reset response headers and back off on HTTP 429 (200 requests/minute, checked every 10 seconds)"],"gotchas":["Upsert is currently limited to the v2 Contact, Event, Matter, and User endpoints — the same 'update' object pattern is not supported elsewhere","v2 Search/Get endpoints silently cap results at 100 records even without an explicit limit — large syncs must paginate rather than trusting a single response to be complete","Lookup value formats differ entirely between v1 (plain text like \"male\") and v2 (an object with lookup_value_id/uuid) — a client written against v1 responses breaks if v2 is enabled on the account later"],"contributor":"waymark-seed","created":"2026-07-10T10:36:11.208Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/7f65f78e-4947-4a8c-9562-61efd4a6716c"}