API reference
This page is the field-by-field reference for the client API. It is rendered from the OpenAPI snapshot committed in this site. The narrative guides are Authentication, Records, Graph, and the Obituary Match quickstart.
The base URL is https://client.cloudswift.app. There is no route per product. Records are under /v1/objects. Graph calls take a FactGraph under /v1/graph.
Authentication
The client API uses HTTP Bearer. Send Authorization: Bearer with an API key or a portal session token. The credential selects the tenant. On client calls, tenant_id is required and must be the tenant bound to the credential. Keys are issued out of band. Contact us to get one.
GET /v1/ontology does not require a bearer. The other routes on this page do.
Errors
Every 4xx and 5xx body is an ErrorEnvelope. Required fields are detail, error, code, and message. detail and message are the same prose. Branch on code (the same value as error). Optional fields are path, hint, and details.
Codes use four prefixes: VAL for input and ontology checks, MAT for matching, COM for commit constraints, and SYS for system failures. A body that is the wrong shape is HTTP 422. A semantic failure is HTTP 400 with a VAL code.
detailrequiredstring
Human-readable error message. Mirrors message; present for FastAPI v1 compatibility — v1 clients reading body['detail'] see the same prose as the structured message.
errorrequiredstring
Stable error-code name. Programmatic clients should branch on this, not on detail. The code catalog has four prefix buckets: VAL* (validation — bad input, ontology violations), MAT* (matcher internals — blocking / scoring failures), COM* (commit-time — DB constraint / deadlock / cardinality), SYS* (system — ontology mismatch, queue unavailable, configuration). See src/models/errors.py:ErrorCode for the enumerated catalog.
coderequiredstring
Stable error-code value (currently identical to error). Kept distinct so future error catalogs can decouple the displayed code from the symbolic name (e.g. when internationalizing displayed strings while keeping the symbolic enum stable).
messagerequiredstring
Human-readable error message (same content as detail). Suitable for surfacing in UI; consider showing the hint alongside when present.
pathobject[]
JSON path to the offending location in the request body (e.g. ['objects', 0, 'properties', 2]). Omitted when the error doesn't point at a specific request field. Mix of strings (object keys) and ints (array indices) — follows JSON Pointer-ish conventions.
hintstring
Suggestion for resolving the error — typically names the remediation in plain English ("fetch the live catalog from GET /v1/ontology/classes", "reduce expand nesting", "check the value type against the property definition"). Omitted when no specific remediation applies.
detailsobject
Structured additional context (constraint names, expected vs got values, conflicting ids). Shape varies by error code — consult the per-code documentation. Omitted when no structured context applies.
Rate limits
Rate limits apply at the API gateway. The snapshot does not publish a numeric quota for GET /v1/ontology or for the rest of the client API.
Operations
Commercial
Sign in and read the current session. API keys and portal session tokens both use HTTP Bearer. SSO authorization responds 403 while only Magic Auth is enabled.
GET /v1/commercial/whoami
Echo the commercial principal
Returns the tenant, schema, and auth method for a Magic Auth session or a commercial machine API key. Use this before the first match call to confirm which schema the session will write.
Send Authorization: Bearer with an API key or a portal session token.
Responses
200CommercialWhoami
The credential is commercial. tenant_id is what you send on writes.
firm_idrequiredstring
Same value as tenant_id. Kept so existing clients that read firm_id still work.
tenant_idrequiredstring
Commercial tenant this credential is bound to.
schemarequiredstring
Workspace binding selected by the server. Callers do not send an internal schema name.
auth_methodrequiredstring
api_key, magic_auth, or sso.
scopesrequiredstring[]
Sorted scopes. Sessions carry graph and ontology.read.
exclude_from_billingrequiredboolean
exclude_from_metricsrequiredboolean
True when this tenant must not emit CommercialMatch.
planrequiredstring
Subscription plan. standard grants the shared /v1 graph and object routes.
entitlementsrequiredstring[]
Sorted features this plan may call.
401
Missing bearer, or the session token failed verification.
403
Forbidden
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/commercial/whoami' \
-H 'Authorization: Bearer <api_key_or_session_token>'POST /v1/auth/magic-auth
Email a Magic Auth code
Asks WorkOS AuthKit to email a one-time code. The code never appears in this response. The next call is POST /v1/auth/magic-auth/verify with the email and the code. Hashed API keys are a separate machine path and are not issued here.
Send Authorization: Bearer with an API key or a portal session token.
Request body
MagicAuthStart, required.
emailrequiredstring
Address WorkOS emails the one-time Magic Auth code to.
workspace_namestring
Optional company display name, validated before a code is sent. Sending it does not create an organization. 1–80 characters, no control characters or markup. Not required for login.
Responses
200MagicAuthSent
WorkOS accepted the send. Check the inbox for the code.
statusrequiredstring
Always 'sent' when WorkOS accepted the request. The code is not included.
503
The service is temporarily unavailable.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/auth/magic-auth' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"email": "person@example.com"
}'POST /v1/auth/magic-auth/verify
Exchange a Magic Auth code for a session
Verifies the emailed code with WorkOS and returns a Cloudswift session bearer bound to the WorkOS organization's tenant. An organization pre-registered on a cs-<slug> schema stays on that schema. Send session_token as Authorization: Bearer on /v1/commercial/* . Keep refresh_token for POST /v1/auth/refresh only.
Send Authorization: Bearer with an API key or a portal session token.
Request body
MagicAuthVerify, required.
emailrequiredstring
The address the code was sent to.
coderequiredstring
The six-digit Magic Auth code from the email. Not an API key.
Responses
200SessionResponse
Code accepted. Use session_token as the bearer.
session_tokenrequiredstring
HMAC bearer for later API calls. Not a WorkOS access token.
refresh_tokenrequiredstring
WorkOS refresh token. Send only to POST /v1/auth/refresh.
expires_inrequiredinteger
Session lifetime in seconds.
token_typerequiredstring
Always Bearer.
tenant_idrequiredstring
Commercial tenant the organization maps to.
schemarequiredstring
Workspace binding selected by the server. Callers do not send an internal schema name.
organization_idrequiredstring
WorkOS organization id that selected the tenant.
auth_methodrequiredstring
magic_auth today. sso once Microsoft SSO is enabled.
emailrequiredstring
Authenticated email address.
401
The code was rejected.
503
WorkOS is not configured, or the database pool is unavailable.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/auth/magic-auth/verify' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"email": "person@example.com",
"code": "000000"
}'POST /v1/auth/refresh
Refresh a commercial session
Exchanges a WorkOS refresh token for a new Cloudswift session bearer and a new refresh token. Send the previous session bearer too, even if it has expired: its signature says whether the session was Magic Auth or SSO, and the new token keeps that method. WorkOS's authentication_method overrides it when the refresh response includes one.
Send Authorization: Bearer with an API key or a portal session token.
Request body
RefreshRequest, required.
refresh_tokenrequiredstring
WorkOS refresh token returned by verify. Not the session bearer.
Responses
200SessionResponse
New session_token and refresh_token.
session_tokenrequiredstring
HMAC bearer for later API calls. Not a WorkOS access token.
refresh_tokenrequiredstring
WorkOS refresh token. Send only to POST /v1/auth/refresh.
expires_inrequiredinteger
Session lifetime in seconds.
token_typerequiredstring
Always Bearer.
tenant_idrequiredstring
Commercial tenant the organization maps to.
schemarequiredstring
Workspace binding selected by the server. Callers do not send an internal schema name.
organization_idrequiredstring
WorkOS organization id that selected the tenant.
auth_methodrequiredstring
magic_auth today. sso once Microsoft SSO is enabled.
emailrequiredstring
Authenticated email address.
401
The refresh token was rejected.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/auth/refresh' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"refresh_token": "<refresh_token>"
}'POST /v1/auth/sso/callback
Exchange an SSO authorization code
Exchanges the code from the WorkOS redirect for a Cloudswift session, the same shape Magic Auth verify returns. This route responds 403 while only Magic Auth is enabled. Microsoft SSO uses this route without a new session format once the method is enabled.
Send Authorization: Bearer with an API key or a portal session token.
Request body
SsoCallbackRequest, required.
coderequiredstring
Authorization code WorkOS appended to the redirect URI.
Responses
200SessionResponse
SSO code accepted. Use session_token as the bearer.
session_tokenrequiredstring
HMAC bearer for later API calls. Not a WorkOS access token.
refresh_tokenrequiredstring
WorkOS refresh token. Send only to POST /v1/auth/refresh.
expires_inrequiredinteger
Session lifetime in seconds.
token_typerequiredstring
Always Bearer.
tenant_idrequiredstring
Commercial tenant the organization maps to.
schemarequiredstring
Workspace binding selected by the server. Callers do not send an internal schema name.
organization_idrequiredstring
WorkOS organization id that selected the tenant.
auth_methodrequiredstring
magic_auth today. sso once Microsoft SSO is enabled.
emailrequiredstring
Authenticated email address.
403
SSO is not enabled. Use Magic Auth.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/auth/sso/callback' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"code": "000000"
}'POST /v1/commercial/resolve
Match a small FactGraph in the caller's commercial schema
tenant_id must equal the credential's tenant. This is the prospect-facing obituary match call.
Send Authorization: Bearer with an API key or a portal session token.
Request body
ProposeRequest, required.
tenant_idrequiredstring
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
factgraphrequiredFactGraph
A complete graph of facts from a single source observation. The top-level input to the Propose API. Supports both v1.2 (implicit) and v2.0 (explicit) schema versions. - No schema_version field = v1.2 behavior (matching pipeline) - schema_version = "2.0" enables explicit object actions
schema_versionstring
v2.0: Schema version (e.g., '2.0'). Omit or null for v1.2 compatibility.
source_dataobject
v2.0: Free-form JSON preserved with FactGraph (suggested <1000 chars, not enforced)
factgraph_idstring
Client-provided ID for tracking. Used for idempotency: re-submitting a factgraph_id this tenant has already submitted returns the existing proposal_id and enqueues nothing, however long ago the first submission was. The same id under another tenant is a separate proposal. Treat as a stable correlation key, e.g. <runId>:<chunk> or a content hash.
ontology_versionrequiredstring
Caller-pinned ontology version (integer '34' or semver '7.0.0'). The Validate stage rejects with VAL002 if the pinned version dropped a class or property still referenced in this payload. Recommended pattern: pin a specific version + bump deliberately in a coordinated rollout.
default_provenanceProvenance
Data lineage information. Tracks where data came from.
source_idrequiredstring
26-char ULID of a registered source. Must exist in <schema>.sources — the Propose route pre-validates and returns 400/VAL002 on miss before the worker runs.
extraction_confidencenumber
0.0-1.0 confidence in the extraction step itself (how sure was the parser that it read the source correctly?). Distinct from each Property's confidence_score, which scores the semantic claim.
extracted_atstring (date-time)
ISO 8601 timestamp when the value was extracted from the source. Distinct from created_at (DB insert time).
acquisition_methodstring: api_call | db_query | web_scrape | file_import | manual_entry | synthetic_test
How the data was acquired. api_call for live REST/GraphQL pulls, db_query for upstream DB reads, web_scrape for HTML extraction, file_import for bulk drops, manual_entry for human input, synthetic_test for fixtures / load tests (excluded from production aggregates).
inference_reasonstring
Explanation for inferred facts (e.g., 'Sibling of Truitt who is child of Troy/Amanda implies shared parents')
evidenceEvidence[]
Zero or more Evidence snippets — the actual source bytes the claim was extracted from. The matcher doesn't read these, but audit + curation tools surface them.
thresholdsMatchingThresholds
Configurable thresholds for matching decisions.
attachnumber
Score >= attach: merge with existing
duplicate_linknumber
Score >= duplicate_link: create + potential_duplicate_of
reprocessReprocessConfig
Configuration for reprocessing a source.
modeReprocessMode
Mode for reprocessing FactGraphs.
target_source_idstring
Source to supersede/purge (required for non-NORMAL modes)
target_source_version_idstring
Specific source version to replace. Optional; null supersedes the latest version.
confirm_purgeboolean
Must be True for PURGE mode (safety check)
objectsObjectInput[]
Objects to ingest. May reference existing rows by object_id. At least one of objects or relationships must be non-empty.
object_idstring
Known object's 26-char ULID. When set, the matching pipeline is bypassed — the row is treated as a reference + targets for property attach. Mutually non-exclusive with client_temp_id (which can act as an alias).
client_temp_idstring
Caller-chosen correlation token. Required for new objects (no object_id); for known objects, acts as an alias other relationships in this FactGraph can reference.
object_classstring
Ontology class code (e.g., Person, Company, Address). Required for new objects (no object_id); optional for known references where the DB row already names the class.
namestring
Display name. Server derives name_norm + nysiis_key from this value; the matcher's name signals score against those derived columns. Required for new objects.
name_formatstring: first_last | last_first
Name format hint for Person parsing. 'last_first' for FAA-style 'SMITH JOHN' format.
statusstring: active | inactive | merged
Lifecycle state at commit time. active is the default and the only value most callers set. inactive for soft-deleted imports; merged for retroactive deduplication backfills.
propertiesProperty[]
Properties to attach to the object. For new objects, these are the initial property set; for known references, they're additive (unless replace_properties=true).
replace_propertiesboolean
If true, replaces existing properties with same names instead of adding to them.
external_recordExternalRecordInput
An ExternalSystemRecord identity: the object's id in a source system, e.g. a PracticePanther contact. Within a firm it is exact: an existing record attaches to its object with no fuzzy decision; a new one creates the object and the record together.
provenanceProvenance
Data lineage information. Tracks where data came from.
actionObjectAction
Explicit actions for FactGraph v2.0 objects. When an action is specified, the object bypasses the matching pipeline and is routed directly to the specified operation.
target_refstring
v2.0: For MERGE_INTO action - target object_id or client_temp_id to merge into
delete_propertiesstring[]
v2.0: For DELETE_PROPERTY action — list of property names (matching the ontology's property_definitions.name) to delete from the existing object.
relationshipsRelationshipInput[]
Relationships to ingest. Each edge's source_ref + target_ref resolves through this FactGraph's client_temp_id namespace first, then through existing object_ids.
edge_idstring
Known edge's 26-char ULID. When set, the matcher skips edge creation and treats this as a reference (e.g. for property attach).
client_temp_idrequiredstring
Caller-chosen correlation token for this edge. Returned on the decision report so callers can match decisions back to input edges.
actionstring: assert | retire
assert (default): create the edge, or update the current one with the same type + endpoints. retire: end the current edge — named by edge_id, or by source_ref + target_ref + relationship_type — by setting valid_to (this relationship's valid_to, or the commit date). The edge stays in history; current-state reads drop it. Use it when a source stops listing a party.
source_refrequiredstring
Source endpoint reference. Either an object_id (26-char ULID) of a known DB row, OR a client_temp_id of an object in this same FactGraph. Resolved at the Block stage.
target_refrequiredstring
Target endpoint reference. Same resolution rules as source_ref.
source_idstring
Server-resolved object_id for the source endpoint. Populated by the matcher during Block stage; callers do not set this.
target_idstring
Server-resolved object_id for the target endpoint. Populated by the matcher; not bound by callers.
relationship_typerequiredstring
Ontology relationship type (e.g., employment, headquartered_at, shareholder_of). The (source_class, target_class) pair must appear in public.allowed_pairs for this type — VAL006 on miss.
source_descriptorstring
Free-text role label for the source side. When omitted, the ontology's relationship_types.source_descriptor default applies.
target_descriptorstring
Free-text role label for the target side. Defaults from ontology when omitted.
propertiesProperty[]
Properties attached to this edge — additive unless replace_properties=true.
replace_propertiesboolean
If true, replaces existing properties with same names instead of adding to them.
valid_fromstring (date)
Inclusive start of validity interval. Null = open-ended past.
valid_tostring (date)
Exclusive end of the validity interval: the first day it no longer holds. Null = currently active.
confidence_scorenumber
0.0-1.0 confidence in the edge existing. Null = unspecified.
statusstring: active | inactive
Initial edge status at commit time. active is the default; inactive is for retroactive soft-delete imports.
provenanceProvenance
Data lineage information. Tracks where data came from.
source_idstring
Optional source identifier — pinned in the SQS pointer so the worker can resolve source-class config overrides.
schemastring
Workspace binding selected by the server. Callers do not send an internal schema name.
Responses
200DecisionReport
Committed. The body is the decision report (attach, create, or needs_review).
proposal_idrequiredstring
ULID echoed back from the POST request.
tenant_idrequiredstring
Tenant slug from the POST request.
submitted_atrequiredstring
ISO 8601 timestamp of the POST. String, not datetime, so the worker's exact wire format (Z-suffixed UTC) round-trips.
processed_atrequiredstring
ISO 8601 timestamp the worker finished (or failed) processing. String for the same reason as submitted_at. Subtract submitted_at to get end-to-end latency.
statusrequiredstring: completed | failed
Pipeline outcome. completed means every object reached Commit; failed means a stage raised before Commit. Determines which optional fields are populated.
objectsDecisionObject[]
Per-object decisions when status='completed'. Empty (or omitted) on status='failed'.
ref_idrequiredstring
Caller-supplied client_temp_id for the object — the key that ties this decision back to the input FactGraph.
decisionrequiredstring
Decision outcome. One of create (no confident match, new object minted), attach (matched + merged into existing), reference (known object skipped from matching), pending (high-scoring candidate below attach threshold — needs human review), and the v2 passthrough actions update_property / delete_property / deprecate / merge_into.
final_object_idstring
ULID of the resulting graph object (the newly created one for create; the matched/target object for attach / reference / merge_into). Omitted when no object was produced (e.g. pending review).
audit_idstring
ULID of the audit row written for this decision. Use to look up the full Match → Decide audit trail.
properties_addedinteger
Number of properties added during Commit. Includes both newly-bound properties on a create and merged properties on an attach.
properties_updatedinteger
Number of values already on the object whose valid_from / valid_to this proposal changed, e.g. an attach that re-proposes a prior name with the date it stopped being used.
needs_reviewboolean
True when the decision needs human review (pending outcome OR create with a potential_duplicate_of hint). Curation tools surface these via GET /v1/objects?needs_review=true.
reasonstring
Human-readable explanation. For attach/pending outcomes, names the matched-on signals + confidence; for create outcomes, typically omitted.
potential_duplicate_ofstring
ULID of an existing object the matcher flagged as a near-but-failing duplicate (set when a create happens with a high-scoring top candidate that didn't clear all gates).
candidatesobject[]
Every object the matcher scored, best first, each with its object_id, score and signals. Populated only for pending, needs_review or potential_duplicate_of decisions; empty otherwise.
object_countinteger
Length of objects. Always present so callers can branch without instantiating the list.
relationshipsDecisionRelationship[]
Per-relationship outcomes when status='completed', in FactGraph order.
client_temp_idrequiredstring
The relationship's client_temp_id.
relationship_typerequiredstring
The edge type proposed.
outcomerequiredstring: created | deduped | updated | retired | not_found
created — a new edge. deduped — matched a current edge, nothing changed. updated — matched a current edge and changed it. retired — action: retire set valid_to. not_found — action: retire named no current edge in your tenant.
edge_idstring
The edge written or matched; null for not_found.
changesobject[]
{field, old, new} per change on updated / retired, e.g. valid_to or properties.employment.job_title.
relationship_countinteger
Length of relationships.
errorFailureDetail
Error block written by the worker when processing fails.
typerequiredstring
Python exception class name. Common values: ValidationError (Validate stage), MatchingError (Block / Match), CommitError (DB constraint), SystemError (config / queue).
messagerequiredstring
Truncated exception message (max 1000 chars at write time). Includes any JSON-path or hint the validator produced; the full structured envelope is on the audit trail.
codestring
Stable error code (VAL017, MAT001, …; see the errors guide) when the stage raised a pipeline error. Branch on this, not on message. Absent for unexpected exceptions.
pathstring[]
JSON path to the offending field, when known.
hintstring
How to fix it, when known.
detailsobject
Structured context for the error, when any.
400
A VAL* pipeline error. Nothing was written.
401
Missing or invalid session or API key.
403
The credential is not commercial, or it lacks the graph scope.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/commercial/resolve' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"factgraph": {
"ontology_version": "<ontology_version>",
"objects": [
{
"client_temp_id": "<client_temp_id>",
"object_class": "<object_class>",
"name": "<name>",
"target_ref": "<target_ref>"
}
],
"relationships": [
{
"client_temp_id": "<client_temp_id>",
"source_ref": "<source_ref>",
"target_ref": "<target_ref>",
"relationship_type": "<relationship_type>"
}
]
}
}'Sources
Register and look up sources cited by evidence.
GET /v1/sources
List sources
List registered sources. Supports both legacy offset pagination (skip + limit) and keyset after pagination — pass next_cursor from the previous response as after to resume. Filter by source_type to narrow to one of the eight enum values (api, web, file, database, manual, test, other, common_knowledge).
Send Authorization: Bearer with an API key or a portal session token.
Parameters
tenant_idrequiredquery · string
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
source_typequery · string
limitquery · integer
offsetquery · integer
afterquery · string
Keyset cursor — source_id value after which to resume. Pass next_cursor from the previous page's response. When set, offset is ignored. v2 callers exporting full datasets should use this rather than offset — it's O(log N) per page vs offset's O(N) scan cost.
Responses
200SourceList
Page of sources. next_cursor is non-null when more pages exist; pass it back as after to resume.
itemsrequiredSource[]
Page of Source rows in source_id ascending order. May be shorter than limit if fewer rows remain.
source_idrequiredstring
26-char ULID.
tenant_idstring
26-char ULID for the owning firm, or '0' * 26 for schema-wide sources.
namerequiredstring
Human-readable name shown in dashboards + provenance explanations. Convention is <Issuing Authority> <Source Type> — e.g. "CT Business Registry", "USPS ZIP+4 Lookup", "Internal CRM".
source_typerequiredstring: database | api | web | file | manual | test
Coarse classification of the source's medium. Drives the matcher's conflict-resolution tie-breaker (database > api > web > file > manual when authority levels tie). common_knowledge is for facts so well-established that no provenance is needed; test is for fixtures; other is the escape hatch — prefer a specific value.
authority_levelrequiredinteger
0-100 trust score. The matcher uses this when two sources disagree on a value: higher wins, with source_type breaking ties. Conventions: 90-100 = authoritative (government registries, regulator filings); 70-89 = high-confidence aggregator (Dun & Bradstreet, ZoomInfo); 40-69 = general database / API; 10-39 = web scrape, social media; 0-9 = unverified user input.
descriptionstring
Long-form description: what the source covers, refresh cadence, known limitations.
uristring
Machine-readable endpoint where evidence can be re-fetched (a JDBC URL, REST endpoint, S3 prefix). Distinct from source_url which is a human-browser URL.
external_refstring
Caller-defined identifier from the upstream system (vendor batch id, internal ticket number, source-of-truth ULID). Lets curators trace a source back to a specific delivery / contract / ingest run.
labelsstring[]
Free-form tags. Convention is dash-cased ASCII keywords for grouping in dashboards (state-filing, weekly, us-ct). Order is preserved but not semantically meaningful; treat as a set.
owner_teamstring
Team accountable for the source: who to ping when it stops refreshing or starts emitting bad data.
source_notestring
Surface in tooltips, not in matcher logic.
source_urlstring
Human-browser landing page for the source. Distinct from uri (machine endpoint) — both can be set.
created_atrequiredstring (date-time)
Server-set on insert (DEFAULT now()). Never bound by the caller; ignored if supplied on POST.
updated_atrequiredstring (date-time)
Server-set on insert + every update. Currently identical to created_at because sources are immutable on the API — no PATCH/DELETE — but reserved for future use.
limitrequiredinteger
The limit echoed from the request — what the caller asked for, not the number returned. Use items.length() for the actual page size.
offsetrequiredinteger
Echo of the offset value used. 0 when keyset pagination (after) was used instead.
next_cursorstring
Pass back as after on the next request to resume after the last item in this page. Null when fewer than limit items remain (end of dataset).
totalinteger
Total row count when computed; null when the caller has not requested it (default — count(*) on the large tables is expensive).
401
Auth missing or invalid.
403
Auth valid but caller lacks graph scope (Client API).
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/sources?tenant_id=<tenant_id>' \
-H 'Authorization: Bearer <api_key_or_session_token>'POST /v1/sources
Register a new source
Register a source the matcher + provenance layer can later cite as evidence for facts. Sources are immutable once written — there is no PATCH or DELETE; superseding a source means writing a new row and migrating references at the property/evidence layer. On the Client API: tenant_id is required and must match the caller's firm (enforced server-side). Choose source_type from {api, web, file, database, manual, test, other, common_knowledge}. authority_level is a 0-100 score the matcher uses when resolving conflicting claims (higher = more trusted).
Send Authorization: Bearer with an API key or a portal session token.
Request body
SourceCreate, required.
tenant_idrequiredstring
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
namerequiredstring
Human-readable name (1-255 chars). See Source.name for the naming convention. Required.
source_typerequiredstring: database | api | web | file | manual | test
Coarse classification of the source. See Source.source_type for the enum's matcher-tie-breaker role.
authority_levelrequiredinteger
0-100 trust score. See Source.authority_level for the convention bands (90-100 authoritative, 70-89 aggregator, etc.).
descriptionstring
uristring
Machine-readable endpoint (JDBC URL, REST endpoint, S3 prefix).
external_refstring
Upstream-system identifier (vendor batch id, internal ticket).
labelsstring[]
Dash-cased ASCII tags. Treated as a set; order preserved.
owner_teamstring
Team accountable for the source.
source_notestring
source_urlstring
Human-browser landing page (distinct from machine uri).
Responses
201Source
Source created. Body carries the assigned ULID + server-stamped timestamps.
source_idrequiredstring
26-char ULID.
tenant_idstring
26-char ULID for the owning firm, or '0' * 26 for schema-wide sources.
namerequiredstring
Human-readable name shown in dashboards + provenance explanations. Convention is <Issuing Authority> <Source Type> — e.g. "CT Business Registry", "USPS ZIP+4 Lookup", "Internal CRM".
source_typerequiredstring: database | api | web | file | manual | test
Coarse classification of the source's medium. Drives the matcher's conflict-resolution tie-breaker (database > api > web > file > manual when authority levels tie). common_knowledge is for facts so well-established that no provenance is needed; test is for fixtures; other is the escape hatch — prefer a specific value.
authority_levelrequiredinteger
0-100 trust score. The matcher uses this when two sources disagree on a value: higher wins, with source_type breaking ties. Conventions: 90-100 = authoritative (government registries, regulator filings); 70-89 = high-confidence aggregator (Dun & Bradstreet, ZoomInfo); 40-69 = general database / API; 10-39 = web scrape, social media; 0-9 = unverified user input.
descriptionstring
Long-form description: what the source covers, refresh cadence, known limitations.
uristring
Machine-readable endpoint where evidence can be re-fetched (a JDBC URL, REST endpoint, S3 prefix). Distinct from source_url which is a human-browser URL.
external_refstring
Caller-defined identifier from the upstream system (vendor batch id, internal ticket number, source-of-truth ULID). Lets curators trace a source back to a specific delivery / contract / ingest run.
labelsstring[]
Free-form tags. Convention is dash-cased ASCII keywords for grouping in dashboards (state-filing, weekly, us-ct). Order is preserved but not semantically meaningful; treat as a set.
owner_teamstring
Team accountable for the source: who to ping when it stops refreshing or starts emitting bad data.
source_notestring
Surface in tooltips, not in matcher logic.
source_urlstring
Human-browser landing page for the source. Distinct from uri (machine endpoint) — both can be set.
created_atrequiredstring (date-time)
Server-set on insert (DEFAULT now()). Never bound by the caller; ignored if supplied on POST.
updated_atrequiredstring (date-time)
Server-set on insert + every update. Currently identical to created_at because sources are immutable on the API — no PATCH/DELETE — but reserved for future use.
400
Bad Request
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm is a 404, like an unknown id.
422
Body-shape failure: missing required field, type mismatch, string-length / numeric-range violation. The Pydantic-side validators fire before the route body so semantic 400s never overlap with these.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/sources' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"name": "<name>",
"source_type": "database",
"authority_level": 1
}'GET /v1/sources/{source_id}
Get a source by id
Fetch a single source by ULID. On the Client API, returns 404 if the source belongs to a different tenant — even if the ULID exists in another firm's slice, the cross-tenant lookup is masked so the caller can't probe for existence.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
source_idrequiredpath · string
ULID of the source row.
tenant_idrequiredquery · string
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
Responses
200Source
The source row.
source_idrequiredstring
26-char ULID.
tenant_idstring
26-char ULID for the owning firm, or '0' * 26 for schema-wide sources.
namerequiredstring
Human-readable name shown in dashboards + provenance explanations. Convention is <Issuing Authority> <Source Type> — e.g. "CT Business Registry", "USPS ZIP+4 Lookup", "Internal CRM".
source_typerequiredstring: database | api | web | file | manual | test
Coarse classification of the source's medium. Drives the matcher's conflict-resolution tie-breaker (database > api > web > file > manual when authority levels tie). common_knowledge is for facts so well-established that no provenance is needed; test is for fixtures; other is the escape hatch — prefer a specific value.
authority_levelrequiredinteger
0-100 trust score. The matcher uses this when two sources disagree on a value: higher wins, with source_type breaking ties. Conventions: 90-100 = authoritative (government registries, regulator filings); 70-89 = high-confidence aggregator (Dun & Bradstreet, ZoomInfo); 40-69 = general database / API; 10-39 = web scrape, social media; 0-9 = unverified user input.
descriptionstring
Long-form description: what the source covers, refresh cadence, known limitations.
uristring
Machine-readable endpoint where evidence can be re-fetched (a JDBC URL, REST endpoint, S3 prefix). Distinct from source_url which is a human-browser URL.
external_refstring
Caller-defined identifier from the upstream system (vendor batch id, internal ticket number, source-of-truth ULID). Lets curators trace a source back to a specific delivery / contract / ingest run.
labelsstring[]
Free-form tags. Convention is dash-cased ASCII keywords for grouping in dashboards (state-filing, weekly, us-ct). Order is preserved but not semantically meaningful; treat as a set.
owner_teamstring
Team accountable for the source: who to ping when it stops refreshing or starts emitting bad data.
source_notestring
Surface in tooltips, not in matcher logic.
source_urlstring
Human-browser landing page for the source. Distinct from uri (machine endpoint) — both can be set.
created_atrequiredstring (date-time)
Server-set on insert (DEFAULT now()). Never bound by the caller; ignored if supplied on POST.
updated_atrequiredstring (date-time)
Server-set on insert + every update. Currently identical to created_at because sources are immutable on the API — no PATCH/DELETE — but reserved for future use.
401
Auth missing or invalid.
403
Auth valid but caller lacks graph scope (Client API).
404
No source with that id in the caller's tenant scope. The body doesn't distinguish 'doesn't exist' from 'wrong tenant' on purpose.
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/sources/{source_id}?tenant_id=<tenant_id>' \
-H 'Authorization: Bearer <api_key_or_session_token>'Ontology
Read the catalog of classes, properties, and relationship types.
GET /v1/ontology/classes
List every object class in the live ontology
Enumerate the ontology's object classes (Person, Company, Address, Vehicle, Contract, ...). The response is the full catalog — not paginated — because the list is small and every entry is needed for client-side validation. Each OntologyClass carries the numeric class_id (the foreign key used inside the DB), the string class_code (the value clients send in Object.class_code / ExpandSpec.target_class / etc.), and a human-readable description. Changes ship as DBA-applied migrations under migrations/, not via API. Recommended client pattern: fetch this list at startup, cache it for the process lifetime, refresh on a deliberate version-pin bump. The integrator guide has the rollout recipe.
Send Authorization: Bearer with an API key or a portal session token.
Responses
200OntologyClass[]
Live ontology — array of OntologyClass. Cache it client-side; the contents change rarely and only via deliberate migrations.
class_idrequiredinteger
Stable SMALLINT primary key.
class_coderequiredstring
String key (e.g. 'Person', 'Vehicle').
descriptionstring
Human-readable description.
401
Auth missing or invalid.
403
Missing graph scope (Client API).
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/ontology/classes' \
-H 'Authorization: Bearer <api_key_or_session_token>'GET /v1/ontology/relationship-types
List every relationship type the matcher accepts
Enumerate the ontology's relationship types (headquartered_at, employment, shareholder_of, geographic_containment, ...). Returned as a flat list — the matcher's allowed_pairs constraint (which (source_class, target_class) tuples each type can connect) is enforced internally; this endpoint does not currently surface those pairs. Each entry carries the relationship_type key (the value clients send on Relationship.relationship_type / ExpandSpec.relationship_type), directional descriptors (source_descriptor = what the source object is *to* the target; target_descriptor = vice versa — e.g. employment is "employer" / "employee"), is_symmetric (when true, direction is informational only — the matcher treats either ordering as identical), per-side *_cardinality (one / many / null), and the matcher's tier. Disallowed (rel_type, src_class, tgt_class) triples rejection happens at write time with HTTP 422 + code=VAL006 — there is no preflight endpoint for the pair check today; if you need it, fetch this list + the classes list and check pair coverage client-side.
Send Authorization: Bearer with an API key or a portal session token.
Responses
200OntologyRelationshipType[]
Live ontology — array of OntologyRelationshipType. Cache client-side; use it to drive form pickers + client-side validation before submission.
relationship_typerequiredstring
Edge-type identifier. Stable string used in Relationship.relationship_type on writes and ExpandSpec.relationship_type on /graph/query.
source_descriptorrequiredstring
Free-text role label for the source side — what the source object is *to* the target (e.g. "employer").
target_descriptorrequiredstring
Free-text role label for the target side — what the target object is *to* the source (e.g. "employee").
is_symmetricboolean
True when direction is informational only — the matcher treats either ordering as identical (e.g. colleague_of). False for directional types (employment, headquartered_at). Null = DB default (false).
source_cardinalitystring
'1' (single-cardinality) or '*' (many) on the source side. Writes that violate single-cardinality return COM004.
target_cardinalitystring
'1' or '*' on the target side. Same semantics as source_cardinality.
tierstring
Matcher tier classification — identity (high-confidence signals like SSN), vital (load-bearing relationship type), or supporting (low-weight signal). Drives how much weight a relationship leg gets in cross-schema match scoring.
401
Auth missing or invalid.
403
Missing graph scope (Client API).
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/ontology/relationship-types' \
-H 'Authorization: Bearer <api_key_or_session_token>'GET /v1/ontology
Full ontology snapshot (no auth, lc-only)
The endpoint is public — no bearer required. Rate limits apply at API Gateway. The ontology is uniform across all firms; no tenant data is leaked. Version semantics: ISO8601 timestamp of the most recent updated_at across property_definitions, relationship_types, class_properties, and relationship_properties. Increases monotonically as the ontology evolves via cloudswift-api migrations. Additive changes (new class, new property, new relationship type) are safe.
No bearer is required.
Responses
200OntologySnapshot
Live ontology snapshot. Consumers cache by version; refresh on a cadence.
versionrequiredstring
Stable snapshot version — ISO8601 timestamp of the most recent update across property_definitions + relationship_types + class_properties + relationship_properties in the lc schema. Increases monotonically as the ontology evolves. Consumers pin against this string.
generated_atrequiredstring (date-time)
Server timestamp when the response was assembled.
classesrequiredOntologyClass[]
All object classes.
class_idrequiredinteger
Stable SMALLINT primary key.
class_coderequiredstring
String key (e.g. 'Person', 'Vehicle').
descriptionstring
Human-readable description.
property_definitionsrequiredOntologyPropertyDefinition[]
All property definitions.
property_idrequiredstring
Namespaced identifier (e.g. 'person.email').
display_namerequiredstring
Human-readable label.
descriptionrequiredstring
Property purpose.
data_typerequiredstring
Value type (StringPropertyBaseType, etc.).
cardinalityrequiredstring
'single' or 'multi'.
is_required_defaultrequiredboolean
Whether writes MUST supply a value for this property by default.
is_deterministicrequiredboolean
Property values are compared byte-identically for matching purposes.
is_state_carryingrequiredboolean
True when the property's value transitions trigger Phase 2 cascade events (state changes with downstream reactions). False for value-carrying properties (phone numbers, etc.).
namespacerequiredstring
Namespace prefix (e.g. 'external_system').
class_propertiesrequiredOntologyClassPropertyLink[]
Attachment records linking property definitions to object classes.
class_idrequiredinteger
Numeric object-class identifier the property attaches to.
property_idrequiredstring
Namespaced property identifier being attached.
is_requiredrequiredboolean
Whether the class requires this property to be set.
display_orderinteger
Ordering hint for UIs rendering the property list; NULL = unspecified.
relationship_typesrequiredOntologyRelationshipType[]
All relationship types.
relationship_typerequiredstring
Edge-type identifier. Stable string used in Relationship.relationship_type on writes and ExpandSpec.relationship_type on /graph/query.
source_descriptorrequiredstring
Free-text role label for the source side — what the source object is *to* the target (e.g. "employer").
target_descriptorrequiredstring
Free-text role label for the target side — what the target object is *to* the source (e.g. "employee").
is_symmetricboolean
True when direction is informational only — the matcher treats either ordering as identical (e.g. colleague_of). False for directional types (employment, headquartered_at). Null = DB default (false).
source_cardinalitystring
'1' (single-cardinality) or '*' (many) on the source side. Writes that violate single-cardinality return COM004.
target_cardinalitystring
'1' or '*' on the target side. Same semantics as source_cardinality.
tierstring
Matcher tier classification — identity (high-confidence signals like SSN), vital (load-bearing relationship type), or supporting (low-weight signal). Drives how much weight a relationship leg gets in cross-schema match scoring.
relationship_type_allowed_pairsrequiredOntologyRelationshipTypeAllowedPair[]
Allowed (source_class, target_class) pairs per relationship_type. Writes violating these return 422 with code VAL006.
relationship_typerequiredstring
Edge-type identifier this pair permits.
source_class_idrequiredinteger
Numeric class_id of the allowed source object.
target_class_idrequiredinteger
Numeric class_id of the allowed target object.
descriptionstring
Free-form explanation of the pair's semantic meaning.
relationship_propertiesOntologyRelationshipProperty[]
Edge properties declared per relationship_type, with their data types. Build include_edge_properties lists and check an edge property before writing against these.
relationship_typerequiredstring
Relationship type the property belongs to.
property_idrequiredstring
Edge-property name, e.g. employment.job_title.
data_typestring
Declared prop_type, e.g. StringPropertyBaseType; null = any.
is_requiredboolean
Declared required. Not enforced on write today.
display_orderinteger
Suggested display order.
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/ontology'Objects
Create, read, update, and delete entities, and attach properties.
GET /v1/objects
List objects
Paginated listing of objects. Supports both offset (skip+limit) and keyset (after) pagination — pass next_cursor from the previous response as after to resume. The keyset path uses the (tenant_id, status, object_id) index so it stays fast even on multi-million-row tenants. Filter by object_class (the ontology code, e.g. Person, Company, Address) to narrow to a single entity type. Result rows are ObjectSummary shape — primary key + name + status + timestamps. Use GET /v1/objects/{object_id} for the full detail view including properties and relationships.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
tenant_idrequiredquery · string
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
class_codequery · string
searchquery · string
statusquery · string
limitquery · integer
offsetquery · integer
afterquery · string
Keyset cursor — object_id value after which to resume. Pass next_cursor from the previous page's response. When set, offset is ignored. v2 callers exporting full datasets should use this rather than offset — it's O(log N) per page vs offset's O(N) scan cost.
Responses
200ObjectList
Page of objects. next_cursor is non-null when more pages exist; pass it back as after to resume.
itemsrequiredObjectSummary[]
Page of ObjectSummary rows in object_id ascending order. Length may be shorter than limit at end of dataset.
object_idrequiredstring
Object's 26-character Crockford-base32 ULID. Server-minted on creation; immutable; the durable handle for all follow-up calls.
class_coderequiredstring
Object class string (Person, Company, Address, ...). Resolved server-side from the DB's smallint FK via JOIN to public.object_classes. Immutable on an existing row — changing class requires DELETE + INSERT.
namerequiredstring
Display name. The server-derived name_norm and nysiis_key columns (used for matching + search) are computed from this value; updating it via PATCH recomputes both.
statusrequiredstring
Lifecycle state. active (default) means the row is in use; inactive is soft-deleted (matcher skips it, but history is preserved); merged indicates the matcher collapsed two duplicates and this row's history points to the survivor.
needs_reviewboolean
Set by the matcher when the row passed a pending decision in the Propose pipeline (high-scoring candidate below the attach threshold). Curation tools surface these rows for human review.
created_atrequiredstring (date-time)
Server-set on insert (DEFAULT now()). Never bound by the caller.
updated_atrequiredstring (date-time)
Server-set on insert + on every successful PATCH. Use this to detect changes since a prior snapshot.
origin_source_idstring
The source that created this object (Client API only). A property whose source_id is null has this source.
limitrequiredinteger
Echo of the limit query parameter used.
offsetrequiredinteger
Echo of the offset used. 0 when keyset pagination (after) was used instead.
next_cursorstring
Pass back as after on the next request to resume after the last item in this page. Null when fewer than limit items remain (end of dataset).
401
Auth missing or invalid.
403
Auth valid but caller lacks graph scope (Client API).
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/objects?tenant_id=<tenant_id>' \
-H 'Authorization: Bearer <api_key_or_session_token>'POST /v1/objects
Create an object (direct write, no matcher)
Trust-mode direct create. No matcher, no Propose pipeline. The caller's row lands as-is. A row with no key (empty, stoplisted or low confidence) is created as before, and a non-US one is created with its key and never reused. Where the flag is off there is no lookup: the same address written twice is two rows, as it always was. Every other class is never looked up. Pre-flight check: the supplied class_code is resolved against public.object_classes synchronously. Unknown codes return 400 — fetch the catalog from GET /v1/ontology/classes to discover what's legal at the current ontology version. Server-side computed: name_norm (canonical-cased name) and nysiis_key (phonetic) are derived on insert; the caller doesn't supply them. For class_code='Person' the per-component NYSIIS triple (first/middle/last) is also populated so matching downstream can use it.
Send Authorization: Bearer with an API key or a portal session token.
Request body
ObjectCreate, required.
tenant_idrequiredstring
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
class_coderequiredstring
Object class — must exist in the ontology (GET /v1/ontology/classes). Immutable after creation.
namerequiredstring
Display name. Server derives name_norm and nysiis_key from this value.
allow_duplicate_addressboolean
Skips the Address lookup and creates a new object with no identity key. Ignored for other classes, and when address resolution is off on this system.
statusstring
Initial lifecycle state. Defaults to active; supply inactive only for retroactive soft-delete imports.
origin_source_idstring
The source creating this object (Client API only): one of the firm's sources or the shared list (GET /v1/sources). Its properties without a source_id take this source, and a property whose source_id equals it is stored without one.
name_formatstring: first_last | last_first
Parsing hint for Person rows — tells downstream consumers whether name is in first_last ("Jane Doe") or last_first ("Doe, Jane") order. Reserved for downstream consumers; the route layer doesn't split.
Responses
201ObjectCreateResult
Object created, or, for an Address where the address flag is on and an active one already holds the key, that object (reused: true; the status is 201 either way). Body is the ObjectCreateResult (the ObjectSummary fields plus class_code and reused); fetch the detail view via GET /v1/objects/{id} to see what landed including derived fields.
object_idrequiredstring
Object's 26-character Crockford-base32 ULID. Server-minted on creation; immutable; the durable handle for all follow-up calls.
class_coderequiredstring
Object class string (Person, Company, Address, ...). Resolved server-side from the DB's smallint FK via JOIN to public.object_classes. Immutable on an existing row — changing class requires DELETE + INSERT.
namerequiredstring
Display name. The server-derived name_norm and nysiis_key columns (used for matching + search) are computed from this value; updating it via PATCH recomputes both.
statusrequiredstring
Lifecycle state. active (default) means the row is in use; inactive is soft-deleted (matcher skips it, but history is preserved); merged indicates the matcher collapsed two duplicates and this row's history points to the survivor.
needs_reviewboolean
Set by the matcher when the row passed a pending decision in the Propose pipeline (high-scoring candidate below the attach threshold). Curation tools surface these rows for human review.
created_atrequiredstring (date-time)
Server-set on insert (DEFAULT now()). Never bound by the caller.
updated_atrequiredstring (date-time)
Server-set on insert + on every successful PATCH. Use this to detect changes since a prior snapshot.
origin_source_idstring
The source that created this object (Client API only). A property whose source_id is null has this source.
reusedboolean
True when this Address matched an existing active Address by identity key, so the fields above are that object's and nothing new was created. The status is 201 either way.
400
Semantic validation failure — most commonly class_code not in public.object_classes. The error body's hint field points to /v1/ontology/classes for the catalog.
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm is a 404, like an unknown id.
422
Body-shape failure: missing required field, type mismatch, or constraint violation (ULID format, status enum, name length).
503
(Address flag on.) Another writer is changing that address, or the object it matched was removed while this request ran. Retry shortly.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/objects' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"class_code": "<class_code>",
"name": "<name>"
}'GET /v1/objects/{object_id}
Get object detail
Fetch a single object with its properties and relationships joined in. This is the canonical 'show me everything about entity X' endpoint — use it after a search/list to drill into one row. Properties come back as ObjectProperty[] and relationships as ObjectRelationship[] (with the peer object's id + descriptor + relationship_type). Cross-tenant lookups on the Client API are masked as 404 — the body doesn't distinguish 'doesn't exist' from 'wrong tenant' on purpose.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
object_idrequiredpath · string
ULID of the object row.
tenant_idrequiredquery · string
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
Responses
200ObjectDetail
Object + properties + relationships. The relationships array is bounded — extremely high-degree objects (>1k edges) are truncated; iterate via the graph-query endpoints for those.
object_idrequiredstring
Object's 26-character Crockford-base32 ULID. Server-minted on creation; immutable; the durable handle for all follow-up calls.
class_coderequiredstring
Object class string (Person, Company, Address, ...). Resolved server-side from the DB's smallint FK via JOIN to public.object_classes. Immutable on an existing row — changing class requires DELETE + INSERT.
namerequiredstring
Display name. The server-derived name_norm and nysiis_key columns (used for matching + search) are computed from this value; updating it via PATCH recomputes both.
statusrequiredstring
Lifecycle state. active (default) means the row is in use; inactive is soft-deleted (matcher skips it, but history is preserved); merged indicates the matcher collapsed two duplicates and this row's history points to the survivor.
needs_reviewboolean
Set by the matcher when the row passed a pending decision in the Propose pipeline (high-scoring candidate below the attach threshold). Curation tools surface these rows for human review.
created_atrequiredstring (date-time)
Server-set on insert (DEFAULT now()). Never bound by the caller.
updated_atrequiredstring (date-time)
Server-set on insert + on every successful PATCH. Use this to detect changes since a prior snapshot.
origin_source_idstring
The source that created this object (Client API only). A property whose source_id is null has this source.
propertiesObjectProperty[]
All property rows for this object, ordered by name then property_id. Empty when the object has no properties.
property_idrequiredstring
Property row's 26-character ULID. Use in PATCH / DELETE on /v1/properties/{property_id} to mutate this value.
namerequiredstring
Property name from the ontology (e.g. company.industry, person.full_name_legal).
prop_typerequiredstring
The value's data type — names which val_* column actually carries the value. One of StringPropertyBaseType, IntegerPropertyBaseType, FloatPropertyBaseType, DecimalPropertyBaseType, DatePropertyBaseType, BooleanPropertyBaseType, TimestampPropertyBaseType, ArrayPropertyBaseType (maps to val_json).
val_textstring
Populated when prop_type=StringPropertyBaseType; null otherwise. Exactly one val_* is populated per row.
val_intinteger
Populated when prop_type=IntegerPropertyBaseType.
val_floatnumber
Populated when prop_type=FloatPropertyBaseType.
val_datestring (date)
Populated when prop_type=DatePropertyBaseType.
val_boolboolean
Populated when prop_type=BooleanPropertyBaseType.
val_timestampstring (date-time)
Populated when prop_type=TimestampPropertyBaseType.
val_jsonobject
Populated when prop_type=ArrayPropertyBaseType. Stores arbitrary JSON (typically arrays, hence the type name).
val_numstring
Populated when prop_type=DecimalPropertyBaseType. Use this for currency / fixed-precision values where float rounding is unacceptable.
confidence_scorestring
0-1 confidence in the value (1.0 = certain, 0.0 = guessed). Null means the writer didn't supply a score; consumers should treat null as "unspecified," not as low-confidence.
is_derivedboolean
True when the property was computed server-side (e.g. name component split) rather than directly supplied by the caller.
valid_fromstring (date)
Inclusive start of the value's validity; null = not stated. Written by Propose from the FactGraph property.
source_idstring
One source per row; a value several sources assert is several rows.
valid_tostring (date)
Exclusive end of the value's validity: the first day it no longer holds, e.g.
relationshipsObjectRelationship[]
All edges where this object is either source OR target side. Filter by source_id == object.object_id to find outgoing edges; opposite for incoming.
edge_idrequiredstring
Relationship row's 26-character ULID. Use in /v1/relationships/{edge_id} to fetch the edge directly.
source_idstring
Source endpoint's object_id. Null only when surfaced from a partial graph traversal.
target_idstring
Target endpoint's object_id. Null only when surfaced from a partial graph traversal.
relationship_typestring
Ontology-defined edge type (headquartered_at, employment, shareholder_of, ...). Null only when surfaced from a partial graph traversal.
source_descriptorrequiredstring
Caller-supplied free-text role label for the source side of the edge — what the source object is *to* the target (e.g. "employer", "shareholder", "registered in"). Not normalized; treat as opaque text.
target_descriptorrequiredstring
Caller-supplied free-text role label for the target side (e.g. "employee", "shareholding", "jurisdiction"). Not normalized.
valid_fromstring (date)
Inclusive start of the interval the edge is in effect. Null = open-ended past (relationship existed "as far back as we know").
valid_tostring (date)
Exclusive end of the interval: the first day the relationship no longer holds. Null = open-ended future (relationship is current). Callers querying "is X currently the CEO of Y" should filter for valid_to IS NULL or valid_to > today.
confidence_scorestring
0-1 confidence in the edge existing. Null = unspecified.
statusstring
Edge lifecycle state. active is the default; superseded means the matcher replaced this edge during Propose merge; withdrawn means the source retracted it. Most consumers filter for status='active'.
created_atstring (date-time)
When the edge was recorded. Not derivable from edge_id: a re-typed edge keeps its original time.
origin_source_idstring
The source that created this edge (Client API only). An edge property whose source_id is null has this source.
401
Auth missing or invalid.
403
Auth valid but caller lacks graph scope (Client API).
404
No object with that id in the caller's tenant scope.
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/objects/{object_id}?tenant_id=<tenant_id>' \
-H 'Authorization: Bearer <api_key_or_session_token>'PATCH /v1/objects/{object_id}
Partial update of an object's name or status
Partial update. Currently the only mutable fields are name and status — class_code is immutable (reclassification means a new object + relationship migration), and all properties live on the /v1/objects/{id}/properties endpoint, not here. When name changes, name_norm and nysiis_key are recomputed server-side and the per-component NYSIIS triple is re-derived for Person rows. The matcher's downstream indexes pick up the new values without a separate rebuild.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
object_idrequiredpath · string
ULID of the object row.
Request body
ObjectPatch, required.
tenant_idrequiredstring
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
namestring
New display name. When supplied, the server recomputes name_norm and nysiis_key (including per-component NYSIIS for Person rows).
statusstring
New lifecycle state. Flip to inactive to soft-delete (matcher will skip the row but it remains queryable).
Responses
200ObjectSummary
Updated ObjectSummary. The response carries the post-update name + status; fetch the detail view to see the recomputed name_norm / nysiis_key if needed.
object_idrequiredstring
Object's 26-character Crockford-base32 ULID. Server-minted on creation; immutable; the durable handle for all follow-up calls.
class_coderequiredstring
Object class string (Person, Company, Address, ...). Resolved server-side from the DB's smallint FK via JOIN to public.object_classes. Immutable on an existing row — changing class requires DELETE + INSERT.
namerequiredstring
Display name. The server-derived name_norm and nysiis_key columns (used for matching + search) are computed from this value; updating it via PATCH recomputes both.
statusrequiredstring
Lifecycle state. active (default) means the row is in use; inactive is soft-deleted (matcher skips it, but history is preserved); merged indicates the matcher collapsed two duplicates and this row's history points to the survivor.
needs_reviewboolean
Set by the matcher when the row passed a pending decision in the Propose pipeline (high-scoring candidate below the attach threshold). Curation tools surface these rows for human review.
created_atrequiredstring (date-time)
Server-set on insert (DEFAULT now()). Never bound by the caller.
updated_atrequiredstring (date-time)
Server-set on insert + on every successful PATCH. Use this to detect changes since a prior snapshot.
origin_source_idstring
The source that created this object (Client API only). A property whose source_id is null has this source.
400
The body has no actionable fields. PATCH requires at least one of name or status.
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm is a 404, like an unknown id. With the address flag on and the object an Address, also a key conflict: the change would give the address the same key as another active Address in the tenant, and nothing is written.
404
No object with that id in the caller's tenant scope.
422
Body-shape failure (invalid status enum, name length).
Example
curl -sS -X PATCH 'https://client.cloudswift.app/v1/objects/{object_id}' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"name": "<name>"
}'DELETE /v1/objects/{object_id}
Hard-delete an object (created in error)
Removes the object, its properties and every edge touching it (with their edge properties); the objects at the other end stay. Identity claims on it are released. Writes an id-level audit row with your reason: ids with class and relationship type, counts, ontology version — no content. ExternalSystemRecords. Each ESR the object reaches by has_integration_record is deleted with it once it has no other edge left (its properties too, with its own audit row, reason cascade: …), and listed in esr_deleted. An ESR still linked elsewhere (e.g. another object's has_integration_record) is kept and listed in esr_kept. Conversation ESRs are never cascaded: an engage:<conversation_id> ESR is linked only by its own outgoing has_conversation_party edges, which this rule doesn't follow, so it stays even when the delete leaves it with no edges.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
object_idrequiredpath · string
Object ULID.
tenant_idrequiredquery · string
Must equal the bearer's firm.
reasonquery · string
Why, for the audit row.
Responses
200DeleteResult
Deleted; body lists the edges removed, the ESRs deleted and kept, and the audit id.
audit_idrequiredstring
The direct_write_audit row for this delete.
object_idstring
The deleted object, for an object delete.
edge_idsstring[]
Every deleted edge.
properties_removedinteger
Object properties removed.
edge_properties_removedinteger
Edge properties removed.
esr_deletedstring[]
Object deletes only (always empty for DELETE /v1/relationships/{edge_id}, which cascades nothing): ExternalSystemRecords the deleted object reached by has_integration_record that had no other edge left, so were deleted with it; each has its own audit row.
esr_keptstring[]
Object deletes only (always empty for a relationship delete): those ESRs that still have other edges (e.g. another object's has_integration_record), so were kept.
404
No such object in your firm.
Example
curl -sS -X DELETE 'https://client.cloudswift.app/v1/objects/{object_id}?tenant_id=<tenant_id>' \
-H 'Authorization: Bearer <api_key_or_session_token>'POST /v1/objects/batch
Create many objects atomically (direct write)
Atomic batch create. All inserts share one transaction — any FK violation, unknown class_code, or generic INSERT failure rolls back the whole batch. Use this when you have a logically-coherent set of related rows that should either all land or none land. Implementation notes: distinct class_codes are resolved with one ANY lookup before the transaction opens, so unknown codes fail-fast as 400 without holding write locks. NYSIIS is computed per row Python-side, then the inserts run as a single multi-row INSERT under one round trip. Result payload echoes each input row's client_temp_id paired with the assigned object_id so the caller can reconcile its own staging IDs. A row with no key (empty, stoplisted or low confidence) is created as before, and a non-US one is created with its key and never reused. Where the flag is off there is no lookup: the same address written twice is two rows, as it always was. Every other class is never looked up. Each result item carries its own reused.
Send Authorization: Bearer with an API key or a portal session token.
Request body
ObjectCreateBatch, required.
tenant_idrequiredstring
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
objectsrequiredObjectCreateBatchItem[]
Objects to create. 1-1000 items. Inserts are atomic — any single failure rolls back the entire batch.
client_temp_idrequiredstring
Caller-chosen correlation token (any free-text string). The server echoes this on the response item paired with the assigned object_id so the caller can reconcile without a follow-up read.
class_coderequiredstring
Object class — must exist in the ontology.
namerequiredstring
Display name.
allow_duplicate_addressboolean
Skips the Address lookup and creates a new object with no identity key. Ignored for other classes, and when address resolution is off on this system.
statusstring
Initial lifecycle state. Defaults to active.
origin_source_idstring
The source creating this object (Client API only): one of the firm's sources or the shared list (GET /v1/sources). Its properties without a source_id take this source, and a property whose source_id equals it is stored without one.
name_formatstring: first_last | last_first
Parsing hint for Person rows. See ObjectCreate.name_format.
propertiesPropertyValue-Input[]
Properties to attach to the new object in the same transaction, each validated like POST /v1/objects/{id}/properties: the name must be bound to class_code in this surface's ontology (400 VAL002) and prop_type must match its data_type (422 VAL004). Any failure rolls back the whole batch. Before this field was silently dropped.
namerequiredstring
Ontology property name (e.g. company.industry, person.date_of_birth). Lookups are case-sensitive.
prop_typerequiredstring: ArrayPropertyBaseType | BooleanPropertyBaseType | DatePropertyBaseType | DecimalPropertyBaseType | FloatPropertyBaseType | IntegerPropertyBaseType
The value's data type — selects which val_* cell receives the value. Must match the ontology's property_definitions.data_type for name; otherwise the server rejects with VAL004.
val_textstring
Populated when prop_type=StringPropertyBaseType. Exactly one val_* must be set per request — supplying zero or more than one is a 422.
val_intinteger
Populated when prop_type=IntegerPropertyBaseType. Use val_num for fixed-precision currency / big-decimal values.
val_floatnumber
Populated when prop_type=FloatPropertyBaseType. Avoid for financial values — use val_num to preserve precision.
val_datestring (date)
Populated when prop_type=DatePropertyBaseType. ISO 8601 calendar date (no time zone).
val_boolboolean
Populated when prop_type=BooleanPropertyBaseType.
val_timestampstring (date-time)
Populated when prop_type=TimestampPropertyBaseType. ISO 8601 with timezone; UTC recommended.
val_jsonobject
Populated when prop_type=ArrayPropertyBaseType. Arbitrary JSON — typically arrays, hence the type name. Validated structurally only.
val_numobject
Populated when prop_type=DecimalPropertyBaseType. Use for currency, big-decimal scientific quantities, or any value where float rounding is unacceptable.
confidence_scoreobject
0-1 confidence in the value (1.0 = certain, 0.0 = guessed). Defaults to 1.0 server-side when omitted, matching the matcher's commit-time default. Set explicitly when you have a meaningful score from the source.
source_idstring
The source this value comes from, so consumers can tell which rows a source owns. Must be a registered source (unknown → 400 VAL005, as Propose). Omitted → the value has its object's source (origin_source_id,); a source_id equal to the object's is stored as null.
Responses
201ObjectCreateBatchResponse
Whole batch landed. results is in input order; each item carries the client's client_temp_id (when supplied) plus the assigned object_id.
itemsrequiredObjectCreateBatchResultItem[]
One result item per request item, in the same order as submitted. Length equals the request's objects length.
client_temp_idrequiredstring
Echo of the caller-supplied client_temp_id. Match this back to the request items to recover the assigned object_id.
reusedboolean
True when this Address matched an existing object by identity key, so object is that object and nothing new was created.
objectrequiredObjectSummary
List-shape response. No nested properties or relationships.
400
Pre-transaction failure: an unknown class_code was found before any rows were written. The whole batch is rejected.
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm is a 404, like an unknown id.
409
FK violation or similar mid-transaction failure rolled the batch back. Nothing landed; re-submit after fixing the offending row.
422
Body-shape failure on at least one item.
503
(Address flag on.) Another writer is changing that address, or the object it matched was removed while this request ran. Retry shortly.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/objects/batch' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"objects": [
{
"client_temp_id": "<client_temp_id>",
"class_code": "<class_code>",
"name": "<name>"
}
]
}'POST /v1/objects/search
Search objects by name (phonetic + fuzzy)
Phonetic + fuzzy name search. The supplied name is NYSIIS-encoded server-side; results come back ranked by a combination of NYSIIS match + name-similarity score against name_norm. This is the typical search-as-you-type backbone — Robert Smith, Bob Smith, Smyth, Rob all rank near each other because NYSIIS collapses spelling variants and the normalizer handles comma-reversal + middle-initial drift. Filter by object_class to narrow to one entity type, and include_properties=true to embed the matched object's properties in each result (avoids a follow-up round trip). Use the legacy /v1/objects?name=... list endpoint when you want exact-substring matches instead of phonetic; this endpoint is built for fuzzy.
Send Authorization: Bearer with an API key or a portal session token.
Request body
ObjectSearchRequest, required.
tenant_idrequiredstring
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
namerequiredstring
Query string. Phonetic — "Jon" matches "John".
class_codestring
Restrict the search to one class. Null = search all classes.
include_propertiesboolean
When true, fetch + attach property rows on every result item. Costs one extra batched query — leave false for list-only previews.
limitinteger
Max result count. 1-1000; default 50.
Responses
200ObjectSearchResponse
Ranked matches. score is a 0-1 composite of NYSIIS-equality + name-similarity; values above ~0.85 are typically the same person.
itemsrequiredObjectSearchResultItem[]
Search results ordered by phonetic match quality then object_id. Length up to limit; empty when no match.
object_idrequiredstring
Object's 26-character Crockford-base32 ULID. Server-minted on creation; immutable; the durable handle for all follow-up calls.
class_coderequiredstring
Object class string (Person, Company, Address, ...). Resolved server-side from the DB's smallint FK via JOIN to public.object_classes. Immutable on an existing row — changing class requires DELETE + INSERT.
namerequiredstring
Display name. The server-derived name_norm and nysiis_key columns (used for matching + search) are computed from this value; updating it via PATCH recomputes both.
statusrequiredstring
Lifecycle state. active (default) means the row is in use; inactive is soft-deleted (matcher skips it, but history is preserved); merged indicates the matcher collapsed two duplicates and this row's history points to the survivor.
needs_reviewboolean
Set by the matcher when the row passed a pending decision in the Propose pipeline (high-scoring candidate below the attach threshold). Curation tools surface these rows for human review.
created_atrequiredstring (date-time)
Server-set on insert (DEFAULT now()). Never bound by the caller.
updated_atrequiredstring (date-time)
Server-set on insert + on every successful PATCH. Use this to detect changes since a prior snapshot.
origin_source_idstring
The source that created this object (Client API only). A property whose source_id is null has this source.
propertiesObjectProperty[]
Property rows. Populated when the search request set include_properties=true; empty list otherwise.
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm is a 404, like an unknown id.
422
Body-shape failure (missing name, invalid object_class).
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/objects/search' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"name": "<name>",
"class_code": "<class_code>"
}'POST /v1/objects/{object_id}/properties
Attach a property to an object
Append a property to an existing object. The object must exist in the caller's tenant scope (404 otherwise). Property name validation runs at insert: the name must be in property_definitions AND bound to this object's class via class_properties. Unknown property names return 400 — fetch GET /v1/ontology/classes to see what's legal for each class. Cardinality: properties marked cardinality=single reject the insert with a 409 if a value already exists. cardinality=multi (e.g. company.external_id) accepts repeated values; the matcher treats them as a set. The property value must populate exactly one of the val_* fields matching the property's data_type (val_text for StringPropertyBaseType, val_date for DatePropertyBaseType, etc.) — mismatched val_*/prop_type returns 422.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
object_idrequiredpath · string
ULID of the object row.
Request body
PropertyCreate, required.
namerequiredstring
Ontology property name (e.g. company.industry, person.date_of_birth). Lookups are case-sensitive.
prop_typerequiredstring: ArrayPropertyBaseType | BooleanPropertyBaseType | DatePropertyBaseType | DecimalPropertyBaseType | FloatPropertyBaseType | IntegerPropertyBaseType
The value's data type — selects which val_* cell receives the value. Must match the ontology's property_definitions.data_type for name; otherwise the server rejects with VAL004.
val_textstring
Populated when prop_type=StringPropertyBaseType. Exactly one val_* must be set per request — supplying zero or more than one is a 422.
val_intinteger
Populated when prop_type=IntegerPropertyBaseType. Use val_num for fixed-precision currency / big-decimal values.
val_floatnumber
Populated when prop_type=FloatPropertyBaseType. Avoid for financial values — use val_num to preserve precision.
val_datestring (date)
Populated when prop_type=DatePropertyBaseType. ISO 8601 calendar date (no time zone).
val_boolboolean
Populated when prop_type=BooleanPropertyBaseType.
val_timestampstring (date-time)
Populated when prop_type=TimestampPropertyBaseType. ISO 8601 with timezone; UTC recommended.
val_jsonobject
Populated when prop_type=ArrayPropertyBaseType. Arbitrary JSON — typically arrays, hence the type name. Validated structurally only.
val_numobject
Populated when prop_type=DecimalPropertyBaseType. Use for currency, big-decimal scientific quantities, or any value where float rounding is unacceptable.
confidence_scoreobject
0-1 confidence in the value (1.0 = certain, 0.0 = guessed). Defaults to 1.0 server-side when omitted, matching the matcher's commit-time default. Set explicitly when you have a meaningful score from the source.
source_idstring
The source this value comes from, so consumers can tell which rows a source owns. Must be a registered source (unknown → 400 VAL005, as Propose). Omitted → the value has its object's source (origin_source_id,); a source_id equal to the object's is stored as null.
tenant_idrequiredstring
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
Responses
201ObjectProperty
Property attached. Body is the persisted ObjectProperty with server-stamped property_id, created_at, and the derived nysiis_key (StringPropertyBaseType only).
property_idrequiredstring
Property row's 26-character ULID. Use in PATCH / DELETE on /v1/properties/{property_id} to mutate this value.
namerequiredstring
Property name from the ontology (e.g. company.industry, person.full_name_legal).
prop_typerequiredstring
The value's data type — names which val_* column actually carries the value. One of StringPropertyBaseType, IntegerPropertyBaseType, FloatPropertyBaseType, DecimalPropertyBaseType, DatePropertyBaseType, BooleanPropertyBaseType, TimestampPropertyBaseType, ArrayPropertyBaseType (maps to val_json).
val_textstring
Populated when prop_type=StringPropertyBaseType; null otherwise. Exactly one val_* is populated per row.
val_intinteger
Populated when prop_type=IntegerPropertyBaseType.
val_floatnumber
Populated when prop_type=FloatPropertyBaseType.
val_datestring (date)
Populated when prop_type=DatePropertyBaseType.
val_boolboolean
Populated when prop_type=BooleanPropertyBaseType.
val_timestampstring (date-time)
Populated when prop_type=TimestampPropertyBaseType.
val_jsonobject
Populated when prop_type=ArrayPropertyBaseType. Stores arbitrary JSON (typically arrays, hence the type name).
val_numstring
Populated when prop_type=DecimalPropertyBaseType. Use this for currency / fixed-precision values where float rounding is unacceptable.
confidence_scorestring
0-1 confidence in the value (1.0 = certain, 0.0 = guessed). Null means the writer didn't supply a score; consumers should treat null as "unspecified," not as low-confidence.
is_derivedboolean
True when the property was computed server-side (e.g. name component split) rather than directly supplied by the caller.
valid_fromstring (date)
Inclusive start of the value's validity; null = not stated. Written by Propose from the FactGraph property.
source_idstring
One source per row; a value several sources assert is several rows.
valid_tostring (date)
Exclusive end of the value's validity: the first day it no longer holds, e.g.
400
Property name not in property_definitions or not bound to this object's class via class_properties. Re-fetch the ontology and pick a valid name.
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm is a 404, like an unknown id. With the address flag on and the object an Address, also a key conflict: the change would give the address the same key as another active Address in the tenant, and nothing is written.
404
No object with that id in the caller's tenant scope.
409
Property is cardinality=single and a value already exists. Use DELETE /v1/properties/{property_id} first or PATCH the existing value via the properties route.
422
Body-shape failure: more than one val_* field populated, or the populated field doesn't match the property's data_type.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/objects/{object_id}/properties' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "<name>",
"prop_type": "ArrayPropertyBaseType",
"tenant_id": "<tenant_id>"
}'POST /v1/objects/{survivor_id}/merge
Merge objects into a survivor (same entity)
Resolves a needs_review / potential_duplicate_of pair: every loser's edges, properties, provenance and identity claims move to the survivor, then the losers are hard-deleted. Edges that would duplicate a survivor edge are folded into it (edge properties: survivor wins; valid time: union); edges between survivor and loser are removed. Property values keep their source, and the survivor wins per source: a single-valued property the survivor already has from the same source drops the loser's value, and a multi-valued value the survivor already has from the same source is a duplicate; a value from another source moves with its source. Takes the same per-name locks as Propose, so nothing attaches to a loser mid-merge. No unmerge. Returns the loser → survivor mapping. A moved edge of a single-cardinality type that would give the survivor's endpoint a second current edge (e.g. a second owner of an ExternalSystemRecord) is moved but ended: the existing edge wins, the moved one keeps its history under valid_time: all, and it is listed in edges_ended. Its valid_to is the merge date (an exclusive end,).
Send Authorization: Bearer with an API key or a portal session token.
Parameters
survivor_idrequiredpath · string
The object that remains.
Request body
MergeRequest, required.
tenant_idrequiredstring
Must equal the bearer's firm.
loser_idsrequiredstring[]
Objects to merge into the survivor; each is hard-deleted after.
reasonstring
Why, for the audit rows (e.g. 'same person').
Responses
200MergeResult
Merged; body maps each loser to the survivor.
survivor_idrequiredstring
The object that remains.
mappingrequiredobject
loser_id → survivor_id. Repoint any ids you hold outside the graph.
edges_movedstring[]
Edges now pointing at the survivor.
edges_collapsedstring[]
Moved edges that matched an existing survivor edge and were folded into it.
edges_removedstring[]
Edges between the survivor and a loser (they'd point at themselves).
edges_endedstring[]
Moved edges of a single-cardinality type the survivor already held a current edge of (e.g. a second owner of an ExternalSystemRecord): the survivor's edge wins, and this one is moved but ended, so valid_time: all still shows it. Also listed in edges_moved.
properties_movedinteger
Loser properties now on the survivor.
properties_droppedinteger
Loser values not carried: a single-valued property the survivor already has from the same source (survivor wins, per source;), or a multi-value it already has from the same source.
audit_idrequiredstring
The direct_write_audit row for this merge.
404
The survivor or a loser isn't in your firm.
422
Survivor among losers, or objects of different classes.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/objects/{survivor_id}/merge' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"loser_ids": [
"<loser_ids>"
]
}'Properties
Update or delete a property on an object.
PATCH /v1/properties/{property_id}
Replace a property's value cell
Replace the value cell of an existing property row. The body must set exactly one of val_text, val_int, val_float, val_date, val_bool, val_timestamp, val_json, or val_num (Pydantic's PropertyUpdate.exactly_one_val validator enforces this — 422 if zero or more than one). The UPDATE rewrites all val_* columns in a single statement: the named field gets the supplied value, every other val_* column is NULLed. This preserves the single-value invariant — a row never holds a leftover value of the previous type after a PATCH. confidence_score is updated when provided; preserved (via COALESCE) when omitted. prop_type is immutable here — to change a property's type, DELETE the row and POST a fresh property on the parent object via POST /v1/objects/{object_id}/properties. A cross-tenant patch returns 404, the same as an unknown property_id, even when the id exists in another firm (the tenant_id check hides it,).
Send Authorization: Bearer with an API key or a portal session token.
Parameters
property_idrequiredpath · string
ULID of the property row.
Request body
PropertyUpdate, required.
tenant_idrequiredstring
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
val_textstring
Populated when prop_type=StringPropertyBaseType. Exactly one val_* must be set per request — supplying zero or more than one is a 422.
val_intinteger
Populated when prop_type=IntegerPropertyBaseType. Use val_num for fixed-precision currency / big-decimal values.
val_floatnumber
Populated when prop_type=FloatPropertyBaseType. Avoid for financial values — use val_num to preserve precision.
val_datestring (date)
Populated when prop_type=DatePropertyBaseType. ISO 8601 calendar date (no time zone).
val_boolboolean
Populated when prop_type=BooleanPropertyBaseType.
val_timestampstring (date-time)
Populated when prop_type=TimestampPropertyBaseType. ISO 8601 with timezone; UTC recommended.
val_jsonobject
Populated when prop_type=ArrayPropertyBaseType. Arbitrary JSON — typically arrays, hence the type name. Validated structurally only.
val_numobject
Populated when prop_type=DecimalPropertyBaseType. Use for currency, big-decimal scientific quantities, or any value where float rounding is unacceptable.
confidence_scoreobject
0-1 confidence. When supplied, replaces the existing score; when omitted, the existing score is preserved (COALESCE). Distinct from the val_* fields where missing means "null this cell".
Responses
200ObjectProperty
Updated ObjectProperty. The response carries the post-PATCH typed value column + the (possibly preserved) confidence_score.
property_idrequiredstring
Property row's 26-character ULID. Use in PATCH / DELETE on /v1/properties/{property_id} to mutate this value.
namerequiredstring
Property name from the ontology (e.g. company.industry, person.full_name_legal).
prop_typerequiredstring
The value's data type — names which val_* column actually carries the value. One of StringPropertyBaseType, IntegerPropertyBaseType, FloatPropertyBaseType, DecimalPropertyBaseType, DatePropertyBaseType, BooleanPropertyBaseType, TimestampPropertyBaseType, ArrayPropertyBaseType (maps to val_json).
val_textstring
Populated when prop_type=StringPropertyBaseType; null otherwise. Exactly one val_* is populated per row.
val_intinteger
Populated when prop_type=IntegerPropertyBaseType.
val_floatnumber
Populated when prop_type=FloatPropertyBaseType.
val_datestring (date)
Populated when prop_type=DatePropertyBaseType.
val_boolboolean
Populated when prop_type=BooleanPropertyBaseType.
val_timestampstring (date-time)
Populated when prop_type=TimestampPropertyBaseType.
val_jsonobject
Populated when prop_type=ArrayPropertyBaseType. Stores arbitrary JSON (typically arrays, hence the type name).
val_numstring
Populated when prop_type=DecimalPropertyBaseType. Use this for currency / fixed-precision values where float rounding is unacceptable.
confidence_scorestring
0-1 confidence in the value (1.0 = certain, 0.0 = guessed). Null means the writer didn't supply a score; consumers should treat null as "unspecified," not as low-confidence.
is_derivedboolean
True when the property was computed server-side (e.g. name component split) rather than directly supplied by the caller.
valid_fromstring (date)
Inclusive start of the value's validity; null = not stated. Written by Propose from the FactGraph property.
source_idstring
One source per row; a value several sources assert is several rows.
valid_tostring (date)
Exclusive end of the value's validity: the first day it no longer holds, e.g.
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm is a 404, like an unknown id. With the address flag on and the object an Address, also a key conflict: the change would give the address the same key as another active Address in the tenant, and nothing is written.
404
No property with that id in the caller's tenant scope.
422
Body-shape failure: zero or more than one val_* set, or a val_* value that fails Pydantic typing.
Example
curl -sS -X PATCH 'https://client.cloudswift.app/v1/properties/{property_id}' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>"
}'DELETE /v1/properties/{property_id}
Delete a property
Hard-delete a property row by property_id. The matching row is removed from the per-tenant properties table; the parent object and its other properties are untouched. There is no soft-delete path on this endpoint — if you need to mark a property obsolete while preserving history, end it instead: re-propose the same value with a valid_to date through POST /propose/factgraphs (this direct-write API, including PATCH /v1/properties/{id}, cannot set valid_from / valid_to), or rely on the audit table to reconstruct prior state. The Propose pipeline does not invoke this endpoint; it dedupes by canonical value at write time instead. 404 is returned when the property_id doesn't exist *for this tenant* — including the case where the row exists under a different tenant_id (the WHERE clause hides it first, so callers can't probe foreign tenants).
Send Authorization: Bearer with an API key or a portal session token.
Parameters
property_idrequiredpath · string
ULID of the property row.
tenant_idrequiredquery · string
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
Responses
204
Property deleted. No body — re-fetch the parent object's properties via GET /v1/objects/{object_id}/properties to confirm.
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm is a 404, like an unknown id. With the address flag on and the object an Address, also a key conflict: the change would give the address the same key as another active Address in the tenant, and nothing is written.
404
No property with that id in the caller's tenant scope.
Example
curl -sS -X DELETE 'https://client.cloudswift.app/v1/properties/{property_id}?tenant_id=<tenant_id>' \
-H 'Authorization: Bearer <api_key_or_session_token>'Graph
Search, query, insert, and resolve records in the graph.
POST /v1/graph/insert
Bulk-write objects and relationships in one transaction
Insert a graph fragment (objects + relationships) atomically. Either the entire payload lands or nothing does — any single INSERT failure rolls the whole transaction back. Two-phase shape: Phase 1 inserts every object in the objects array, building a server-side map from each item's client_temp_id (caller-chosen free-text token, e.g. "alice") to the freshly minted object_id (ULID). Phase 2 inserts every relationship; each source_ref / target_ref is resolved against that map first (matches a client_temp_id) and falls through to direct-id mode (the 26-char ref is treated as an existing object_id, and the DB's FK constraint validates it actually exists). This is the trust-mode bulk path — no matcher runs, so each relationship materializes as-supplied. Soft-validation: every relationship's (source_class, target_class, relationship_type) is checked against the ontology's allowed_pairs; a disallowed tuple returns HTTP 422 with code=VAL006 and a details.relationship_index naming which entry in the relationships list failed — same envelope the single-edge POST /v1/relationships endpoint returns. Referenced class_codes must also exist. Use POST /propose/factgraphs when the source is third-party and may already exist as objects/edges in the graph. Idempotent under retry. Each edge is written under an advisory lock scoped to (tenant_id, source_id, target_id, relationship_type). Duplicate submissions return the pre-existing edge in the response edges array instead of writing a new row; the caller sees the same shape either way. The pre-existing edge does take the relationship's properties: new names are added, changed values updated, and each edge's edge_properties_written lists which. The response id_map is the canonical record of what was minted — store it alongside the caller's original temp ids so future calls can target the same objects without re-resolving by name. A row with no key (empty, stoplisted or low confidence) is created as before, and a non-US one is created with its key and never reused. Where the flag is off there is no lookup: the same address written twice is two rows, as it always was. Every other class is never looked up. The objects the response lists carry their own reused, and id_map maps a reused object's client_temp_id to the existing id.
Send Authorization: Bearer with an API key or a portal session token.
Request body
GraphInsertRequest, required.
tenant_idrequiredstring
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
objectsObjectCreateBatchItem[]
New objects to create in Phase 1 of the transaction. Each item's client_temp_id is the resolution key that relationships in the same payload reference. Empty list is OK if relationships only references existing ULIDs.
client_temp_idrequiredstring
Caller-chosen correlation token (any free-text string). The server echoes this on the response item paired with the assigned object_id so the caller can reconcile without a follow-up read.
class_coderequiredstring
Object class — must exist in the ontology.
namerequiredstring
Display name.
allow_duplicate_addressboolean
Skips the Address lookup and creates a new object with no identity key. Ignored for other classes, and when address resolution is off on this system.
statusstring
Initial lifecycle state. Defaults to active.
origin_source_idstring
The source creating this object (Client API only): one of the firm's sources or the shared list (GET /v1/sources). Its properties without a source_id take this source, and a property whose source_id equals it is stored without one.
name_formatstring: first_last | last_first
Parsing hint for Person rows. See ObjectCreate.name_format.
propertiesPropertyValue-Input[]
Properties to attach to the new object in the same transaction, each validated like POST /v1/objects/{id}/properties: the name must be bound to class_code in this surface's ontology (400 VAL002) and prop_type must match its data_type (422 VAL004). Any failure rolls back the whole batch. Before this field was silently dropped.
namerequiredstring
Ontology property name (e.g. company.industry, person.date_of_birth). Lookups are case-sensitive.
prop_typerequiredstring: ArrayPropertyBaseType | BooleanPropertyBaseType | DatePropertyBaseType | DecimalPropertyBaseType | FloatPropertyBaseType | IntegerPropertyBaseType
The value's data type — selects which val_* cell receives the value. Must match the ontology's property_definitions.data_type for name; otherwise the server rejects with VAL004.
val_textstring
Populated when prop_type=StringPropertyBaseType. Exactly one val_* must be set per request — supplying zero or more than one is a 422.
val_intinteger
Populated when prop_type=IntegerPropertyBaseType. Use val_num for fixed-precision currency / big-decimal values.
val_floatnumber
Populated when prop_type=FloatPropertyBaseType. Avoid for financial values — use val_num to preserve precision.
val_datestring (date)
Populated when prop_type=DatePropertyBaseType. ISO 8601 calendar date (no time zone).
val_boolboolean
Populated when prop_type=BooleanPropertyBaseType.
val_timestampstring (date-time)
Populated when prop_type=TimestampPropertyBaseType. ISO 8601 with timezone; UTC recommended.
val_jsonobject
Populated when prop_type=ArrayPropertyBaseType. Arbitrary JSON — typically arrays, hence the type name. Validated structurally only.
val_numobject
Populated when prop_type=DecimalPropertyBaseType. Use for currency, big-decimal scientific quantities, or any value where float rounding is unacceptable.
confidence_scoreobject
0-1 confidence in the value (1.0 = certain, 0.0 = guessed). Defaults to 1.0 server-side when omitted, matching the matcher's commit-time default. Set explicitly when you have a meaningful score from the source.
source_idstring
The source this value comes from, so consumers can tell which rows a source owns. Must be a registered source (unknown → 400 VAL005, as Propose). Omitted → the value has its object's source (origin_source_id,); a source_id equal to the object's is stored as null.
relationshipsRelationshipCreateItem[]
Edges to create in Phase 2 of the transaction. Each edge's source_ref / target_ref resolves via the Phase 1 id_map first, then falls through to existing-ULID mode. Empty list is OK if objects is non-empty.
source_refrequiredstring
Source endpoint reference. Two-mode resolution: matches a client_temp_id in this payload's objects list first; otherwise must be a 26-char ULID referring to an existing object. Unresolvable refs return HTTP 400.
target_refrequiredstring
Target endpoint reference. Same two-mode resolution as source_ref. Edges are directed — the two refs are not interchangeable.
relationship_typerequiredstring
Ontology-defined edge type. Trust-mode insert — there is no allowed_pairs pre-check on this endpoint (unlike the single-edge /v1/relationships route). The DB's FK constraints catch outright-invalid endpoints; soft-validation (VAL006 pair check) lives in the Propose pipeline.
source_descriptorrequiredstring
Free-text role label for the source side. Not normalized.
target_descriptorrequiredstring
Free-text role label for the target side. Not normalized.
valid_fromstring (date)
Inclusive start of validity interval. Null = open-ended past.
valid_tostring (date)
Exclusive end of the validity interval: the first day it no longer holds. Null = currently active.
confidence_scoreobject
0-1 confidence in the edge existing.
origin_source_idstring
The source creating this edge (Client API only): one of the firm's sources or the shared list (GET /v1/sources). Its properties without a source_id take this source. Not source_id, which is the source endpoint. Ignored on a dedup hit (the existing edge keeps its source).
propertiesPropertyValue-Input[]
Edge properties. Each name must be declared for relationship_type in this surface's relationship_properties (400 VAL002) and prop_type must match its data_type (422 VAL004). Written in the same transaction as the edge. When the request dedupes onto an existing edge, the edge takes these properties: names it lacks are added, changed values are updated, identical ones left alone; edge_properties_written reports which.
namerequiredstring
Ontology property name (e.g. company.industry, person.date_of_birth). Lookups are case-sensitive.
prop_typerequiredstring: ArrayPropertyBaseType | BooleanPropertyBaseType | DatePropertyBaseType | DecimalPropertyBaseType | FloatPropertyBaseType | IntegerPropertyBaseType
The value's data type — selects which val_* cell receives the value. Must match the ontology's property_definitions.data_type for name; otherwise the server rejects with VAL004.
val_textstring
Populated when prop_type=StringPropertyBaseType. Exactly one val_* must be set per request — supplying zero or more than one is a 422.
val_intinteger
Populated when prop_type=IntegerPropertyBaseType. Use val_num for fixed-precision currency / big-decimal values.
val_floatnumber
Populated when prop_type=FloatPropertyBaseType. Avoid for financial values — use val_num to preserve precision.
val_datestring (date)
Populated when prop_type=DatePropertyBaseType. ISO 8601 calendar date (no time zone).
val_boolboolean
Populated when prop_type=BooleanPropertyBaseType.
val_timestampstring (date-time)
Populated when prop_type=TimestampPropertyBaseType. ISO 8601 with timezone; UTC recommended.
val_jsonobject
Populated when prop_type=ArrayPropertyBaseType. Arbitrary JSON — typically arrays, hence the type name. Validated structurally only.
val_numobject
Populated when prop_type=DecimalPropertyBaseType. Use for currency, big-decimal scientific quantities, or any value where float rounding is unacceptable.
confidence_scoreobject
0-1 confidence in the value (1.0 = certain, 0.0 = guessed). Defaults to 1.0 server-side when omitted, matching the matcher's commit-time default. Set explicitly when you have a meaningful score from the source.
source_idstring
The source this value comes from, so consumers can tell which rows a source owns. Must be a registered source (unknown → 400 VAL005, as Propose). Omitted → the value has its object's source (origin_source_id,); a source_id equal to the object's is stored as null.
Responses
201GraphInsertResponse
Graph fragment committed. Response carries id_map (client_temp_id -> server ULID), the freshly minted objects, and the resolved edges so callers can reconcile the write without a follow-up read.
id_maprequiredobject
Map from each client_temp_id in the request to the assigned object_id. Includes every Phase 1 insert; empty when the request had no objects. Store this on the caller side to correlate future writes back to the original temp ids.
objectsrequiredGraphInsertObjectResult[]
One result item per objects entry in the request, in submission order. Length equals the request's objects length.
client_temp_idrequiredstring
Echo of the caller-supplied client_temp_id. Match this back to the request items to recover the assigned object_id.
reusedboolean
True when this Address matched an existing object by identity key, so object is that object and nothing new was created.
objectrequiredObjectSummary
List-shape response. No nested properties or relationships.
edgesrequiredGraphInsertEdgeResult[]
One result item per relationships entry in the request, in submission order. Length equals the request's relationships length.
edge_idrequiredstring
Server-minted edge ULID. Durable handle for follow-up fetches on /v1/relationships/{edge_id}.
source_idrequiredstring
Resolved server ULID for the source endpoint — the actual object_id, whether resolved from a client_temp_id or used directly.
target_idrequiredstring
Resolved server ULID for the target endpoint.
relationship_typerequiredstring
Edge type from the request, echoed verbatim.
source_descriptorrequiredstring
Source-side role label from the request.
target_descriptorrequiredstring
Target-side role label from the request.
statusrequiredstring
Lifecycle state. Always active on a fresh insert; other values surface only on edges returned from GET endpoints.
origin_source_idstring
The edge's source (Client API only). On a dedup hit it is the existing edge's, which its properties without a source_id keep.
edge_properties_writtenEdgePropertiesWritten
Which of a write's edge properties changed the edge.
400
Empty payload (objects AND relationships both empty), unknown class_code(s), an unresolvable relationship ref (not a known temp_id and not a 26-char ULID), or an FK-violating ULID ref.
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm is a 404, like an unknown id.
409ErrorEnvelope
COM004: a new edge would give an endpoint a second current edge of a single-cardinality type (e.g. a second owner for an ExternalSystemRecord). details.conflicting_edge_id names the existing edge; the whole request is rolled back and writes nothing.
422
Body-shape failure (Pydantic): missing required fields, malformed temporal bounds, invalid status. OR an ontology-disallowed (relationship_type, source_class, target_class) tuple — code=VAL006, details.relationship_index names the offending entry, details.source_class / details.target_class name the classes.
503
(Address flag on.) Another writer is changing that address, or the object it matched was removed while this request ran. Retry shortly.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/graph/insert' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"objects": [
{
"client_temp_id": "<client_temp_id>",
"class_code": "<class_code>",
"name": "<name>"
}
],
"relationships": [
{
"source_ref": "<source_ref>",
"target_ref": "<target_ref>",
"relationship_type": "<relationship_type>",
"source_descriptor": "<source_descriptor>",
"target_descriptor": "<target_descriptor>"
}
]
}'POST /v1/graph/query
Filter the root set and BFS-expand through typed edges
Run one graph query: pick a root set of objects with property + provenance predicates, then optionally expand outward through typed edges (breadth-first, batched per spec + depth). Returns a tree of ObjectResults with alias-keyed children attached. Root filters (root.filters[]) compose with AND. Mismatch returns 400 with code=VAL004. excluded_source_ids filters out objects whose only provenance is from the named sources — the canonical pattern for "give me the graph as if my-own-writes never happened," used by conflict-check to dedupe against the firm's own submissions. expand[] is recursive. Each spec carries a relationship_type, an optional target_class, a direction (outgoing / incoming / both), a per-spec limit (default applies if omitted), and an optional nested expand[]. The traversal walks BFS by level and stops at max_depth (request-level cap). Cycle detection is on object_id across the entire traversal — an object is materialized once even if multiple paths lead to it. Truncation signals (truncated.depth_exceeded, truncated.limit_exceeded, truncated.where) tell you exactly which path was cut. include_properties at request level or per-expand controls whether property rows are fetched + attached. Properties are batched into a single end-of-traversal query across every opted-in object, so deeply-nested queries pay one round-trip for properties regardless of tree shape. Default status="active" at root; expand only follows status='active' edges. Schema binding (request.schema) is optional.
Send Authorization: Bearer with an API key or a portal session token.
Request body
GraphQueryRequest, required.
schemastring
Workspace binding selected by the server. Callers do not send an internal schema name.
tenant_idrequiredstring
Firm scope. Must equal the bearer's bound firm_id; a cross-tenant read returns 404.
rootrequiredRootSpec
Specification for the root-level query. Per design doc §1, ③-⑩.
class_codestring
Restrict root set to one class. Either class_code OR object_ids must be set.
object_idsstring[]
Optional seed list; max 1000 ULIDs.
filtersobject[]
Property predicates, composed with AND. A member may be a group (any_of / all_of,) for OR logic. Each filter must satisfy its op/type contract; mismatches return VAL004.
has_relationshipHasRelationshipSpec[]
Keep only roots that have (or, with negate, lack) a matching edge. Composed with AND.
relationship_typerequiredstring
Ontology relationship type. VAL002 on unknown type.
directionstring: outgoing | incoming | both
Edge direction relative to the root, as in expand.
target_classstring
Optional class_code of the other endpoint. VAL001 on unknown class.
filtersobject[]
Property filters on the other endpoint (same vocabulary as root.filters).
edge_filtersobject[]
Filters on the edge's own properties (edge_properties).
valid_timestring: current | all
current: only edges with no valid_to or one not yet passed. all: ended edges too.
negateboolean
True = keep roots with NO matching edge (NOT EXISTS).
excluded_source_idsstring[]
Hide objects whose only provenance is from these sources. Useful for conflict-check dedup ("give me the graph as if my own writes never happened").
searchstring
Substring ILIKE on name. Null = no search predicate.
statusstring: active | inactive | merged
Lifecycle filter. Defaults to active; set to None explicitly to include all states (rare). Expand traversal follows only status='active' edges regardless of this filter.
limitinteger
Max root rows. 1-1000; default 50.
offsetinteger
Pagination offset. 0-10000; default 0.
expandExpandSpec[]
Expand specs applied to every root object. Recursive — each spec may carry nested expand[].
relationship_typerequiredstring
Ontology relationship type to follow. Validated against the loaded ontology — VAL002 on unknown type.
directionstring: outgoing | incoming | both
Edge direction relative to the current node. outgoing follows source -> target (default); incoming follows target -> source; both follows either.
target_classstring
Optional class_code filter on the *other* endpoint. Null = no class filter. Unknown class -> VAL001.
asstring
Response alias for this expand level; defaults to relationship_type. Use when the same type appears at multiple expand levels and you need distinct keys.
include_propertiesboolean
Override the request-level include_properties for this expand level. Null = inherit from request.
limitinteger
Per-expand cap on child rows. 1-200; default 50. Hitting the cap surfaces truncated.limit_exceeded in the response.
filtersobject[]
Property filters on the neighbour — same vocabulary as root.filters, applied to the other endpoint.
edge_filtersobject[]
Filters on the edge's own properties, e.g. {"property": "matter_party.adverse", "op": "eq", "value": true}.
valid_timestring: current | all
current (default): edges whose valid_to is null or not yet passed. all: ended edges too (e.g. a former party).
include_edge_propertiesstring[]
Edge properties to return on each child's edge.properties. Empty = none, keeping the payload small.
max_neighborsinteger
Cap on children PER PARENT. When it bites, the parent's neighbor_counts[<alias>] says truncated: true and the total — the query still succeeds.
expandExpandSpec[]
Nested expand specs — recursive. Total depth capped by the request's max_depth; deeper nesting -> VAL013.
include_propertiesboolean
When true, attach property rows to every result object. Per-expand-spec override available via ExpandSpec.include_properties.
max_depthinteger
Cap on expand recursion depth. 0-10; default 3. Exceeding -> VAL013 with the path that ran over.
Responses
200GraphQueryResponse
Query succeeded. Body carries objects (root tier with alias-keyed children attached), total_count (matching the root WHERE; useful for paging), returned_count, depth_reached, and an optional truncated block when limits / depth were hit.
objectsrequiredObjectResult[]
Root-level objects matching the query, with expanded children attached under alias keys (extra='allow' on ObjectResult). Length up to RootSpec.limit; less when fewer matches exist.
object_idrequiredstring
Object's 26-char ULID. Use for follow-up GET /v1/objects/{object_id} calls.
class_coderequiredstring
Resolved class_code from the ontology (e.g. Company, Person).
namerequiredstring
Display name.
statusrequiredstring
Lifecycle state (active / inactive / merged). The root spec's status filter applies; expand traversal follows only active edges regardless.
needs_reviewrequiredboolean
True when the matcher flagged this row for human review during a prior Propose pipeline run.
created_atrequiredstring (date-time)
Server-set timestamp from the DB row.
updated_atrequiredstring (date-time)
Most recent update — useful for detecting changes since a prior query.
origin_source_idstring
The source that created this object. A property whose source_id is null has this source.
propertiesObjectPropertyValue[]
Property rows. Populated when include_properties=true applied to this object's expand level; null otherwise.
edgeEdgeInfo
The edge an expanded child was reached through.
neighbor_countsobject
On a parent, per expand alias with max_neighbors set: total vs returned children and whether the list was cut.
total_countrequiredinteger
Count of root-level matches before limit (single COUNT(*) over the same WHERE).
returned_countrequiredinteger
Equals len(objects).
depth_reachedinteger
Actual depth traversed.
truncatedTruncationInfo
Indicates whether the response was truncated, and where. Per design doc §3. Present on the response only when something was truncated — its absence means the response is complete.
depth_exceededboolean
True when the request's max_depth capped the traversal before reaching all spec'd expand levels.
limit_exceededboolean
True when a per-spec limit capped a child row set. Independent from depth_exceeded — both can fire.
whererequiredstring
Path where truncation happened, e.g. "root" or "root.spouse_of".
400
Validation rejection. The body is a ValidationError envelope (code, message, path, hint). Codes: VAL001 (unknown class), VAL002 (unknown property / relationship_type), VAL004 (op-type mismatch or coercion failure), VAL011 (schema mismatch), VAL013 (depth/nesting exceeds max_depth).
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm is a 404, like an unknown id.
422
Body-shape failure (Pydantic): malformed ExpandSpec, missing required fields, invalid filter shape (e.g. a value supplied with is_null).
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/graph/query' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"root": {
"class_code": "<class_code>"
}
}'POST /v1/graph/search
Rank a FactGraph against public and the tenant schema
Scores each named Person in the FactGraph, including the relationship legs in that FactGraph, using the same cross-schema matcher as conflict-check. Scope all (the default) searches public and the caller's schema. Nothing is written. A hit carries the matched node, its citations, and the relationship legs that scored.
Send Authorization: Bearer with an API key or a portal session token.
Request body
GraphSearchBody, required.
tenant_idrequiredstring
Must equal the credential's tenant. Same rule as the other /v1 graph routes.
factgraphrequiredFactGraph
A complete graph of facts from a single source observation. The top-level input to the Propose API. Supports both v1.2 (implicit) and v2.0 (explicit) schema versions. - No schema_version field = v1.2 behavior (matching pipeline) - schema_version = "2.0" enables explicit object actions
schema_versionstring
v2.0: Schema version (e.g., '2.0'). Omit or null for v1.2 compatibility.
source_dataobject
v2.0: Free-form JSON preserved with FactGraph (suggested <1000 chars, not enforced)
factgraph_idstring
Client-provided ID for tracking. Used for idempotency: re-submitting a factgraph_id this tenant has already submitted returns the existing proposal_id and enqueues nothing, however long ago the first submission was. The same id under another tenant is a separate proposal. Treat as a stable correlation key, e.g. <runId>:<chunk> or a content hash.
ontology_versionrequiredstring
Caller-pinned ontology version (integer '34' or semver '7.0.0'). The Validate stage rejects with VAL002 if the pinned version dropped a class or property still referenced in this payload. Recommended pattern: pin a specific version + bump deliberately in a coordinated rollout.
default_provenanceProvenance
Data lineage information. Tracks where data came from.
source_idrequiredstring
26-char ULID of a registered source. Must exist in <schema>.sources — the Propose route pre-validates and returns 400/VAL002 on miss before the worker runs.
extraction_confidencenumber
0.0-1.0 confidence in the extraction step itself (how sure was the parser that it read the source correctly?). Distinct from each Property's confidence_score, which scores the semantic claim.
extracted_atstring (date-time)
ISO 8601 timestamp when the value was extracted from the source. Distinct from created_at (DB insert time).
acquisition_methodstring: api_call | db_query | web_scrape | file_import | manual_entry | synthetic_test
How the data was acquired. api_call for live REST/GraphQL pulls, db_query for upstream DB reads, web_scrape for HTML extraction, file_import for bulk drops, manual_entry for human input, synthetic_test for fixtures / load tests (excluded from production aggregates).
inference_reasonstring
Explanation for inferred facts (e.g., 'Sibling of Truitt who is child of Troy/Amanda implies shared parents')
evidenceEvidence[]
Zero or more Evidence snippets — the actual source bytes the claim was extracted from. The matcher doesn't read these, but audit + curation tools surface them.
thresholdsMatchingThresholds
Configurable thresholds for matching decisions.
attachnumber
Score >= attach: merge with existing
duplicate_linknumber
Score >= duplicate_link: create + potential_duplicate_of
reprocessReprocessConfig
Configuration for reprocessing a source.
modeReprocessMode
Mode for reprocessing FactGraphs.
target_source_idstring
Source to supersede/purge (required for non-NORMAL modes)
target_source_version_idstring
Specific source version to replace. Optional; null supersedes the latest version.
confirm_purgeboolean
Must be True for PURGE mode (safety check)
objectsObjectInput[]
Objects to ingest. May reference existing rows by object_id. At least one of objects or relationships must be non-empty.
object_idstring
Known object's 26-char ULID. When set, the matching pipeline is bypassed — the row is treated as a reference + targets for property attach. Mutually non-exclusive with client_temp_id (which can act as an alias).
client_temp_idstring
Caller-chosen correlation token. Required for new objects (no object_id); for known objects, acts as an alias other relationships in this FactGraph can reference.
object_classstring
Ontology class code (e.g., Person, Company, Address). Required for new objects (no object_id); optional for known references where the DB row already names the class.
namestring
Display name. Server derives name_norm + nysiis_key from this value; the matcher's name signals score against those derived columns. Required for new objects.
name_formatstring: first_last | last_first
Name format hint for Person parsing. 'last_first' for FAA-style 'SMITH JOHN' format.
statusstring: active | inactive | merged
Lifecycle state at commit time. active is the default and the only value most callers set. inactive for soft-deleted imports; merged for retroactive deduplication backfills.
propertiesProperty[]
Properties to attach to the object. For new objects, these are the initial property set; for known references, they're additive (unless replace_properties=true).
replace_propertiesboolean
If true, replaces existing properties with same names instead of adding to them.
external_recordExternalRecordInput
An ExternalSystemRecord identity: the object's id in a source system, e.g. a PracticePanther contact. Within a firm it is exact: an existing record attaches to its object with no fuzzy decision; a new one creates the object and the record together.
provenanceProvenance
Data lineage information. Tracks where data came from.
actionObjectAction
Explicit actions for FactGraph v2.0 objects. When an action is specified, the object bypasses the matching pipeline and is routed directly to the specified operation.
target_refstring
v2.0: For MERGE_INTO action - target object_id or client_temp_id to merge into
delete_propertiesstring[]
v2.0: For DELETE_PROPERTY action — list of property names (matching the ontology's property_definitions.name) to delete from the existing object.
relationshipsRelationshipInput[]
Relationships to ingest. Each edge's source_ref + target_ref resolves through this FactGraph's client_temp_id namespace first, then through existing object_ids.
edge_idstring
Known edge's 26-char ULID. When set, the matcher skips edge creation and treats this as a reference (e.g. for property attach).
client_temp_idrequiredstring
Caller-chosen correlation token for this edge. Returned on the decision report so callers can match decisions back to input edges.
actionstring: assert | retire
assert (default): create the edge, or update the current one with the same type + endpoints. retire: end the current edge — named by edge_id, or by source_ref + target_ref + relationship_type — by setting valid_to (this relationship's valid_to, or the commit date). The edge stays in history; current-state reads drop it. Use it when a source stops listing a party.
source_refrequiredstring
Source endpoint reference. Either an object_id (26-char ULID) of a known DB row, OR a client_temp_id of an object in this same FactGraph. Resolved at the Block stage.
target_refrequiredstring
Target endpoint reference. Same resolution rules as source_ref.
source_idstring
Server-resolved object_id for the source endpoint. Populated by the matcher during Block stage; callers do not set this.
target_idstring
Server-resolved object_id for the target endpoint. Populated by the matcher; not bound by callers.
relationship_typerequiredstring
Ontology relationship type (e.g., employment, headquartered_at, shareholder_of). The (source_class, target_class) pair must appear in public.allowed_pairs for this type — VAL006 on miss.
source_descriptorstring
Free-text role label for the source side. When omitted, the ontology's relationship_types.source_descriptor default applies.
target_descriptorstring
Free-text role label for the target side. Defaults from ontology when omitted.
propertiesProperty[]
Properties attached to this edge — additive unless replace_properties=true.
replace_propertiesboolean
If true, replaces existing properties with same names instead of adding to them.
valid_fromstring (date)
Inclusive start of validity interval. Null = open-ended past.
valid_tostring (date)
Exclusive end of the validity interval: the first day it no longer holds. Null = currently active.
confidence_scorenumber
0.0-1.0 confidence in the edge existing. Null = unspecified.
statusstring: active | inactive
Initial edge status at commit time. active is the default; inactive is for retroactive soft-delete imports.
provenanceProvenance
Data lineage information. Tracks where data came from.
scopestring: public | tenant | all
public, the caller's tenant schema, or both. Default is both.
Responses
200GraphSearchResponse
Ranked matches. The list is empty when nothing cleared the floor.
scoperequiredstring: public | tenant | all
Scope that was searched.
matchesrequiredSearchHit[]
Ranked subgraphs at or above the near-match floor. Empty when nothing cleared it.
rankrequiredinteger
1-based rank by composite score, across the requested scope.
schemarequiredstring
Workspace binding selected by the server. Callers do not send an internal schema name.
scorerequiredstring
Composite score from find_cross_schema_match.
decisionrequiredstring: match | near_match
match at 0.55 or above, near_match at 0.40 or above. A person below 0.40 is omitted; the matches list is empty.
seed_namerequiredstring
Submitted person this hit was scored against.
nodesrequiredSearchNode[]
The query person and the matched person.
relationshipsrequiredSearchRelationship[]
Relationship legs that contributed to the score.
400
The FactGraph has no named Person.
401
Missing or invalid bearer.
403
The plan does not include graph.search, or the credential cannot call this route.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/graph/search' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"factgraph": {
"ontology_version": "<ontology_version>",
"objects": [
{
"client_temp_id": "<client_temp_id>",
"object_class": "<object_class>",
"name": "<name>",
"target_ref": "<target_ref>"
}
],
"relationships": [
{
"client_temp_id": "<client_temp_id>",
"source_ref": "<source_ref>",
"target_ref": "<target_ref>",
"relationship_type": "<relationship_type>"
}
]
}
}'POST /v1/graph/resolve
Resolve a small FactGraph synchronously
Runs the Propose pipeline (Validate → Normalize → Block → Score → Decide → Commit) in the request and returns the decision report: attach, create, or needs_review with its candidates. Same matching code and the same per-name locks as POST /v1/graph/propose, so both paths make the same decision for the same input. At most 25 objects + relationships (VAL019); use Propose for bulk. Resending a factgraph_id returns the stored report. A request that fails validation writes nothing and frees its factgraph_id.
Send Authorization: Bearer with an API key or a portal session token.
Request body
ProposeRequest, required.
tenant_idrequiredstring
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
factgraphrequiredFactGraph
A complete graph of facts from a single source observation. The top-level input to the Propose API. Supports both v1.2 (implicit) and v2.0 (explicit) schema versions. - No schema_version field = v1.2 behavior (matching pipeline) - schema_version = "2.0" enables explicit object actions
schema_versionstring
v2.0: Schema version (e.g., '2.0'). Omit or null for v1.2 compatibility.
source_dataobject
v2.0: Free-form JSON preserved with FactGraph (suggested <1000 chars, not enforced)
factgraph_idstring
Client-provided ID for tracking. Used for idempotency: re-submitting a factgraph_id this tenant has already submitted returns the existing proposal_id and enqueues nothing, however long ago the first submission was. The same id under another tenant is a separate proposal. Treat as a stable correlation key, e.g. <runId>:<chunk> or a content hash.
ontology_versionrequiredstring
Caller-pinned ontology version (integer '34' or semver '7.0.0'). The Validate stage rejects with VAL002 if the pinned version dropped a class or property still referenced in this payload. Recommended pattern: pin a specific version + bump deliberately in a coordinated rollout.
default_provenanceProvenance
Data lineage information. Tracks where data came from.
source_idrequiredstring
26-char ULID of a registered source. Must exist in <schema>.sources — the Propose route pre-validates and returns 400/VAL002 on miss before the worker runs.
extraction_confidencenumber
0.0-1.0 confidence in the extraction step itself (how sure was the parser that it read the source correctly?). Distinct from each Property's confidence_score, which scores the semantic claim.
extracted_atstring (date-time)
ISO 8601 timestamp when the value was extracted from the source. Distinct from created_at (DB insert time).
acquisition_methodstring: api_call | db_query | web_scrape | file_import | manual_entry | synthetic_test
How the data was acquired. api_call for live REST/GraphQL pulls, db_query for upstream DB reads, web_scrape for HTML extraction, file_import for bulk drops, manual_entry for human input, synthetic_test for fixtures / load tests (excluded from production aggregates).
inference_reasonstring
Explanation for inferred facts (e.g., 'Sibling of Truitt who is child of Troy/Amanda implies shared parents')
evidenceEvidence[]
Zero or more Evidence snippets — the actual source bytes the claim was extracted from. The matcher doesn't read these, but audit + curation tools surface them.
thresholdsMatchingThresholds
Configurable thresholds for matching decisions.
attachnumber
Score >= attach: merge with existing
duplicate_linknumber
Score >= duplicate_link: create + potential_duplicate_of
reprocessReprocessConfig
Configuration for reprocessing a source.
modeReprocessMode
Mode for reprocessing FactGraphs.
target_source_idstring
Source to supersede/purge (required for non-NORMAL modes)
target_source_version_idstring
Specific source version to replace. Optional; null supersedes the latest version.
confirm_purgeboolean
Must be True for PURGE mode (safety check)
objectsObjectInput[]
Objects to ingest. May reference existing rows by object_id. At least one of objects or relationships must be non-empty.
object_idstring
Known object's 26-char ULID. When set, the matching pipeline is bypassed — the row is treated as a reference + targets for property attach. Mutually non-exclusive with client_temp_id (which can act as an alias).
client_temp_idstring
Caller-chosen correlation token. Required for new objects (no object_id); for known objects, acts as an alias other relationships in this FactGraph can reference.
object_classstring
Ontology class code (e.g., Person, Company, Address). Required for new objects (no object_id); optional for known references where the DB row already names the class.
namestring
Display name. Server derives name_norm + nysiis_key from this value; the matcher's name signals score against those derived columns. Required for new objects.
name_formatstring: first_last | last_first
Name format hint for Person parsing. 'last_first' for FAA-style 'SMITH JOHN' format.
statusstring: active | inactive | merged
Lifecycle state at commit time. active is the default and the only value most callers set. inactive for soft-deleted imports; merged for retroactive deduplication backfills.
propertiesProperty[]
Properties to attach to the object. For new objects, these are the initial property set; for known references, they're additive (unless replace_properties=true).
replace_propertiesboolean
If true, replaces existing properties with same names instead of adding to them.
external_recordExternalRecordInput
An ExternalSystemRecord identity: the object's id in a source system, e.g. a PracticePanther contact. Within a firm it is exact: an existing record attaches to its object with no fuzzy decision; a new one creates the object and the record together.
provenanceProvenance
Data lineage information. Tracks where data came from.
actionObjectAction
Explicit actions for FactGraph v2.0 objects. When an action is specified, the object bypasses the matching pipeline and is routed directly to the specified operation.
target_refstring
v2.0: For MERGE_INTO action - target object_id or client_temp_id to merge into
delete_propertiesstring[]
v2.0: For DELETE_PROPERTY action — list of property names (matching the ontology's property_definitions.name) to delete from the existing object.
relationshipsRelationshipInput[]
Relationships to ingest. Each edge's source_ref + target_ref resolves through this FactGraph's client_temp_id namespace first, then through existing object_ids.
edge_idstring
Known edge's 26-char ULID. When set, the matcher skips edge creation and treats this as a reference (e.g. for property attach).
client_temp_idrequiredstring
Caller-chosen correlation token for this edge. Returned on the decision report so callers can match decisions back to input edges.
actionstring: assert | retire
assert (default): create the edge, or update the current one with the same type + endpoints. retire: end the current edge — named by edge_id, or by source_ref + target_ref + relationship_type — by setting valid_to (this relationship's valid_to, or the commit date). The edge stays in history; current-state reads drop it. Use it when a source stops listing a party.
source_refrequiredstring
Source endpoint reference. Either an object_id (26-char ULID) of a known DB row, OR a client_temp_id of an object in this same FactGraph. Resolved at the Block stage.
target_refrequiredstring
Target endpoint reference. Same resolution rules as source_ref.
source_idstring
Server-resolved object_id for the source endpoint. Populated by the matcher during Block stage; callers do not set this.
target_idstring
Server-resolved object_id for the target endpoint. Populated by the matcher; not bound by callers.
relationship_typerequiredstring
Ontology relationship type (e.g., employment, headquartered_at, shareholder_of). The (source_class, target_class) pair must appear in public.allowed_pairs for this type — VAL006 on miss.
source_descriptorstring
Free-text role label for the source side. When omitted, the ontology's relationship_types.source_descriptor default applies.
target_descriptorstring
Free-text role label for the target side. Defaults from ontology when omitted.
propertiesProperty[]
Properties attached to this edge — additive unless replace_properties=true.
replace_propertiesboolean
If true, replaces existing properties with same names instead of adding to them.
valid_fromstring (date)
Inclusive start of validity interval. Null = open-ended past.
valid_tostring (date)
Exclusive end of the validity interval: the first day it no longer holds. Null = currently active.
confidence_scorenumber
0.0-1.0 confidence in the edge existing. Null = unspecified.
statusstring: active | inactive
Initial edge status at commit time. active is the default; inactive is for retroactive soft-delete imports.
provenanceProvenance
Data lineage information. Tracks where data came from.
source_idstring
Optional source identifier — pinned in the SQS pointer so the worker can resolve source-class config overrides.
schemastring
Workspace binding selected by the server. Callers do not send an internal schema name.
Responses
200DecisionReport
Committed; body is the decision report.
proposal_idrequiredstring
ULID echoed back from the POST request.
tenant_idrequiredstring
Tenant slug from the POST request.
submitted_atrequiredstring
ISO 8601 timestamp of the POST. String, not datetime, so the worker's exact wire format (Z-suffixed UTC) round-trips.
processed_atrequiredstring
ISO 8601 timestamp the worker finished (or failed) processing. String for the same reason as submitted_at. Subtract submitted_at to get end-to-end latency.
statusrequiredstring: completed | failed
Pipeline outcome. completed means every object reached Commit; failed means a stage raised before Commit. Determines which optional fields are populated.
objectsDecisionObject[]
Per-object decisions when status='completed'. Empty (or omitted) on status='failed'.
ref_idrequiredstring
Caller-supplied client_temp_id for the object — the key that ties this decision back to the input FactGraph.
decisionrequiredstring
Decision outcome. One of create (no confident match, new object minted), attach (matched + merged into existing), reference (known object skipped from matching), pending (high-scoring candidate below attach threshold — needs human review), and the v2 passthrough actions update_property / delete_property / deprecate / merge_into.
final_object_idstring
ULID of the resulting graph object (the newly created one for create; the matched/target object for attach / reference / merge_into). Omitted when no object was produced (e.g. pending review).
audit_idstring
ULID of the audit row written for this decision. Use to look up the full Match → Decide audit trail.
properties_addedinteger
Number of properties added during Commit. Includes both newly-bound properties on a create and merged properties on an attach.
properties_updatedinteger
Number of values already on the object whose valid_from / valid_to this proposal changed, e.g. an attach that re-proposes a prior name with the date it stopped being used.
needs_reviewboolean
True when the decision needs human review (pending outcome OR create with a potential_duplicate_of hint). Curation tools surface these via GET /v1/objects?needs_review=true.
reasonstring
Human-readable explanation. For attach/pending outcomes, names the matched-on signals + confidence; for create outcomes, typically omitted.
potential_duplicate_ofstring
ULID of an existing object the matcher flagged as a near-but-failing duplicate (set when a create happens with a high-scoring top candidate that didn't clear all gates).
candidatesobject[]
Every object the matcher scored, best first, each with its object_id, score and signals. Populated only for pending, needs_review or potential_duplicate_of decisions; empty otherwise.
object_countinteger
Length of objects. Always present so callers can branch without instantiating the list.
relationshipsDecisionRelationship[]
Per-relationship outcomes when status='completed', in FactGraph order.
client_temp_idrequiredstring
The relationship's client_temp_id.
relationship_typerequiredstring
The edge type proposed.
outcomerequiredstring: created | deduped | updated | retired | not_found
created — a new edge. deduped — matched a current edge, nothing changed. updated — matched a current edge and changed it. retired — action: retire set valid_to. not_found — action: retire named no current edge in your tenant.
edge_idstring
The edge written or matched; null for not_found.
changesobject[]
{field, old, new} per change on updated / retired, e.g. valid_to or properties.employment.job_title.
relationship_countinteger
Length of relationships.
errorFailureDetail
Error block written by the worker when processing fails.
typerequiredstring
Python exception class name. Common values: ValidationError (Validate stage), MatchingError (Block / Match), CommitError (DB constraint), SystemError (config / queue).
messagerequiredstring
Truncated exception message (max 1000 chars at write time). Includes any JSON-path or hint the validator produced; the full structured envelope is on the audit trail.
codestring
Stable error code (VAL017, MAT001, …; see the errors guide) when the stage raised a pipeline error. Branch on this, not on message. Absent for unexpected exceptions.
pathstring[]
JSON path to the offending field, when known.
hintstring
How to fix it, when known.
detailsobject
Structured context for the error, when any.
400
A VAL* pipeline error.
401
Auth missing or invalid.
403
Wrong firm, or no graph scope.
409
factgraph_id still in progress.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/graph/resolve' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"factgraph": {
"ontology_version": "<ontology_version>",
"objects": [
{
"client_temp_id": "<client_temp_id>",
"object_class": "<object_class>",
"name": "<name>",
"target_ref": "<target_ref>"
}
],
"relationships": [
{
"client_temp_id": "<client_temp_id>",
"source_ref": "<source_ref>",
"target_ref": "<target_ref>",
"relationship_type": "<relationship_type>"
}
]
}
}'Relationships
Create and manage relationships and the properties on them.
POST /v1/relationships
Create a directed, typed relationship between two objects
Direct-write a single edge between source_id and target_id. Both object ids must already exist in the caller's tenant; the DB's foreign-key constraints on relationships.source_id / target_id reject orphans. Soft validation: the route looks up both endpoints' class_code and checks (source_class, target_class) against the ontology's allowed_pairs for the requested relationship_type. Disallowed pairs return HTTP 422 with code=VAL006 and a body matching the Propose pipeline's error envelope (error / code / message / details) — so trust-mode and pipeline rejections look identical to consumers. Trust-mode otherwise applies: source_descriptor and target_descriptor (free-text role labels — "CEO of", "registered in") are taken from the caller without normalization. Self-loops are accepted when the ontology has a (class, class) row for the type. Date-range ordering (valid_to >= valid_from when both are set) is enforced by Pydantic — the DB does not. An edge_id (ULID) is generated server-side; callers should NOT supply one. Idempotent under retry. Two POSTs with the same (tenant_id, source_id, target_id, relationship_type) return the same 201 body — the second call finds the first's edge under an advisory lock and returns its existing edge_id instead of writing a duplicate. Pre-existing descriptors and temporal bounds win over the new call's values on a dedup hit. Edge properties apply on a repeat. A dedup hit writes the call's properties to the existing edge: a name the edge lacks is added, a name with a different value is updated, and an identical value is left alone. edge_properties_written lists added and updated names (null when the call sent no properties), so a repeat POST is a valid way to update edge properties.
Send Authorization: Bearer with an API key or a portal session token.
Request body
RelationshipCreate, required.
tenant_idrequiredstring
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
source_idrequiredstring
Source endpoint's existing object_id. The DB's FK constraint on relationships.source_id rejects unknown ULIDs at INSERT time.
target_idrequiredstring
Target endpoint's existing object_id. Edges are directed — source_id and target_id are not interchangeable.
relationship_typerequiredstring
Ontology-defined edge type (headquartered_at, employment, shareholder_of, ...). Must exist in public.relationship_types. The (source_class, target_class) pair must appear in public.allowed_pairs for this type — disallowed pairs are rejected with HTTP 422 + code=VAL006.
source_descriptorrequiredstring
Free-text role label for the source side of the edge — what the source object is *to* the target (e.g. "employer", "shareholder", "registered in"). Not normalized; treat as opaque text in queries.
target_descriptorrequiredstring
Free-text role label for the target side (e.g. "employee", "shareholding", "jurisdiction"). Not normalized.
valid_fromstring (date)
Inclusive start of the interval the edge is in effect. Null = open-ended past ("as far back as we know"). The model validator enforces valid_to >= valid_from when both are set.
valid_tostring (date)
Exclusive end of the interval: the first day the edge no longer holds. Null = open-ended future (edge is current). An edge is current when valid_to IS NULL OR valid_to > today, so valid_to = today ends it now.
confidence_scoreobject
0-1 confidence in the edge existing (1.0 = certain). Defaults server-side to 1.0 when omitted on trust-mode writes; set explicitly when you have a meaningful score.
origin_source_idstring
The source creating this edge (Client API only): one of the firm's sources or the shared list (GET /v1/sources). Its properties without a source_id take this source. Not source_id, which is the source endpoint. Ignored on a dedup hit (the existing edge keeps its source).
propertiesPropertyValue-Input[]
Edge properties. Each name must be declared for relationship_type in this surface's relationship_properties (400 VAL002) and prop_type must match its data_type (422 VAL004). Written in the same transaction as the edge. When the request dedupes onto an existing edge, the edge takes these properties: names it lacks are added, changed values are updated, identical ones left alone; edge_properties_written reports which.
namerequiredstring
Ontology property name (e.g. company.industry, person.date_of_birth). Lookups are case-sensitive.
prop_typerequiredstring: ArrayPropertyBaseType | BooleanPropertyBaseType | DatePropertyBaseType | DecimalPropertyBaseType | FloatPropertyBaseType | IntegerPropertyBaseType
The value's data type — selects which val_* cell receives the value. Must match the ontology's property_definitions.data_type for name; otherwise the server rejects with VAL004.
val_textstring
Populated when prop_type=StringPropertyBaseType. Exactly one val_* must be set per request — supplying zero or more than one is a 422.
val_intinteger
Populated when prop_type=IntegerPropertyBaseType. Use val_num for fixed-precision currency / big-decimal values.
val_floatnumber
Populated when prop_type=FloatPropertyBaseType. Avoid for financial values — use val_num to preserve precision.
val_datestring (date)
Populated when prop_type=DatePropertyBaseType. ISO 8601 calendar date (no time zone).
val_boolboolean
Populated when prop_type=BooleanPropertyBaseType.
val_timestampstring (date-time)
Populated when prop_type=TimestampPropertyBaseType. ISO 8601 with timezone; UTC recommended.
val_jsonobject
Populated when prop_type=ArrayPropertyBaseType. Arbitrary JSON — typically arrays, hence the type name. Validated structurally only.
val_numobject
Populated when prop_type=DecimalPropertyBaseType. Use for currency, big-decimal scientific quantities, or any value where float rounding is unacceptable.
confidence_scoreobject
0-1 confidence in the value (1.0 = certain, 0.0 = guessed). Defaults to 1.0 server-side when omitted, matching the matcher's commit-time default. Set explicitly when you have a meaningful score from the source.
source_idstring
The source this value comes from, so consumers can tell which rows a source owns. Must be a registered source (unknown → 400 VAL005, as Propose). Omitted → the value has its object's source (origin_source_id,); a source_id equal to the object's is stored as null.
Responses
201RelationshipSummary
Edge created. Response body is the persisted RelationshipSummary including the server-minted edge_id — store this if you'll need to fetch or reference the edge later.
edge_idrequiredstring
Relationship row's 26-character ULID. Use in /v1/relationships/{edge_id} for direct fetch.
source_idrequiredstring
Source endpoint's object_id.
target_idrequiredstring
Target endpoint's object_id.
relationship_typerequiredstring
Edge type from the ontology. Stable string identifier (see GET /v1/ontology/relationship-types).
source_descriptorrequiredstring
Free-text role label for the source side. Echo of the value supplied at create time; not normalized.
target_descriptorrequiredstring
Free-text role label for the target side.
valid_fromstring (date)
Inclusive start of validity interval; null = open-ended past.
valid_tostring (date)
Exclusive end of the validity interval: the first day it no longer holds; null = currently active.
confidence_scorestring
0-1 confidence; null = unspecified.
statusrequiredstring
Edge lifecycle: active (the default), superseded (matcher replaced this edge in a Propose merge), or withdrawn (source retracted). Filter for active for current-state queries.
origin_source_idstring
The source that created this edge (Client API only). An edge property whose source_id is null has this source.
edge_properties_writtenEdgePropertiesWritten
Which of a write's edge properties changed the edge.
addedstring[]
Names the edge didn't have; now set.
updatedstring[]
Names the edge had with a different value (or prop_type); now the call's value. A name sent with the value the edge already holds is in neither list.
400
One or both of source_id / target_id is unknown in this tenant scope. The body lists which.
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm is a 404, like an unknown id.
409ErrorEnvelope
COM004: the type is single-cardinality on one side and that endpoint already has a current edge of it (e.g. a second owner for an ExternalSystemRecord: has_integration_record is one owner per record). details.conflicting_edge_id names it; end it (PATCH valid_to) or delete it first. Repeating the same edge is a dedup hit, not a conflict.
422
Body-shape failure (Pydantic) OR ontology-disallowed (relationship_type, source_class, target_class) tuple. The latter carries code=VAL006; the details block names the offending classes so callers can pick a valid type.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/relationships' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"source_id": "<source_id>",
"target_id": "<target_id>",
"relationship_type": "<relationship_type>",
"source_descriptor": "<source_descriptor>",
"target_descriptor": "<target_descriptor>"
}'GET /v1/relationships/{edge_id}
Fetch a single relationship by edge id
Look up one edge by edge_id. Returns the same RelationshipSummary shape that POST returns: endpoint ids, type, descriptors, temporal bounds, confidence, and status. 404 is returned both for edges that don't exist and for edges in a different tenant — the tenant_id filter on the WHERE clause hides foreign-tenant rows from the lookup, so callers can't probe cross-tenant by id. There is no batch-by-ids variant on this endpoint; for edges incident on a known object, use GET /v1/objects/{object_id} (Objects group) which includes the object's relationships in the detail response, or POST /graph/query (Graph group) for general edge filtering.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
edge_idrequiredpath · string
ULID of the edge row.
tenant_idrequiredquery · string
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
Responses
200RelationshipSummary
Edge found. Body is a RelationshipSummary for the row, including its current status (active / superseded / withdrawn).
edge_idrequiredstring
Relationship row's 26-character ULID. Use in /v1/relationships/{edge_id} for direct fetch.
source_idrequiredstring
Source endpoint's object_id.
target_idrequiredstring
Target endpoint's object_id.
relationship_typerequiredstring
Edge type from the ontology. Stable string identifier (see GET /v1/ontology/relationship-types).
source_descriptorrequiredstring
Free-text role label for the source side. Echo of the value supplied at create time; not normalized.
target_descriptorrequiredstring
Free-text role label for the target side.
valid_fromstring (date)
Inclusive start of validity interval; null = open-ended past.
valid_tostring (date)
Exclusive end of the validity interval: the first day it no longer holds; null = currently active.
confidence_scorestring
0-1 confidence; null = unspecified.
statusrequiredstring
Edge lifecycle: active (the default), superseded (matcher replaced this edge in a Propose merge), or withdrawn (source retracted). Filter for active for current-state queries.
origin_source_idstring
The source that created this edge (Client API only). An edge property whose source_id is null has this source.
edge_properties_writtenEdgePropertiesWritten
Which of a write's edge properties changed the edge.
addedstring[]
Names the edge didn't have; now set.
updatedstring[]
Names the edge had with a different value (or prop_type); now the call's value. A name sent with the value the edge already holds is in neither list.
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm, or an edge in another firm, is a 404 like an unknown id.
404
No edge with that id in the caller's tenant scope.
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/relationships/{edge_id}?tenant_id=<tenant_id>' \
-H 'Authorization: Bearer <api_key_or_session_token>'PATCH /v1/relationships/{edge_id}
Set a relationship's valid_from / valid_to
Sets valid_from and/or valid_to on one edge in your firm. Setting valid_to ends the edge: /v1/graph/query with valid_time: current stops returning it, all still does. The row is never deleted here. Re-opening an ended edge (clearing or moving valid_to so it is current again) is checked like a create: if it would give an endpoint a second current edge of a single-cardinality type, it is refused 409 COM004 naming the existing edge, and nothing changes.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
edge_idrequiredpath · string
Edge ULID.
Request body
RelationshipUpdate, required.
tenant_idrequiredstring
Must equal the bearer's firm.
valid_fromstring (date)
When the relationship began.
valid_tostring (date)
When it ended. Setting it ends the edge; the row stays as history.
reasonstring
Why, for the audit row (e.g. 'party withdrew').
Responses
200RelationshipSummary
Updated; body is the edge as it now stands.
edge_idrequiredstring
Relationship row's 26-character ULID. Use in /v1/relationships/{edge_id} for direct fetch.
source_idrequiredstring
Source endpoint's object_id.
target_idrequiredstring
Target endpoint's object_id.
relationship_typerequiredstring
Edge type from the ontology. Stable string identifier (see GET /v1/ontology/relationship-types).
source_descriptorrequiredstring
Free-text role label for the source side. Echo of the value supplied at create time; not normalized.
target_descriptorrequiredstring
Free-text role label for the target side.
valid_fromstring (date)
Inclusive start of validity interval; null = open-ended past.
valid_tostring (date)
Exclusive end of the validity interval: the first day it no longer holds; null = currently active.
confidence_scorestring
0-1 confidence; null = unspecified.
statusrequiredstring
Edge lifecycle: active (the default), superseded (matcher replaced this edge in a Propose merge), or withdrawn (source retracted). Filter for active for current-state queries.
origin_source_idstring
The source that created this edge (Client API only). An edge property whose source_id is null has this source.
edge_properties_writtenEdgePropertiesWritten
Which of a write's edge properties changed the edge.
addedstring[]
Names the edge didn't have; now set.
updatedstring[]
Names the edge had with a different value (or prop_type); now the call's value. A name sent with the value the edge already holds is in neither list.
404
No such edge in your firm.
422
valid_to before valid_from.
Example
curl -sS -X PATCH 'https://client.cloudswift.app/v1/relationships/{edge_id}' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>"
}'DELETE /v1/relationships/{edge_id}
Hard-delete a relationship (added in error)
Removes the edge and its edge properties; /v1/graph/query with valid_time: all no longer returns it. For an edge that should never have existed — to end a real relationship, PATCH valid_to instead. Writes an id-level audit row with your reason.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
edge_idrequiredpath · string
Edge ULID.
tenant_idrequiredquery · string
Must equal the bearer's firm.
reasonquery · string
Why, for the audit row.
Responses
200DeleteResult
Deleted; body lists what went and the audit id.
audit_idrequiredstring
The direct_write_audit row for this delete.
object_idstring
The deleted object, for an object delete.
edge_idsstring[]
Every deleted edge.
properties_removedinteger
Object properties removed.
edge_properties_removedinteger
Edge properties removed.
esr_deletedstring[]
Object deletes only (always empty for DELETE /v1/relationships/{edge_id}, which cascades nothing): ExternalSystemRecords the deleted object reached by has_integration_record that had no other edge left, so were deleted with it; each has its own audit row.
esr_keptstring[]
Object deletes only (always empty for a relationship delete): those ESRs that still have other edges (e.g. another object's has_integration_record), so were kept.
404
No such edge in your firm.
Example
curl -sS -X DELETE 'https://client.cloudswift.app/v1/relationships/{edge_id}?tenant_id=<tenant_id>' \
-H 'Authorization: Bearer <api_key_or_session_token>'GET /v1/relationships/{edge_id}/properties
List an edge's properties
Every property on one edge in your firm, by name, with its value read from whichever val_* cell is set. Use the edge_property_id to PATCH or DELETE one.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
edge_idrequiredpath · string
Edge ULID.
tenant_idrequiredquery · string
Must equal the bearer's firm.
Responses
200EdgeProperty[]
The edge's properties, sorted by name (may be empty).
edge_property_idrequiredstring
ULID of the edge property.
edge_idrequiredstring
The edge it belongs to.
namerequiredstring
Property id from relationship_properties.
prop_typerequiredstring
Its data type.
valueobject
The value, from whichever val_* column is set.
confidence_scorenumber
0–1 confidence.
source_idstring
The value's source, only where it differs from the edge's origin_source_id: null means the edge's source.
404
No such edge in your firm.
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/relationships/{edge_id}/properties?tenant_id=<tenant_id>' \
-H 'Authorization: Bearer <api_key_or_session_token>'POST /v1/relationships/{edge_id}/properties
Add one property to an edge
Validated against relationship_properties for the edge's type (undeclared → 400 VAL002, wrong prop_type → 422 VAL004). An edge has one value per name and source (source_id defaults to the edge's): if it already has this one from this source, 409 — PATCH it.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
edge_idrequiredpath · string
Edge ULID.
Request body
EdgePropertyCreate, required.
namerequiredstring
Ontology property name (e.g. company.industry, person.date_of_birth). Lookups are case-sensitive.
prop_typerequiredstring: ArrayPropertyBaseType | BooleanPropertyBaseType | DatePropertyBaseType | DecimalPropertyBaseType | FloatPropertyBaseType | IntegerPropertyBaseType
The value's data type — selects which val_* cell receives the value. Must match the ontology's property_definitions.data_type for name; otherwise the server rejects with VAL004.
val_textstring
Populated when prop_type=StringPropertyBaseType. Exactly one val_* must be set per request — supplying zero or more than one is a 422.
val_intinteger
Populated when prop_type=IntegerPropertyBaseType. Use val_num for fixed-precision currency / big-decimal values.
val_floatnumber
Populated when prop_type=FloatPropertyBaseType. Avoid for financial values — use val_num to preserve precision.
val_datestring (date)
Populated when prop_type=DatePropertyBaseType. ISO 8601 calendar date (no time zone).
val_boolboolean
Populated when prop_type=BooleanPropertyBaseType.
val_timestampstring (date-time)
Populated when prop_type=TimestampPropertyBaseType. ISO 8601 with timezone; UTC recommended.
val_jsonobject
Populated when prop_type=ArrayPropertyBaseType. Arbitrary JSON — typically arrays, hence the type name. Validated structurally only.
val_numobject
Populated when prop_type=DecimalPropertyBaseType. Use for currency, big-decimal scientific quantities, or any value where float rounding is unacceptable.
confidence_scoreobject
0-1 confidence in the value (1.0 = certain, 0.0 = guessed). Defaults to 1.0 server-side when omitted, matching the matcher's commit-time default. Set explicitly when you have a meaningful score from the source.
source_idstring
The source this value comes from, so consumers can tell which rows a source owns. Must be a registered source (unknown → 400 VAL005, as Propose). Omitted → the value has its object's source (origin_source_id,); a source_id equal to the object's is stored as null.
tenant_idrequiredstring
Must equal the bearer's firm.
reasonstring
Why, for the audit row.
Responses
201EdgeProperty
Added; body is the new edge property with its id.
edge_property_idrequiredstring
ULID of the edge property.
edge_idrequiredstring
The edge it belongs to.
namerequiredstring
Property id from relationship_properties.
prop_typerequiredstring
Its data type.
valueobject
The value, from whichever val_* column is set.
confidence_scorenumber
0–1 confidence.
source_idstring
The value's source, only where it differs from the edge's origin_source_id: null means the edge's source.
404
No such edge in your firm.
409
Already set from this source.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/relationships/{edge_id}/properties' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "<name>",
"prop_type": "ArrayPropertyBaseType",
"tenant_id": "<tenant_id>"
}'PATCH /v1/edge-properties/{edge_property_id}
Change one edge property's value
Replaces the value, with the same validation as on add. name must match the property's own name, and source_id must be omitted: a value keeps its source (422 VAL009 otherwise).
Send Authorization: Bearer with an API key or a portal session token.
Parameters
edge_property_idrequiredpath · string
Edge property ULID.
Request body
EdgePropertyUpdate, required.
namerequiredstring
Ontology property name (e.g. company.industry, person.date_of_birth). Lookups are case-sensitive.
prop_typerequiredstring: ArrayPropertyBaseType | BooleanPropertyBaseType | DatePropertyBaseType | DecimalPropertyBaseType | FloatPropertyBaseType | IntegerPropertyBaseType
The value's data type — selects which val_* cell receives the value. Must match the ontology's property_definitions.data_type for name; otherwise the server rejects with VAL004.
val_textstring
Populated when prop_type=StringPropertyBaseType. Exactly one val_* must be set per request — supplying zero or more than one is a 422.
val_intinteger
Populated when prop_type=IntegerPropertyBaseType. Use val_num for fixed-precision currency / big-decimal values.
val_floatnumber
Populated when prop_type=FloatPropertyBaseType. Avoid for financial values — use val_num to preserve precision.
val_datestring (date)
Populated when prop_type=DatePropertyBaseType. ISO 8601 calendar date (no time zone).
val_boolboolean
Populated when prop_type=BooleanPropertyBaseType.
val_timestampstring (date-time)
Populated when prop_type=TimestampPropertyBaseType. ISO 8601 with timezone; UTC recommended.
val_jsonobject
Populated when prop_type=ArrayPropertyBaseType. Arbitrary JSON — typically arrays, hence the type name. Validated structurally only.
val_numobject
Populated when prop_type=DecimalPropertyBaseType. Use for currency, big-decimal scientific quantities, or any value where float rounding is unacceptable.
confidence_scoreobject
0-1 confidence in the value (1.0 = certain, 0.0 = guessed). Defaults to 1.0 server-side when omitted, matching the matcher's commit-time default. Set explicitly when you have a meaningful score from the source.
source_idstring
The source this value comes from, so consumers can tell which rows a source owns. Must be a registered source (unknown → 400 VAL005, as Propose). Omitted → the value has its object's source (origin_source_id,); a source_id equal to the object's is stored as null.
tenant_idrequiredstring
Must equal the bearer's firm.
reasonstring
Why, for the audit row.
Responses
200EdgeProperty
Updated; body is the edge property with its new value.
edge_property_idrequiredstring
ULID of the edge property.
edge_idrequiredstring
The edge it belongs to.
namerequiredstring
Property id from relationship_properties.
prop_typerequiredstring
Its data type.
valueobject
The value, from whichever val_* column is set.
confidence_scorenumber
0–1 confidence.
source_idstring
The value's source, only where it differs from the edge's origin_source_id: null means the edge's source.
404
No such edge property in your firm.
Example
curl -sS -X PATCH 'https://client.cloudswift.app/v1/edge-properties/{edge_property_id}' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"name": "<name>",
"prop_type": "ArrayPropertyBaseType",
"tenant_id": "<tenant_id>"
}'DELETE /v1/edge-properties/{edge_property_id}
Remove one edge property
Deletes one property from an edge in your firm (the edge stays). Pass reason for the audit row; to change a value instead, PATCH it.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
edge_property_idrequiredpath · string
Edge property ULID.
tenant_idrequiredquery · string
Must equal the bearer's firm.
reasonquery · string
Why, for the audit row.
Responses
204
Removed; nothing to return.
404
No such edge property in your firm.
Example
curl -sS -X DELETE 'https://client.cloudswift.app/v1/edge-properties/{edge_property_id}?tenant_id=<tenant_id>' \
-H 'Authorization: Bearer <api_key_or_session_token>'Propose
Submit a graph for asynchronous matching and read the decision.
GET /v1/graph/propose
List FactGraph proposals
List proposals registered for a firm, newest submitted_at first. Filters combine with AND. What is filterable: status (accepted, completed, failed), source_id, submitted_after (inclusive) and submitted_before (exclusive) on the registration time, has_error (failed or an error message — a failure with no message still matches true), min_object_count, min_relationship_count, contains_object_id (a final_object_id on the decision report), and created_class_code (an object the proposal created). Page: limit is 1–500 (default 20) and offset is ≥ 0. total_count is the match count before paging. Each item includes processed_at and error (the failure message) so a card grid does not need one GET per proposal. A commercial credential sees its own schema. An integrator key must pass tenant_id. Coverage: source_id, counts, class, and error text are recorded from the deploy that shipped. Older rows still list (status falls back to completed when committed_at is set, otherwise accepted) but do not match source_id or created_class_code.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
tenant_idquery · string
Firm to list. Required for an integrator key. A firm-bound key may omit it (the list is that firm) and a mismatch is 404.
statusquery · string: accepted | completed | failed
Pipeline status. accepted is still in flight.
source_idquery · string
Submission source. The request source_id, or default_provenance.source_id when that was omitted.
submitted_afterquery · string (date-time)
Inclusive lower bound on submitted_at (ISO 8601).
submitted_beforequery · string (date-time)
Exclusive upper bound on submitted_at (ISO 8601). A calendar day is submitted_after=<midnight> and submitted_before=<next midnight>.
has_errorquery · boolean
true: failed, or carrying an error message. false: neither. A failed proposal with an empty message still matches true.
min_object_countquery · integer
Keep proposals whose decision report has at least this many objects.
min_relationship_countquery · integer
Keep proposals whose decision report has at least this many relationships.
contains_object_idquery · string
Keep proposals whose report names this final_object_id.
created_class_codequery · string
Keep proposals that created an object of this class (decision = create). Reports written before have no class and do not match.
limitquery · integer
Page size. 1–500; default 20.
offsetquery · integer
Rows to skip. Default 0.
Responses
200ProposalListResponse
A page of proposals matching the filters, newest first, plus total_count before paging.
itemsrequiredProposalListItem[]
This page of proposals, newest submitted_at first.
proposal_idrequiredstring
ULID assigned at submit.
tenant_idrequiredstring
Firm scope, unpadded.
factgraph_idstring
Caller idempotency key, when the submit carried one.
statusrequiredstring: accepted | completed | failed
accepted — registered, worker has not finished. completed / failed — terminal, matching the decision report.
submitted_atrequiredstring (date-time)
When the proposal was registered.
processed_atstring
ISO 8601 time the worker finished. Null while accepted.
source_idstring
Submission source: the request source_id, or default_provenance.source_id when the request omits it. Null on rows registered before.
object_countinteger
Objects on the decision report. Null until the worker finishes.
relationship_countinteger
Relationships on the decision report. Null until the worker finishes.
errorstring
Failure message. Null when the proposal has no error text.
total_countrequiredinteger
Rows matching the filters, before limit/offset.
limitrequiredinteger
Page size that was applied. 1–500; default 20.
offsetrequiredinteger
Rows skipped. Default 0.
400
submitted_after is not earlier than submitted_before, or an integrator key omitted tenant_id.
401
Auth missing or invalid.
404
A firm-bound key passed a tenant_id that is not its firm. Same neutral body as an unknown proposal.
422
A query parameter failed shape checks: source_id or contains_object_id is not a ULID, limit is outside 1–500, or a timestamp is not ISO 8601.
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/graph/propose' \
-H 'Authorization: Bearer <api_key_or_session_token>'POST /v1/graph/propose
Submit a FactGraph for async processing
The route performs only structural Pydantic validation + a single batched sources FK pre-check, then writes the payload to S3 and enqueues a pointer in SQS. Returns 202 Accepted with the assigned proposal_id; clients should poll the GET endpoint until a terminal decision report appears. Idempotency: re-submitting a factgraph_id the tenant has already submitted returns the existing proposal_id (same submitted_at and staging location) and enqueues nothing. Safe to retry on transient network failures without producing duplicate rows. Source pre-validation: every source_id referenced anywhere in the FactGraph (top-level, default_provenance, per-object, per-relationship) must already exist in the tenant's sources table. Unknown source_ids surface here as a synchronous 400 with code=VAL002 and the missing ids in details — preferable to a 5-minute-async commit-time FK failure inside the worker.
Send Authorization: Bearer with an API key or a portal session token.
Request body
ProposeRequest, required.
tenant_idrequiredstring
Tenant slug. Required on Client APIs; must equal the firm_id bound to the bearer (per issue).
factgraphrequiredFactGraph
A complete graph of facts from a single source observation. The top-level input to the Propose API. Supports both v1.2 (implicit) and v2.0 (explicit) schema versions. - No schema_version field = v1.2 behavior (matching pipeline) - schema_version = "2.0" enables explicit object actions
schema_versionstring
v2.0: Schema version (e.g., '2.0'). Omit or null for v1.2 compatibility.
source_dataobject
v2.0: Free-form JSON preserved with FactGraph (suggested <1000 chars, not enforced)
factgraph_idstring
Client-provided ID for tracking. Used for idempotency: re-submitting a factgraph_id this tenant has already submitted returns the existing proposal_id and enqueues nothing, however long ago the first submission was. The same id under another tenant is a separate proposal. Treat as a stable correlation key, e.g. <runId>:<chunk> or a content hash.
ontology_versionrequiredstring
Caller-pinned ontology version (integer '34' or semver '7.0.0'). The Validate stage rejects with VAL002 if the pinned version dropped a class or property still referenced in this payload. Recommended pattern: pin a specific version + bump deliberately in a coordinated rollout.
default_provenanceProvenance
Data lineage information. Tracks where data came from.
source_idrequiredstring
26-char ULID of a registered source. Must exist in <schema>.sources — the Propose route pre-validates and returns 400/VAL002 on miss before the worker runs.
extraction_confidencenumber
0.0-1.0 confidence in the extraction step itself (how sure was the parser that it read the source correctly?). Distinct from each Property's confidence_score, which scores the semantic claim.
extracted_atstring (date-time)
ISO 8601 timestamp when the value was extracted from the source. Distinct from created_at (DB insert time).
acquisition_methodstring: api_call | db_query | web_scrape | file_import | manual_entry | synthetic_test
How the data was acquired. api_call for live REST/GraphQL pulls, db_query for upstream DB reads, web_scrape for HTML extraction, file_import for bulk drops, manual_entry for human input, synthetic_test for fixtures / load tests (excluded from production aggregates).
inference_reasonstring
Explanation for inferred facts (e.g., 'Sibling of Truitt who is child of Troy/Amanda implies shared parents')
evidenceEvidence[]
Zero or more Evidence snippets — the actual source bytes the claim was extracted from. The matcher doesn't read these, but audit + curation tools surface them.
thresholdsMatchingThresholds
Configurable thresholds for matching decisions.
attachnumber
Score >= attach: merge with existing
duplicate_linknumber
Score >= duplicate_link: create + potential_duplicate_of
reprocessReprocessConfig
Configuration for reprocessing a source.
modeReprocessMode
Mode for reprocessing FactGraphs.
target_source_idstring
Source to supersede/purge (required for non-NORMAL modes)
target_source_version_idstring
Specific source version to replace. Optional; null supersedes the latest version.
confirm_purgeboolean
Must be True for PURGE mode (safety check)
objectsObjectInput[]
Objects to ingest. May reference existing rows by object_id. At least one of objects or relationships must be non-empty.
object_idstring
Known object's 26-char ULID. When set, the matching pipeline is bypassed — the row is treated as a reference + targets for property attach. Mutually non-exclusive with client_temp_id (which can act as an alias).
client_temp_idstring
Caller-chosen correlation token. Required for new objects (no object_id); for known objects, acts as an alias other relationships in this FactGraph can reference.
object_classstring
Ontology class code (e.g., Person, Company, Address). Required for new objects (no object_id); optional for known references where the DB row already names the class.
namestring
Display name. Server derives name_norm + nysiis_key from this value; the matcher's name signals score against those derived columns. Required for new objects.
name_formatstring: first_last | last_first
Name format hint for Person parsing. 'last_first' for FAA-style 'SMITH JOHN' format.
statusstring: active | inactive | merged
Lifecycle state at commit time. active is the default and the only value most callers set. inactive for soft-deleted imports; merged for retroactive deduplication backfills.
propertiesProperty[]
Properties to attach to the object. For new objects, these are the initial property set; for known references, they're additive (unless replace_properties=true).
replace_propertiesboolean
If true, replaces existing properties with same names instead of adding to them.
external_recordExternalRecordInput
An ExternalSystemRecord identity: the object's id in a source system, e.g. a PracticePanther contact. Within a firm it is exact: an existing record attaches to its object with no fuzzy decision; a new one creates the object and the record together.
provenanceProvenance
Data lineage information. Tracks where data came from.
actionObjectAction
Explicit actions for FactGraph v2.0 objects. When an action is specified, the object bypasses the matching pipeline and is routed directly to the specified operation.
target_refstring
v2.0: For MERGE_INTO action - target object_id or client_temp_id to merge into
delete_propertiesstring[]
v2.0: For DELETE_PROPERTY action — list of property names (matching the ontology's property_definitions.name) to delete from the existing object.
relationshipsRelationshipInput[]
Relationships to ingest. Each edge's source_ref + target_ref resolves through this FactGraph's client_temp_id namespace first, then through existing object_ids.
edge_idstring
Known edge's 26-char ULID. When set, the matcher skips edge creation and treats this as a reference (e.g. for property attach).
client_temp_idrequiredstring
Caller-chosen correlation token for this edge. Returned on the decision report so callers can match decisions back to input edges.
actionstring: assert | retire
assert (default): create the edge, or update the current one with the same type + endpoints. retire: end the current edge — named by edge_id, or by source_ref + target_ref + relationship_type — by setting valid_to (this relationship's valid_to, or the commit date). The edge stays in history; current-state reads drop it. Use it when a source stops listing a party.
source_refrequiredstring
Source endpoint reference. Either an object_id (26-char ULID) of a known DB row, OR a client_temp_id of an object in this same FactGraph. Resolved at the Block stage.
target_refrequiredstring
Target endpoint reference. Same resolution rules as source_ref.
source_idstring
Server-resolved object_id for the source endpoint. Populated by the matcher during Block stage; callers do not set this.
target_idstring
Server-resolved object_id for the target endpoint. Populated by the matcher; not bound by callers.
relationship_typerequiredstring
Ontology relationship type (e.g., employment, headquartered_at, shareholder_of). The (source_class, target_class) pair must appear in public.allowed_pairs for this type — VAL006 on miss.
source_descriptorstring
Free-text role label for the source side. When omitted, the ontology's relationship_types.source_descriptor default applies.
target_descriptorstring
Free-text role label for the target side. Defaults from ontology when omitted.
propertiesProperty[]
Properties attached to this edge — additive unless replace_properties=true.
replace_propertiesboolean
If true, replaces existing properties with same names instead of adding to them.
valid_fromstring (date)
Inclusive start of validity interval. Null = open-ended past.
valid_tostring (date)
Exclusive end of the validity interval: the first day it no longer holds. Null = currently active.
confidence_scorenumber
0.0-1.0 confidence in the edge existing. Null = unspecified.
statusstring: active | inactive
Initial edge status at commit time. active is the default; inactive is for retroactive soft-delete imports.
provenanceProvenance
Data lineage information. Tracks where data came from.
source_idstring
Optional source identifier — pinned in the SQS pointer so the worker can resolve source-class config overrides.
schemastring
Workspace binding selected by the server. Callers do not send an internal schema name.
Responses
202ProposeResponse
FactGraph staged. The response carries proposal_id (ULID — use to poll the GET endpoint), submitted_at, and the S3 staging location (s3_bucket / s3_key) for debugging. status is always "accepted" — the *pipeline* status lands on the decision report.
proposal_idrequiredstring
Server-assigned ULID for the proposal. Use this to poll GET /propose/factgraphs/{proposal_id} until the decision report is available.
statusstring
Always "accepted" on this endpoint. The *pipeline* status (completed / failed) lands on the decision report fetched via GET.
submitted_atrequiredstring (date-time)
ISO 8601 timestamp the proposal was accepted into the queue. Useful for client-side latency tracking.
s3_bucketstring
Backend's S3 bucket where the FactGraph payload was staged.
s3_keystring
Backend's S3 key for the staged payload.
400
Structural or semantic rejection. Bodies follow the ValidationError envelope (code / message / path / hint). The most common code is VAL002 (unknown source_id); the worker raises VAL001 / VAL003..VAL013 later, on the decision report's error block.
401
Auth missing or invalid.
403
Missing the required scope (Client) or IAM policy (Public). A tenant_id that isn't the key's firm is a 404.
422
Body-shape failure (Pydantic): malformed FactGraph, missing required fields, invalid temporal bounds.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/graph/propose' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"factgraph": {
"ontology_version": "<ontology_version>",
"objects": [
{
"client_temp_id": "<client_temp_id>",
"object_class": "<object_class>",
"name": "<name>",
"target_ref": "<target_ref>"
}
],
"relationships": [
{
"client_temp_id": "<client_temp_id>",
"source_ref": "<source_ref>",
"target_ref": "<target_ref>",
"relationship_type": "<relationship_type>"
}
]
}
}'GET /v1/graph/propose/{proposal_id}
Fetch the decision report for a previously submitted FactGraph
Read the worker's decision report from S3 by proposal_id. Returns the report verbatim (worker's JSON, including any backend-specific extra fields the model passes through via extra='allow'). Terminal states: status='completed' (Commit landed N rows; the per-object decision enum says what happened to each: create / attach / reference / merge_into / pending / etc.) or status='failed' (pipeline error; error.type + error.message describe the stage that rejected). Either is final — the worker won't re-process the same proposal_id automatically. 404 ambiguity: a 404 means the report either doesn't exist yet (still in flight) OR the proposal_id is unknown. The v1 contract does not distinguish those cases — callers should backoff-poll. Typical end-to-end latency is seconds; pathological partition-maintenance ticks have pushed it to ~minutes historically. If you've polled for >5 minutes, the proposal_id is almost certainly bogus. Both paths read the same S3 object.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
proposal_idrequiredpath · string
ULID returned by POST /propose/factgraphs.
Responses
200DecisionReport
Decision report available. The body is the worker's JSON — branch on status to choose between objects (completed) and error (failed).
proposal_idrequiredstring
ULID echoed back from the POST request.
tenant_idrequiredstring
Tenant slug from the POST request.
submitted_atrequiredstring
ISO 8601 timestamp of the POST. String, not datetime, so the worker's exact wire format (Z-suffixed UTC) round-trips.
processed_atrequiredstring
ISO 8601 timestamp the worker finished (or failed) processing. String for the same reason as submitted_at. Subtract submitted_at to get end-to-end latency.
statusrequiredstring: completed | failed
Pipeline outcome. completed means every object reached Commit; failed means a stage raised before Commit. Determines which optional fields are populated.
objectsDecisionObject[]
Per-object decisions when status='completed'. Empty (or omitted) on status='failed'.
ref_idrequiredstring
Caller-supplied client_temp_id for the object — the key that ties this decision back to the input FactGraph.
decisionrequiredstring
Decision outcome. One of create (no confident match, new object minted), attach (matched + merged into existing), reference (known object skipped from matching), pending (high-scoring candidate below attach threshold — needs human review), and the v2 passthrough actions update_property / delete_property / deprecate / merge_into.
final_object_idstring
ULID of the resulting graph object (the newly created one for create; the matched/target object for attach / reference / merge_into). Omitted when no object was produced (e.g. pending review).
audit_idstring
ULID of the audit row written for this decision. Use to look up the full Match → Decide audit trail.
properties_addedinteger
Number of properties added during Commit. Includes both newly-bound properties on a create and merged properties on an attach.
properties_updatedinteger
Number of values already on the object whose valid_from / valid_to this proposal changed, e.g. an attach that re-proposes a prior name with the date it stopped being used.
needs_reviewboolean
True when the decision needs human review (pending outcome OR create with a potential_duplicate_of hint). Curation tools surface these via GET /v1/objects?needs_review=true.
reasonstring
Human-readable explanation. For attach/pending outcomes, names the matched-on signals + confidence; for create outcomes, typically omitted.
potential_duplicate_ofstring
ULID of an existing object the matcher flagged as a near-but-failing duplicate (set when a create happens with a high-scoring top candidate that didn't clear all gates).
candidatesobject[]
Every object the matcher scored, best first, each with its object_id, score and signals. Populated only for pending, needs_review or potential_duplicate_of decisions; empty otherwise.
object_countinteger
Length of objects. Always present so callers can branch without instantiating the list.
relationshipsDecisionRelationship[]
Per-relationship outcomes when status='completed', in FactGraph order.
client_temp_idrequiredstring
The relationship's client_temp_id.
relationship_typerequiredstring
The edge type proposed.
outcomerequiredstring: created | deduped | updated | retired | not_found
created — a new edge. deduped — matched a current edge, nothing changed. updated — matched a current edge and changed it. retired — action: retire set valid_to. not_found — action: retire named no current edge in your tenant.
edge_idstring
The edge written or matched; null for not_found.
changesobject[]
{field, old, new} per change on updated / retired, e.g. valid_to or properties.employment.job_title.
relationship_countinteger
Length of relationships.
errorFailureDetail
Error block written by the worker when processing fails.
typerequiredstring
Python exception class name. Common values: ValidationError (Validate stage), MatchingError (Block / Match), CommitError (DB constraint), SystemError (config / queue).
messagerequiredstring
Truncated exception message (max 1000 chars at write time). Includes any JSON-path or hint the validator produced; the full structured envelope is on the audit trail.
codestring
Stable error code (VAL017, MAT001, …; see the errors guide) when the stage raised a pipeline error. Branch on this, not on message. Absent for unexpected exceptions.
pathstring[]
JSON path to the offending field, when known.
hintstring
How to fix it, when known.
detailsobject
Structured context for the error, when any.
401
Auth missing or invalid.
404
No decision report for this proposal_id. The id may be unknown OR the pipeline is still running — v1 does not distinguish. Backoff and retry.
422
proposal_id is not a 26-character Crockford-base32 ULID. FastAPI rejects the path parameter before the handler runs.
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/graph/propose/{proposal_id}' \
-H 'Authorization: Bearer <api_key_or_session_token>'Conflict Check
Submit a conflict-check job, poll its result, continue a capped search, or read the job's progress.
POST /v1/conflict-check
Submit a seed FactGraph for conflict-check
Kick off a conflict-check job. The body is a seed FactGraph (one or more people / companies / contracts describing a prospective representation), validated structurally; the worker traverses the firm's existing graph and returns the related entities + their link types. Returns 202 with the assigned job_id. Poll GET /v1/conflict-check/{job_id} until it returns 200 (terminal state + result available) or until cancellation. Typical end-to-end latency is seconds for normal seeds; hub-shaped seeds (high-degree people) cap out via the configured budgets and surface frontier_hint entries — use the /continue endpoint to resume expansion from a capped hub. Persist semantics (persist=true): after the conflict-check completes, the worker chains the seed through the Propose pipeline so the matched seed lands in the firm's graph (read-first, write-after per the design doc). Default is false — most callers want a read-only conflict graph. Tenant binding: tenant_id must equal the bearer's bound firm_id. A cross-firm submission returns the same neutral 404 as the cross-firm probe on GET.
Send Authorization: Bearer with an API key or a portal session token.
Request body
ConflictCheckRequest, required.
tenant_idrequiredstring
Firm scope for the check. Must equal the bearer's bound firm_id; any mismatch is a 404.
factgraphrequiredFactGraph
A complete graph of facts from a single source observation. The top-level input to the Propose API. Supports both v1.2 (implicit) and v2.0 (explicit) schema versions. - No schema_version field = v1.2 behavior (matching pipeline) - schema_version = "2.0" enables explicit object actions
schema_versionstring
v2.0: Schema version (e.g., '2.0'). Omit or null for v1.2 compatibility.
source_dataobject
v2.0: Free-form JSON preserved with FactGraph (suggested <1000 chars, not enforced)
factgraph_idstring
Client-provided ID for tracking. Used for idempotency: re-submitting a factgraph_id this tenant has already submitted returns the existing proposal_id and enqueues nothing, however long ago the first submission was. The same id under another tenant is a separate proposal. Treat as a stable correlation key, e.g. <runId>:<chunk> or a content hash.
ontology_versionrequiredstring
Caller-pinned ontology version (integer '34' or semver '7.0.0'). The Validate stage rejects with VAL002 if the pinned version dropped a class or property still referenced in this payload. Recommended pattern: pin a specific version + bump deliberately in a coordinated rollout.
default_provenanceProvenance
Data lineage information. Tracks where data came from.
source_idrequiredstring
26-char ULID of a registered source. Must exist in <schema>.sources — the Propose route pre-validates and returns 400/VAL002 on miss before the worker runs.
extraction_confidencenumber
0.0-1.0 confidence in the extraction step itself (how sure was the parser that it read the source correctly?). Distinct from each Property's confidence_score, which scores the semantic claim.
extracted_atstring (date-time)
ISO 8601 timestamp when the value was extracted from the source. Distinct from created_at (DB insert time).
acquisition_methodstring: api_call | db_query | web_scrape | file_import | manual_entry | synthetic_test
How the data was acquired. api_call for live REST/GraphQL pulls, db_query for upstream DB reads, web_scrape for HTML extraction, file_import for bulk drops, manual_entry for human input, synthetic_test for fixtures / load tests (excluded from production aggregates).
inference_reasonstring
Explanation for inferred facts (e.g., 'Sibling of Truitt who is child of Troy/Amanda implies shared parents')
evidenceEvidence[]
Zero or more Evidence snippets — the actual source bytes the claim was extracted from. The matcher doesn't read these, but audit + curation tools surface them.
thresholdsMatchingThresholds
Configurable thresholds for matching decisions.
attachnumber
Score >= attach: merge with existing
duplicate_linknumber
Score >= duplicate_link: create + potential_duplicate_of
reprocessReprocessConfig
Configuration for reprocessing a source.
modeReprocessMode
Mode for reprocessing FactGraphs.
target_source_idstring
Source to supersede/purge (required for non-NORMAL modes)
target_source_version_idstring
Specific source version to replace. Optional; null supersedes the latest version.
confirm_purgeboolean
Must be True for PURGE mode (safety check)
objectsObjectInput[]
Objects to ingest. May reference existing rows by object_id. At least one of objects or relationships must be non-empty.
object_idstring
Known object's 26-char ULID. When set, the matching pipeline is bypassed — the row is treated as a reference + targets for property attach. Mutually non-exclusive with client_temp_id (which can act as an alias).
client_temp_idstring
Caller-chosen correlation token. Required for new objects (no object_id); for known objects, acts as an alias other relationships in this FactGraph can reference.
object_classstring
Ontology class code (e.g., Person, Company, Address). Required for new objects (no object_id); optional for known references where the DB row already names the class.
namestring
Display name. Server derives name_norm + nysiis_key from this value; the matcher's name signals score against those derived columns. Required for new objects.
name_formatstring: first_last | last_first
Name format hint for Person parsing. 'last_first' for FAA-style 'SMITH JOHN' format.
statusstring: active | inactive | merged
Lifecycle state at commit time. active is the default and the only value most callers set. inactive for soft-deleted imports; merged for retroactive deduplication backfills.
propertiesProperty[]
Properties to attach to the object. For new objects, these are the initial property set; for known references, they're additive (unless replace_properties=true).
replace_propertiesboolean
If true, replaces existing properties with same names instead of adding to them.
external_recordExternalRecordInput
An ExternalSystemRecord identity: the object's id in a source system, e.g. a PracticePanther contact. Within a firm it is exact: an existing record attaches to its object with no fuzzy decision; a new one creates the object and the record together.
provenanceProvenance
Data lineage information. Tracks where data came from.
actionObjectAction
Explicit actions for FactGraph v2.0 objects. When an action is specified, the object bypasses the matching pipeline and is routed directly to the specified operation.
target_refstring
v2.0: For MERGE_INTO action - target object_id or client_temp_id to merge into
delete_propertiesstring[]
v2.0: For DELETE_PROPERTY action — list of property names (matching the ontology's property_definitions.name) to delete from the existing object.
relationshipsRelationshipInput[]
Relationships to ingest. Each edge's source_ref + target_ref resolves through this FactGraph's client_temp_id namespace first, then through existing object_ids.
edge_idstring
Known edge's 26-char ULID. When set, the matcher skips edge creation and treats this as a reference (e.g. for property attach).
client_temp_idrequiredstring
Caller-chosen correlation token for this edge. Returned on the decision report so callers can match decisions back to input edges.
actionstring: assert | retire
assert (default): create the edge, or update the current one with the same type + endpoints. retire: end the current edge — named by edge_id, or by source_ref + target_ref + relationship_type — by setting valid_to (this relationship's valid_to, or the commit date). The edge stays in history; current-state reads drop it. Use it when a source stops listing a party.
source_refrequiredstring
Source endpoint reference. Either an object_id (26-char ULID) of a known DB row, OR a client_temp_id of an object in this same FactGraph. Resolved at the Block stage.
target_refrequiredstring
Target endpoint reference. Same resolution rules as source_ref.
source_idstring
Server-resolved object_id for the source endpoint. Populated by the matcher during Block stage; callers do not set this.
target_idstring
Server-resolved object_id for the target endpoint. Populated by the matcher; not bound by callers.
relationship_typerequiredstring
Ontology relationship type (e.g., employment, headquartered_at, shareholder_of). The (source_class, target_class) pair must appear in public.allowed_pairs for this type — VAL006 on miss.
source_descriptorstring
Free-text role label for the source side. When omitted, the ontology's relationship_types.source_descriptor default applies.
target_descriptorstring
Free-text role label for the target side. Defaults from ontology when omitted.
propertiesProperty[]
Properties attached to this edge — additive unless replace_properties=true.
replace_propertiesboolean
If true, replaces existing properties with same names instead of adding to them.
valid_fromstring (date)
Inclusive start of validity interval. Null = open-ended past.
valid_tostring (date)
Exclusive end of the validity interval: the first day it no longer holds. Null = currently active.
confidence_scorenumber
0.0-1.0 confidence in the edge existing. Null = unspecified.
statusstring: active | inactive
Initial edge status at commit time. active is the default; inactive is for retroactive soft-delete imports.
provenanceProvenance
Data lineage information. Tracks where data came from.
persistboolean
When True, the worker chains the seed through the Propose pipeline after the conflict check completes (read-first, write-after per design doc § 2.4). Defaults False — most callers want a read-only conflict graph.
Responses
202ConflictCheckResponse
Job queued.
job_idrequiredstring
Server-assigned ULID for the conflict-check job. The durable handle for polling, cancelling, continuing, and streaming events.
statusstring
Acceptance status. Always "queued" on this endpoint. The *workflow* status (running / completed / failed / cancelled) lands on the GET endpoint's result body.
submitted_atrequiredstring (date-time)
ISO 8601 timestamp the job was accepted into the queue.
s3_bucketrequiredstring
Backend's S3 bucket where the conflict-check pointer was staged.
s3_pointer_keyrequiredstring
Backend's S3 key for the staged pointer object.
401
Auth missing or invalid.
403
Missing the required scope. A tenant_id that isn't the key's firm is a 404, like an unknown id.
422
Body-shape failure: malformed seed FactGraph, missing required fields, invalid temporal bounds.
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/conflict-check' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"tenant_id": "<tenant_id>",
"factgraph": {
"ontology_version": "<ontology_version>",
"objects": [
{
"client_temp_id": "<client_temp_id>",
"object_class": "<object_class>",
"name": "<name>",
"target_ref": "<target_ref>"
}
],
"relationships": [
{
"client_temp_id": "<client_temp_id>",
"source_ref": "<source_ref>",
"target_ref": "<target_ref>",
"relationship_type": "<relationship_type>"
}
]
}
}'GET /v1/conflict-check/{job_id}
Fetch the conflict-check result or poll status
Poll a conflict-check job. Two terminal outcomes return 200 (job done, result available); in-flight + race windows return 404 with a discriminating code so callers can branch. Lifecycle: queued -> running -> completed / failed / cancelled. 404 with code: still_processing — the job is queued, running, OR in a terminal state but result.json hasn't fully landed yet (a brief cancel-vs-worker race window). Body includes lifecycle hints (current_round, entities_so_far, updated_at) so the UI can show progress. 404 with code: NOT_FOUND — the job_id is unknown OR belongs to a different firm. The two cases share an identical shape to avoid disclosing existence of other firms' jobs. Version negotiation: set Accept-Version: v2 to opt into the unified ErrorEnvelope shape for 404 bodies.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
job_idrequiredpath · string
ULID returned by POST /v1/conflict-check. 26 Crockford-base32 chars.
Responses
200ConflictCheckResult
Job is in a terminal state and result.json was successfully loaded. The body carries the full or truncated graph plus a result_url pointing at the complete body.
job_idrequiredstring
ULID assigned by POST /v1/conflict-check.
firm_idrequiredstring
Firm scope. Mirrors the bearer's bound firm_id; never differs (the route 404s a cross-firm probe before the result body assembles).
submitted_atrequiredstring
ISO 8601 timestamp of the POST submission (e.g. "2026-05-28T17:00:00Z").
started_atstring
ISO 8601 timestamp when the worker began processing. null if cancelled before pickup.
completed_atstring
ISO 8601 timestamp when the worker finished. null for cancelled jobs that exited mid-flight.
statusrequiredstring: completed | cancelled | failed
Terminal lifecycle state.
stopped_becauserequiredstring: fixed_point | depth_limit | entity_limit | cancelled | failed
Why the workflow stopped.
rounds_runrequiredinteger
Total number of rounds the workflow executed.
seed_object_countrequiredinteger
Number of objects in the caller's submitted FactGraph (echoed for caller convenience).
seed_relationship_countrequiredinteger
Number of relationships in the caller's submitted FactGraph (echoed for caller convenience).
entitiesrequiredConflictCheckEntity[]
All entities discovered during the walk. May be a subset of the full set when entities_truncated is true; in that case follow result_url for the complete list.
keyrequiredstring
Schema-qualified identifier: <schema>:<object_id>. Stable within a conflict-check job; used as a node ID on the conflict graph.
object_idrequiredstring
DB object_id (ULID) for real entities; the FactGraph client_temp_id for virtual seeds; empty string for anonymous seed objects that never resolved to a DB row.
schemarequiredstring
Workspace binding selected by the server. Callers do not send an internal schema name.
object_classrequiredstring
Ontology class (e.g. Person, Organization). May be empty string when the matcher discovered a public entity via cross-schema but didn't yet load its full ontology metadata.
namerequiredstring
Display name. For seed entities, the caller's input; for discovered entities, the DB row's name.
propertiesobject
Ontology-driven properties plus matcher-derived fields (underscore-prefixed). Open shape — the contract doesn't constrain inner keys; clients should treat unknown keys as forwards-compatible additions.
surfaced_in_roundrequiredinteger
Round number this entity first appeared in. 0 = seed phase; rounds_run is the total.
surfaced_viarequiredstring: seed | graph_neighbor | enrichment_match | identity_match | conflict_finding
The discovery path that surfaced this entity.
linksrequiredConflictCheckLink[]
All edges on the conflict graph. May be a subset of the full set when links_truncated is true; in that case all headline links (identity, conflict_finding) ARE in the inline view — only bulk links get truncated.
a_keyrequiredstring
Source-side entity key. By convention the lc-side seed for identity / enrichment; the public-side seed for conflict_finding.
b_keyrequiredstring
Target-side entity key.
link_typerequiredstring: graph_neighbor | enrichment | identity | conflict_finding | frontier_hint
What kind of edge this is.
surfaced_in_roundrequiredinteger
Round number this link first appeared in.
scorestring
String-encoded Decimal aggregate score (cross-schema links only).
leg_breakdownConflictCheckLeg[]
Per-leg contributions (cross-schema links only). See ConflictCheckLeg.
relationship_typestring
Ontology relationship type for graph_neighbor edges (e.g. donation, employment). Also populated on frontier_hint edges to carry the failure-reason tag (branch_failed, hub_capped).
detailobject
Link-type-specific structured metadata. For frontier_hint(hub_capped) edges, carries the continuation cursor: {schema, next_cursor, capped_at, total_neighbors}. The POST /v1/conflict-check/{job_id}/continue endpoint reads these to resume expansion from where the cap fired. null for link types that don't carry structured metadata.
persist_resultConflictCheckPersistResult
Outcome of the persist chain when the caller submitted with persist=true. Populated by the MaybePersist state when the workflow proposes the seed FactGraph to the Propose pipeline.
proposal_idrequiredstring
ULID of the proposal handed off to the Propose pipeline. Caller can poll GET /propose/factgraphs/{proposal_id} for the commit decision.
statusrequiredstring
Acceptance status from the Propose pipeline. accepted means the proposal was enqueued; final commit decision lives on the propose endpoint.
error_summarystring
Free-form error message when status == "failed". null for successful or cancelled jobs.
parent_job_idstring
null for first-time jobs.
result_urlrequiredstring
Absolute URL to a downloadable copy of the complete result body. Always present, regardless of whether the inline body was truncated. Implementations MAY use a time-limited presigned URL — clients should follow it promptly.
entities_truncatedrequiredboolean
True when entities is a strict subset of the full list. Follow result_url for the complete entities.
links_truncatedrequiredboolean
True when links is a strict subset of the full list. Headline matches (identity, conflict_finding) are NEVER truncated; only bulk links (graph_neighbor, enrichment, frontier_hint) get truncated.
401
Auth missing or invalid.
404object
Two distinct shapes share this status, discriminated by the code field: - code: NOT_FOUND — unknown job_id, OR the bearer's firm doesn't own this job (surfaced identically to avoid disclosing existence of other firms' jobs). - code: still_processing — job is queued or running; client should poll.
422
job_id is not a 26-character Crockford-base32 ULID. Path validation rejects before the handler.
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/conflict-check/{job_id}' \
-H 'Authorization: Bearer <api_key_or_session_token>'DELETE /v1/conflict-check/{job_id}
Request cancellation of an in-flight conflict-check
Flip the job's status to cancelled. The worker checks between rounds (PR's cancel_checker) and exits with stopped_because='cancelled'. The partial result (however far the worker got) lands on result.json and becomes available via the GET endpoint. Between-rounds only: v1 does NOT interrupt a mid-round expansion. Cancellation latency therefore depends on round duration — typically seconds, but a hub-shaped round can take longer. Mid-round cancellation is deferred to v2. Already-terminal -> 422: DELETE on a completed / failed / cancelled job returns 422 (explicit refusal) rather than a silent no-op. Callers who DELETE a done job should know the cancel had no effect. Cross-firm probe protection: identical 404 shape for unknown job_id and cross-firm probe (same disclosure-avoiding pattern as GET).
Send Authorization: Bearer with an API key or a portal session token.
Parameters
job_idrequiredpath · string
ULID returned by POST /v1/conflict-check.
Responses
202object
Cancel recorded. Worker stops between rounds; fetch the GET endpoint shortly to get the partial result. Body carries state and hint.
401
Auth missing or invalid.
404
Unknown job_id OR the bearer's firm doesn't own the job (same shape for both, to avoid cross-firm probe disclosure).
422
ALREADY_TERMINAL — the job is in a final state (completed / failed / cancelled); cancel has no effect. Body's state field names the actual terminal state.
Example
curl -sS -X DELETE 'https://client.cloudswift.app/v1/conflict-check/{job_id}' \
-H 'Authorization: Bearer <api_key_or_session_token>'POST /v1/conflict-check/{job_id}/continue
Resume expansion from a hub-capped entity
When to call: the parent job's result includes frontier_hint entries with kind: 'hub_capped' naming the entities whose neighborhood the worker stopped expanding because the hub budget was hit. To see more of that hub's neighborhood, POST here with from_entity_key set to the hint's entity key. The server reads the parent's next_cursor from the hint, spawns a child job seeded with that cursor, and returns the child job_id. 400 conditions: the from_entity_key doesn't correspond to a hub_capped hint in the parent (only capped hubs can be continued from), or the parent's hint is missing required cursor / entity data (corrupted parent state — rare, surface as 400 not 500 because the request shape was valid). Cross-firm probe protection: identical 404 shape for unknown parent job_id and cross-firm probe.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
job_idrequiredpath · string
ULID of the parent job to continue from.
Request body
ConflictCheckContinueRequest, required.
from_entity_keyrequiredstring
Schema-qualified entity key of the capped hub (e.g. public:01KG0VNZD1Q0B97AW2XGCN2VTK). Must match a hub_capped frontier_hint in the parent job's links.ndjson — otherwise the server returns 400.
Responses
202ConflictCheckContinueResponse
Continuation accepted; a child job has been started. The response carries the child job_id, the parent reference, and the cursor the child resumed from. Poll GET /v1/conflict-check/{job_id} with the child id.
job_idrequiredstring
ULID assigned to this continuation job.
parent_job_idrequiredstring
ULID of the parent job whose capped hub this resumes.
from_entity_keyrequiredstring
Echo of the request's from_entity_key.
from_cursorrequiredstring
Cursor the server resolved from the parent's frontier_hint(hub_capped).detail.next_cursor. Expansion of from_entity_key in the continuation job starts at this point in the sorted-by-object_id neighbor list.
statusstring
Acceptance status. Always "queued" on this endpoint — the *workflow* status (completed / failed / cancelled) lands on the GET endpoint's result body.
submitted_atrequiredstring (date-time)
ISO 8601 timestamp the continuation was accepted into the queue.
s3_bucketrequiredstring
S3 bucket where the continuation's pointer was staged.
s3_pointer_keyrequiredstring
S3 key for the continuation's pointer object.
400ConflictCheckContinueBadRequest
INVALID_CONTINUATION — the named from_entity_key was not hub_capped in the parent, OR the parent's hint is missing a usable next_cursor / entity record. Bodies carry code + message explaining which.
401
Auth missing or invalid.
404
Parent job_id unknown OR bearer's firm doesn't own the parent job (same disclosure-avoiding shape as GET).
Example
curl -sS -X POST 'https://client.cloudswift.app/v1/conflict-check/{job_id}/continue' \
-H 'Authorization: Bearer <api_key_or_session_token>' \
-H 'Content-Type: application/json' \
-d '{
"from_entity_key": "<from_entity_key>"
}'GET /v1/conflict-check/{job_id}/events
Stream progress events for an in-flight conflict-check
Snapshot stream of the job's progress events as Server-Sent Events (text/event-stream). Emits every event that's currently in events.ndjson, finishes with a snapshot_end event carrying complete: true/false, then closes the connection. Client pattern: reconnect to receive newer events. On snapshot_end with complete: true, stop (terminal state). On complete: false, the worker is still running; wait a beat and reconnect. SSE format: each event has an event: line naming the type (round_started, round_completed, snapshot_end, ...) and a data: line carrying the JSON payload, separated by a blank line per the SSE spec. The response sets Cache-Control: no-cache and X-Accel-Buffering: no so API Gateway flushes events as they're yielded.
Send Authorization: Bearer with an API key or a portal session token.
Parameters
job_idrequiredpath · string
ULID returned by POST /v1/conflict-check.
Responses
200object
SSE event stream. Body is a sequence of event: + data: pairs ending in a snapshot_end event; the connection closes immediately after.
401
Auth missing or invalid.
404
Unknown job_id OR bearer's firm doesn't own the job. Same disclosure-avoiding shape as GET.
Example
curl -sS -X GET 'https://client.cloudswift.app/v1/conflict-check/{job_id}/events' \
-H 'Authorization: Bearer <api_key_or_session_token>'