Reconcile standardized entity classifications

View as Markdown
Reconciles each entity's standardized classification joins to the caller's desired exact set. The server computes the delete/patch/create diff, guards every entity with the audited expectedHash, and applies each diff in its own atomic transaction with post-apply exact-set verification. apply=false (default) returns the computed plan without writing. Stale rows are reported separately from failures and are never modified.

Authentication

AuthorizationBearer

User bearer token: Supabase or Clerk session JWT, Clerk OAuth access token, or Clerk personal API key

OR
X-API-Keystring

Admin API key for system-to-system write operations

Query parameters

sourceTypeenumRequired
Write provenance source type.
sourceDetailstringRequired
Source detail or reviewer reference for the write.
sourceProviderstringOptional

Provider name for provider-native IDs or slugs.

sourceProviderIdstringOptional

Provider-native source ID.

sourceProviderSlugstringOptional

Provider-native source slug.

actorTypeenumOptional

Actor type; inferred as agent when agentChassis and agentModel are supplied, or as employee from an authenticated user JWT session.

Allowed values:
agentChassisstringOptional

Agent chassis token for agent-authored writes.

agentModelstringOptional

Agent model id for agent-authored writes.

Request

This endpoint expects an object.
entitylist of objectsRequired

Entities to reconcile; each applied independently.

applybooleanOptional

false (default) computes and returns the per-entity plan without writing; true applies each plan atomically.

Response

OK
appliedboolean

true when apply=true executed writes; false for plan-only responses.

failedlist of objects
Rows rejected or rolled back.
stalelist of objects

Rows whose expectedHash no longer matches; resultHash is current.

succeededlist of objects
Rows planned or applied successfully.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
406
Not Acceptable Error
409
Conflict Error
415
Unsupported Media Type Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error