Create Link Between Parent and Child Record

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Overview

Creates a new link association between a parent record and a child record, or updates an existing link if one already exists for the same parent/child pair. Returns the link ID and resolved record IDs upon success.

Record Identification

Parent and child records can be identified in two ways:

  1. By primary key (preferred): Provide ParentRecordID or ChildRecordID.
  2. By match field: Provide both a key value and a field name (e.g., ParentRecordKey=POL-2026-001 + ParentRecordMatchField=PolicyNumber). Only text or numeric fields are accepted. Association fields are not allowed.

If both a primary key and a match field are provided for the same side, the primary key takes priority and the match field is ignored.

For Upsert, you must identify one parent record AND one child record

Preconditions

  • The authenticated user must have the appropriate permission on the parent domain (Attach Contacts for Contact links, Attach Files for File links, Edit for all others).
  • ChildDomain must be "Contact" or "File".
  • Either ParentRecordID or both ParentRecordKey and ParentRecordMatchField must be provided.
  • Either ChildRecordID or both ChildRecordKey and ChildRecordMatchField must be provided.

Notes

  • If a link already exists between the specified parent and child, the existing link is updated rather than creating a duplicate.
  • Relationship and NewRelationship are only applicable when ChildDomain is Contact. These fields are ignored for File links.

Relationship Behavior

Because this endpoint is overload to support both insert and update (id, upsert operations), the role of Relationship and NewRelationship depends on whether the operation results in an insert or an update:

Use CaseRelationshipNewRelationshipResult
Create a link with a relationshipOmitProvideLink is created with the specified relationship.
Create a link with a relationship (alternate)ProvideOmitLink is created with Relationship as the assigned value.
Change an existing link's relationshipProvide (to locate the link)Provide (the new value)The existing link is found by Relationship and updated to NewRelationship.
Create a link without a relationshipOmitOmitLink is created with no relationship.

Examples

Scenario 1: Link a contact to a claim by primary keys:

POST /api/Link/Upsert
Content-Type: application/json
{
  "ParentDomain": "Claim",
  "ParentRecordID": 5001,
  "ChildDomain": "Contact",
  "ChildRecordID": 2001,
  "Relationship": "Adjuster"
}
200 OK
{
  "IsSuccessful": true,
  "RecordID": 101,
  "Message": "Inserted link with id 101 successfully.",
  "ParentID": 5001,
  "ChildID": 2001,
  "RelationshipID": 3
}

Scenario 2: Upsert using match fields (update existing link's relationship):

POST /api/Link/Upsert
Content-Type: application/json
{
  "ParentDomain": "Policy",
  "ParentRecordKey": "POL-2026-001",
  "ParentRecordMatchField": "PolicyNumber",
  "ChildDomain": "Contact",
  "ChildRecordID": 2001,
  "Relationship": "Adjuster",
  "NewRelationship": "Underwriter"
}
200 OK
{
  "IsSuccessful": true,
  "RecordID": 101,
  "Message": "Updated link with id 101 successfully.",
  "ParentID": 67890,
  "ChildID": 2001,
  "RelationshipID": 3
}

Scenario 3: Parent record cannot be found:

POST /api/Link/Upsert
Content-Type: application/json
{
  "ParentDomain": "Claim",
  "ParentRecordKey": "NONEXISTENT",
  "ParentRecordMatchField": "ClaimNumber",
  "ChildDomain": "Contact",
  "ChildRecordID": 2001
}
500 Internal Server Error
"Unable to execute. Unable to identify the parent record based on the information provided."
Body Params
json
required
Defaults to { "ParentDomain": "string", "ParentRecordID": 0, "ParentRecordKey": "string", "ParentRecordMatchField": "string", "ChildDomain": "string", "ChildRecordID": 0, "ChildRecordKey": "string", "ChildRecordMatchField": "string", "Relationship": "string", "NewRelationship": "string" }
string
required

The parent domain name. Case-sensitive.

integer

Conditional | Primary key of the parent record. Required if ParentRecordKey/ParentRecordMatchField are not provided.

string

The field on the ParentDomain record that will be searched for the ParentRecordKey value you provide. Only fields that are text or numeric data types can be used.

string

The value to match against ParentRecordMatchField. Must uniquely identify one parent record. Must be used with ParentRecordMatchField.

string

Values: "Contact", "File". The domain of the child record to link.

integer
string

The field on the ChildDomain record that will be searched for the ChildRecordKey value you provide. Only fields that are text or numeric data types can be used.

string

The value to match against ChildRecordMatchField. Must uniquely identify one child record. Must be used with ChildRecordMatchField.

string

Only applicable when ChildDomain is Contact. The relationship name to match or assign.

Retrieve valid values from GET /api/Link/Codes?fieldName=ContactType.

See the Relationship Behavior section for more details on the overloaded behavior capabilities.

string

Only applicable when ChildDomain is Contact.

The new relationship name to assign.

See the Relationship Behavior section for more details on the overloaded behavior capabilities.

Response
200
Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here!