# Conflicts endpoints

Conflicting facts in a workspace, computed on demand: resolve a person's competing birth families, or fold spelling variants of a fact into one value.

Paths are relative to https://kleiobase.com/api/v1. Request and response schemas are in the OpenAPI document at https://kleiobase.com/api/v1/openapi.json.

## List conflicts

`GET /workspaces/{workspace_id}/conflicts`

Computed on demand. Not paginated: next_cursor is always null.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.

Responses:

- `200`: Conflicts.
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The account has no paid plan.
- `404`: The workspace does not exist or is not visible to this key's owner.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

## Resolve a birth-family conflict

`POST /workspaces/{workspace_id}/conflicts/resolve`

For a person with more than one birth family. keep_family keeps family_id as the birth family and marks the others adopted; change_pedi sets pedigree on the link to family_id. Returns the person's conflicts after the change. Replays of an Idempotency-Key return the original body and request_id; headers are not replayed.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.
- `Idempotency-Key` (header, optional): Makes the write safe to retry (1-255 characters, kept 24 hours). Same key and same request replays the original response; a different request with the same key is a 409.

Takes a request body; see the OpenAPI document for its schema.

Responses:

- `200`: The person's conflicts still open after the change (an empty list when none remain).
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The account has no paid plan, or the key is read-only (a read_write key is required).
- `404`: The workspace does not exist or is not visible to this key's owner. Also: The person does not exist or is not visible, or family_id is not one of their parent families.
- `409`: The workspace is archived (writes are refused). Also: Idempotency-Key was reused with a different request, or a request with it is still in progress.
- `422`: Validation failed. A bad Idempotency-Key (1-255 characters) is also a 422. Also: Invalid body (pedigree is required for change_pedi).
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

## Resolve spelling variants of a fact

`POST /workspaces/{workspace_id}/conflicts/fact-variants/resolve`

Folds folded_values into keep_value (kept as alternate wordings, so no source loses its evidence) and/or keeps pin_values apart as genuinely different facts. Returns the person's conflicts after the change. Replays of an Idempotency-Key return the original body and request_id; headers are not replayed.

Parameters:

- `workspace_id` (path, required): The workspace (project) id.
- `Idempotency-Key` (header, optional): Makes the write safe to retry (1-255 characters, kept 24 hours). Same key and same request replays the original response; a different request with the same key is a 409.

Takes a request body; see the OpenAPI document for its schema.

Responses:

- `200`: The person's conflicts still open after the change (an empty list when none remain).
- `401`: Missing, malformed, unknown or revoked API key.
- `403`: The account has no paid plan, or the key is read-only (a read_write key is required).
- `404`: The workspace does not exist or is not visible to this key's owner. Also: The person does not exist or is not visible.
- `409`: The workspace is archived (writes are refused). Also: Idempotency-Key was reused with a different request, or a request with it is still in progress.
- `422`: Validation failed. A bad Idempotency-Key (1-255 characters) is also a 422. Also: Invalid body, keep_value not recorded under that label, or the person's limit of kept-apart groups is reached.
- `429`: Rate limit exceeded. Wait the number of seconds in Retry-After.
- `500`: Unexpected error. Retry later and quote request_id if it persists.

Canonical: https://kleiobase.com/developers/docs/reference/conflicts
