Linked Records API
Create links between records in different tables and manage relationships.
Endpoints
/api/v1/linkedRecords/createLinkFieldCreate a link field to connect two tables
Parameters
tableId | stringrequired | Source table ID from listTables |
name | stringrequired | Name for the link field |
description | string | Optional description |
linkedTableId | stringrequired | Target table ID to link to |
linkType | stringrequired | Relationship type: "one_to_one", "one_to_many", or "many_to_many" |
linkDisplayMode | string | Display mode: "COUNT", "LABELS", or "CHIPS" |
allowMultipleLinks | boolean | Allow linking to multiple records |
linkOnDelete | string | Action on delete: "CASCADE", "SET_NULL", "RESTRICT", "NO_ACTION" |
linkOnUpdate | string | Action on update |
createReciprocal | boolean | 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"
}'/api/v1/linkedRecords/linkRecordsLink records between tables
Parameters
tableId | stringrequired | Source table ID |
recordId | stringrequired | Source row ID to link from |
fieldId | stringrequired | Link field ID |
linkedRecordIds | arrayrequired | Array of target row IDs to link to |
preserveOrder | boolean | 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"
}'/api/v1/linkedRecords/unlinkRecordsUnlink records between tables
Parameters
tableId | stringrequired | Source table ID |
recordId | stringrequired | Source row ID |
fieldId | stringrequired | Link field ID |
linkedRecordIds | arrayrequired | 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"
}'/api/v1/linkedRecords/getLinkedRecordsGet linked records for a record
Parameters
tableId | stringrequired | Source table ID |
recordId | stringrequired | Source row ID |
fieldId | stringrequired | Link field ID |
expand | boolean | Include full record data |
limit | number | Max records to return (default: 50) |
offset | number | Skip records for pagination |
sortBy | string | Field to sort by |
sortDirection | string | 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"
}'/api/v1/linkedRecords/bulkLinkRecordsBulk link/unlink operations on multiple records
Parameters
tableId | stringrequired | Source table ID |
fieldId | stringrequired | Link field ID |
operations | arrayrequired | 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": {}
}'/api/v1/linkedRecords/reorderLinkedRecordsReorder linked records
Parameters
tableId | stringrequired | Source table ID |
recordId | stringrequired | Source row ID |
fieldId | stringrequired | Link field ID |
orderedRecordIds | arrayrequired | 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"
}'