> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mapp.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Create a related data record
> Adds ONE record to a data set. The data to insert is defined in a JSON block submitted in the request body.
The JSON block must contain the dataset's name, the key value, and a data array of name and value elements. The name references the column in the related data set, and the value contains the data to be inserted into the corresponding columns.
datasetName (String, required) - Name of the related data set. All related data records reside within a data set identified by a unique name.
key (String, required) - Key defining which record(s) to select from the data set.
data (Attribute, optional) - An optional list of name, value pair.
Request body example:
{
"datasetName": "products",
"key": "testuser@domain.com",
"data": [
{
"name": "productname",
"value": "bicycle"
},
{
"name": "quantity",
"value": "1"
}
]
}
## OpenAPI
````json POST /relatedData/createRecord
{
"openapi": "3.0.4",
"info": {
"title": "Engage public API",
"version": "1"
},
"servers": [
{
"url": "https://your-engage-domain.com/api/rest"
}
],
"tags": [
{
"name": "Address Attributes"
},
{
"name": "Async"
},
{
"name": "Audit Log"
},
{
"name": "Automation"
},
{
"name": "Blacklist"
},
{
"name": "CMS"
},
{
"name": "Contact"
},
{
"name": "Content"
},
{
"name": "Coupon"
},
{
"name": "Draft Message"
},
{
"name": "Ecommerce"
},
{
"name": "Group"
},
{
"name": "Group Attributes"
},
{
"name": "Landing Page"
},
{
"name": "Member Attributes"
},
{
"name": "Membership"
},
{
"name": "Message"
},
{
"name": "Meta"
},
{
"name": "Mobile Push"
},
{
"name": "Prepared Message"
},
{
"name": "Process"
},
{
"name": "Profile Attributes"
},
{
"name": "Related Data"
},
{
"name": "Segmentation"
},
{
"name": "System"
},
{
"name": "System User"
},
{
"name": "Usage Statistics"
},
{
"name": "User"
},
{
"name": "Whiteboard"
}
],
"paths": {
"/relatedData/createRecord": {
"post": {
"tags": [
"Related Data"
],
"summary": "Create a related data record",
"description": "Adds ONE record to a data set. The data to insert is defined in a JSON block submitted in the request body. {
\"datasetName\": \"products\",
\"key\": \"testuser@domain.com\",
\"data\": [
{
\"name\": \"productname\",
\"value\": \"bicycle\"
},
{
\"name\": \"quantity\",
\"value\": \"1\"
}
]
}",
"operationId": "createRecord",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RelatedDataRecord"
}
}
},
"x-bodyName": "body"
},
"responses": {
"200": {
"description": "",
"content": {
"application/octet-stream": {}
}
},
"400": {
"description": "RelatedDataList with dataSetName=products does not exist.",
"content": {
"application/octet-stream": {}
}
}
}
}
}
},
"components": {
"schemas": {
"RelatedDataRecord": {
"type": "object",
"properties": {
"datasetName": {
"type": "string"
},
"key": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Attribute"
}
}
}
},
"Attribute": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
````