Mapping

Create a mapping between two schemas

POST
https://api.x.flatfile.com/v1/mapping

Creates a list of mapping rules based on two provided schemas

Request

This endpoint expects an object.
source
object

Source schema

destination
object

Destination schema

familyId
optional string

ID of the family to add the program to

namespace
optional string

Namespace of the program

save
optional boolean

Whether to save the program for editing later. Defaults to false. If true, the response will contain an ID and access token.

Response

This endpoint return an object.
data
object

Errors

POST
/mapping
curl -X POST https://api.x.flatfile.com/v1/mapping \
-H "X-Disable-Hooks: true" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"source": {
"name": "string",
"fields": [
{
"type": "string",
"key": "string"
}
]
},
"destination": {
"name": "string",
"fields": [
{
"type": "string",
"key": "string"
}
]
}
}'
Response
{
"data": {
"rules": [
{
"name": "string",
"type": "string",
"acceptedAt": "2023-01-01T00:00:00Z",
"acceptedBy": "string",
"confidence": 0,
"config": {},
"createdAt": "2023-01-01T00:00:00Z",
"createdBy": "string",
"deletedAt": "2023-01-01T00:00:00Z",
"id": "string",
"updatedAt": "2023-01-01T00:00:00Z"
}
],
"sourceKeys": [
"string"
],
"destinationKeys": [
"string"
],
"id": "string",
"namespace": "string",
"familyId": "string",
"createdAt": "2023-01-01T00:00:00Z",
"createdBy": "string",
"summary": {
"totalRuleCount": 0,
"addedRuleCount": 0,
"deletedRuleCount": 0
},
"accessToken": "string"
}
}