Mapping

Create a mapping between two schemas

POST
Creates a list of mapping rules based on two provided schemas

Request

This endpoint expects an object.
source
objectRequired
Source schema
destination
objectRequired
Destination schema
familyId
stringOptional
ID of the family to add the program to
namespace
stringOptional
Namespace of the program
save
booleanOptional
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 returns an object
data
object

Errors

POST
$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
1{
2 "data": {
3 "rules": [
4 {
5 "name": "string",
6 "type": "string",
7 "acceptedAt": "2023-01-01T00:00:00Z",
8 "acceptedBy": "string",
9 "confidence": 0,
10 "config": {},
11 "createdAt": "2023-01-01T00:00:00Z",
12 "createdBy": "string",
13 "deletedAt": "2023-01-01T00:00:00Z",
14 "id": "string",
15 "updatedAt": "2023-01-01T00:00:00Z"
16 }
17 ],
18 "sourceKeys": [
19 "string"
20 ],
21 "destinationKeys": [
22 "string"
23 ],
24 "id": "string",
25 "namespace": "string",
26 "familyId": "string",
27 "createdAt": "2023-01-01T00:00:00Z",
28 "createdBy": "string",
29 "summary": {
30 "totalRuleCount": 0,
31 "addedRuleCount": 0,
32 "deletedRuleCount": 0
33 },
34 "accessToken": "string"
35 }
36}