Skip to content

Merge Entities

POST
/api/writing/entities/{entity_name}/merge

πŸ”€ Merge an entity into another entity

Merges the source entity (from path) into the target entity (from body). All references to the source entity in documents will be replaced with the target entity name.

Path Parameters:

  • entity_name: Source entity to merge (will be removed)

Request Body:

  • targetEntity: Target entity to merge into (will be kept)
  • keepAliases: Whether to keep source name as alias (default: true)

Returns:

  • EntityMergeResponse with merge details and documents_updated count

Raises:

  • HTTPException 500: If merge fails

Example Request:

{
    "targetEntity": "Aragorn",
    "keepAliases": true
}
entity_name
required
Entity Name
string
EntityMergeRequest

Request model for merging entities.

Fields: target_entity: Entity to merge into (keeps this entity) keep_aliases: Whether to keep source entity name as alias of target

Used By: - POST /api/writing/entities/merge endpoint - Entity merge dialog

object
targetEntity
required
Targetentity
string
keepAliases
Keepaliases

Keep source as alias

boolean
default: true

Successful Response

EntityMergeResponse

Response from merging entities.

Fields: status: Operation status source_entity: Entity that was merged (removed) target_entity: Entity that received the merge documents_updated: Number of documents with updated references message: Status message

Used By: - POST /api/writing/entities/merge endpoint response

object
status
required
Status
string
sourceEntity
required
Sourceentity
string
targetEntity
required
Targetentity
string
documentsUpdated
required
Documentsupdated
integer
message
Any of:
string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object