Back to API Overview

Linked Records API

Create links between records in different tables and manage relationships.

6 endpoints

Endpoints

POST
/api/v1/linkedRecords/createLinkField

Create a link field to connect two tables

Parameters

tableIdstringrequired

Source table ID from listTables

namestringrequired

Name for the link field

descriptionstring

Optional description

linkedTableIdstringrequired

Target table ID to link to

linkTypestringrequired

Relationship type: "one_to_one", "one_to_many", or "many_to_many"

linkDisplayModestring

Display mode: "COUNT", "LABELS", or "CHIPS"

allowMultipleLinksboolean

Allow linking to multiple records

linkOnDeletestring

Action on delete: "CASCADE", "SET_NULL", "RESTRICT", "NO_ACTION"

linkOnUpdatestring

Action on update

createReciprocalboolean

Create reciprocal field in target table

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/linkedRecords/createLinkField \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "name": "example",
  "description": "example"
}'
POST
/api/v1/linkedRecords/linkRecords

Link records between tables

Parameters

tableIdstringrequired

Source table ID

recordIdstringrequired

Source row ID to link from

fieldIdstringrequired

Link field ID

linkedRecordIdsarrayrequired

Array of target row IDs to link to

preserveOrderboolean

Preserve order of linked records

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/linkedRecords/linkRecords \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "recordId": "example",
  "fieldId": "example"
}'
POST
/api/v1/linkedRecords/unlinkRecords

Unlink records between tables

Parameters

tableIdstringrequired

Source table ID

recordIdstringrequired

Source row ID

fieldIdstringrequired

Link field ID

linkedRecordIdsarrayrequired

Array of target row IDs to unlink

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/linkedRecords/unlinkRecords \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "recordId": "example",
  "fieldId": "example"
}'
POST
/api/v1/linkedRecords/getLinkedRecords

Get linked records for a record

Parameters

tableIdstringrequired

Source table ID

recordIdstringrequired

Source row ID

fieldIdstringrequired

Link field ID

expandboolean

Include full record data

limitnumber

Max records to return (default: 50)

offsetnumber

Skip records for pagination

sortBystring

Field to sort by

sortDirectionstring

Sort direction

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/linkedRecords/getLinkedRecords \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "recordId": "example",
  "fieldId": "example"
}'
POST
/api/v1/linkedRecords/bulkLinkRecords

Bulk link/unlink operations on multiple records

Parameters

tableIdstringrequired

Source table ID

fieldIdstringrequired

Link field ID

operationsarrayrequired

Array of link operations to perform

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/linkedRecords/bulkLinkRecords \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "fieldId": "example",
  "operations": {}
}'
POST
/api/v1/linkedRecords/reorderLinkedRecords

Reorder linked records

Parameters

tableIdstringrequired

Source table ID

recordIdstringrequired

Source row ID

fieldIdstringrequired

Link field ID

orderedRecordIdsarrayrequired

Target row IDs in desired order

Example Request

curl -X POST https://app.serenitiesai.com/api/v1/linkedRecords/reorderLinkedRecords \
  -H "Authorization: Bearer mk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "tableId": "example",
  "recordId": "example",
  "fieldId": "example"
}'
Linked Records API - Serenities