> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://reference.flatfile.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://reference.flatfile.com/_mcp/server.

# Create a mapping between two schemas

POST https://api.x.flatfile.com/v1/mapping
Content-Type: application/json

Creates a list of mapping rules based on two provided schemas

Reference: https://reference.flatfile.com/api-reference/mapping/create-mapping-program

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `environmentId` (string, optional) — The ID of the environment

### Body (application/json)

This endpoint expects a ProgramConfig.

- `source` (SheetConfig, required) — Source schema
- `destination` (SheetConfig, required) — Destination schema
- `familyId` (string, optional) — ID of the family to add the program to
- `namespace` (string, optional) — Namespace of the program
- `save` (boolean, optional) — Whether to save the program for editing later. Defaults to false. If true, the response will contain an ID and access token.
- `rules` (list of MappingRuleConfig, optional) — Mapping rules to use for the program. If present, the program will be created with these rules.

## Response

### 200

- `data` (Program, required)

## Errors

### 400 Bad Request Error

- `errors` (list of Error, required)

### 404 Not Found Error

- `errors` (list of Error, required)

## Types

### SheetConfig

Describes shape of data as well as behavior

- `name` (string, required) — The name of your Sheet as it will appear to your end users.
- `fields` (list of Property, required) — Where you define your Sheet's data schema.
- `description` (string, optional) — A sentence or two describing the purpose of your Sheet.
- `slug` (string, optional) — A unique identifier for your Sheet.
- `readonly` (boolean, optional) — A boolean specifying whether or not this sheet is read only. Read only sheets are not editable by end users.
- `allowAdditionalFields` (boolean, optional) — Allow end users to add fields during mapping.
- `mappingConfidenceThreshold` (double, optional) — The minimum confidence required to automatically map a field
- `access` (list of enum, optional) — Control Sheet-level access for all users.
  - Allowed values: `*`, `add`, `edit`, `delete`, `import`
- `actions` (list of Action, optional) — An array of actions that end users can perform on this Sheet.
- `metadata` (any, optional) — Useful for any contextual metadata regarding the schema. Store any valid json
- `constraints` (list of SheetConstraint, optional) — An array of constraints that end users can perform on this Sheet.
- `treatments` (list of enum, optional) — An array of treatments that define the behavior of the sheet.
  - Allowed values: `CLIPPED_FROM_SHEET`, `ENUM_REFERENCE`
- `collection` (string, optional) — Collection in which to group the sheet

### MappingRuleConfig

- `name` (string, required) — Name of the mapping rule
- `type` (string, required)
- `config` (any, optional)
- `acceptedAt` (datetime, optional) — Time the mapping rule was last updated
- `acceptedBy` (string, optional) — User ID of the contributor of the mapping rule
- `metadata` (any, optional) — Metadata of the mapping rule

### Program

- `rules` (list of MappingRuleOrConfig, required) — Mapping rules
- `sourceKeys` (list of string, required) — Source keys
- `destinationKeys` (list of string, required) — Destination keys
- `id` (string, optional) — If this program was saved, this is the ID of the program
- `namespace` (string, optional) — Namespace of the program
- `familyId` (string, optional) — Family ID of the program, if it belongs to a family
- `createdAt` (datetime, optional) — If this program was saved, this is the time it was created
- `createdBy` (string, optional) — If this program was saved, this is the user ID of the creator
- `summary` (ProgramSummary, optional) — Summary of the mapping rules
- `accessToken` (string, optional) — If this program was saved, this token allows you to modify the program
- `acceptedAt` (datetime, optional) — If this program was accepted, this is the time it was accepted
- `acceptedBy` (string, optional) — If this program was accepted, this is the user ID of the user who accepted it

### Error

- `message` (string, required)
- `key` (string, optional)

### Property

- `type`: `string`
  - `key` (string, required)
  - `actions` (list of Action, optional) — An array of actions that end users can perform on this Column.
  - `alternativeNames` (list of string, optional)
  - `appearance` (FieldAppearance, optional) — Control the appearance of this field when it's displayed in a table or input
  - `config` (StringConfig, optional)
  - `constraints` (list of Constraint, optional) — A list of constraints that should be applied to this field. This is limited to a maximum of 10 constraints and all external and stored constraints must have unique validator values.
  - `description` (string, optional) — A short description of the field. Markdown syntax is supported.
  - `label` (string, optional) — User friendly field name
  - `metadata` (any, optional) — Useful for any contextual metadata regarding the schema. Store any valid json here.
  - `readonly` (boolean, optional)
  - `treatments` (list of string, optional) — A unique presentation for a field in the UI.
- `type`: `number`
  - `key` (string, required)
  - `actions` (list of Action, optional) — An array of actions that end users can perform on this Column.
  - `alternativeNames` (list of string, optional)
  - `appearance` (FieldAppearance, optional) — Control the appearance of this field when it's displayed in a table or input
  - `config` (NumberConfig, optional)
  - `constraints` (list of Constraint, optional) — A list of constraints that should be applied to this field. This is limited to a maximum of 10 constraints and all external and stored constraints must have unique validator values.
  - `description` (string, optional) — A short description of the field. Markdown syntax is supported.
  - `label` (string, optional) — User friendly field name
  - `metadata` (any, optional) — Useful for any contextual metadata regarding the schema. Store any valid json here.
  - `readonly` (boolean, optional)
  - `treatments` (list of string, optional) — A unique presentation for a field in the UI.
  - `isArray` (boolean, optional, deprecated) — Will allow multiple values and store as an array. Use enum-list type instead.
- `type`: `boolean`
  - `key` (string, required)
  - `actions` (list of Action, optional) — An array of actions that end users can perform on this Column.
  - `alternativeNames` (list of string, optional)
  - `appearance` (FieldAppearance, optional) — Control the appearance of this field when it's displayed in a table or input
  - `config` (BooleanPropertyConfig, optional)
  - `constraints` (list of Constraint, optional) — A list of constraints that should be applied to this field. This is limited to a maximum of 10 constraints and all external and stored constraints must have unique validator values.
  - `description` (string, optional) — A short description of the field. Markdown syntax is supported.
  - `label` (string, optional) — User friendly field name
  - `metadata` (any, optional) — Useful for any contextual metadata regarding the schema. Store any valid json here.
  - `readonly` (boolean, optional)
  - `treatments` (list of string, optional) — A unique presentation for a field in the UI.
- `type`: `date`
  - `key` (string, required)
  - `actions` (list of Action, optional) — An array of actions that end users can perform on this Column.
  - `alternativeNames` (list of string, optional)
  - `appearance` (FieldAppearance, optional) — Control the appearance of this field when it's displayed in a table or input
  - `constraints` (list of Constraint, optional) — A list of constraints that should be applied to this field. This is limited to a maximum of 10 constraints and all external and stored constraints must have unique validator values.
  - `description` (string, optional) — A short description of the field. Markdown syntax is supported.
  - `label` (string, optional) — User friendly field name
  - `metadata` (any, optional) — Useful for any contextual metadata regarding the schema. Store any valid json here.
  - `readonly` (boolean, optional)
  - `treatments` (list of string, optional) — A unique presentation for a field in the UI.
- `type`: `enum`
  - `config` (EnumPropertyConfig, required)
  - `key` (string, required)
  - `actions` (list of Action, optional) — An array of actions that end users can perform on this Column.
  - `alternativeNames` (list of string, optional)
  - `appearance` (FieldAppearance, optional) — Control the appearance of this field when it's displayed in a table or input
  - `constraints` (list of Constraint, optional) — A list of constraints that should be applied to this field. This is limited to a maximum of 10 constraints and all external and stored constraints must have unique validator values.
  - `description` (string, optional) — A short description of the field. Markdown syntax is supported.
  - `label` (string, optional) — User friendly field name
  - `metadata` (any, optional) — Useful for any contextual metadata regarding the schema. Store any valid json here.
  - `readonly` (boolean, optional)
  - `treatments` (list of string, optional) — A unique presentation for a field in the UI.
  - `isArray` (boolean, optional, deprecated) — Will allow multiple values and store as an array. Use enum-list type instead.
  - `multi` (boolean, optional, deprecated) — Will allow multiple values and store / provide the values in an array if set. Not all field types support arrays. Use enum-list type instead.
- `type`: `reference`
  - `config` (ReferencePropertyConfig, required)
  - `key` (string, required)
  - `actions` (list of Action, optional) — An array of actions that end users can perform on this Column.
  - `alternativeNames` (list of string, optional)
  - `appearance` (FieldAppearance, optional) — Control the appearance of this field when it's displayed in a table or input
  - `constraints` (list of Constraint, optional) — A list of constraints that should be applied to this field. This is limited to a maximum of 10 constraints and all external and stored constraints must have unique validator values.
  - `description` (string, optional) — A short description of the field. Markdown syntax is supported.
  - `label` (string, optional) — User friendly field name
  - `metadata` (any, optional) — Useful for any contextual metadata regarding the schema. Store any valid json here.
  - `readonly` (boolean, optional)
  - `treatments` (list of string, optional) — A unique presentation for a field in the UI.
  - `isArray` (boolean, optional, deprecated) — Will allow multiple values and store as an array. Use enum-list type instead.
- `type`: `reference-list`
  - `config` (ReferenceListPropertyConfig, required)
  - `key` (string, required)
  - `actions` (list of Action, optional) — An array of actions that end users can perform on this Column.
  - `alternativeNames` (list of string, optional)
  - `appearance` (FieldAppearance, optional) — Control the appearance of this field when it's displayed in a table or input
  - `constraints` (list of Constraint, optional) — A list of constraints that should be applied to this field. This is limited to a maximum of 10 constraints and all external and stored constraints must have unique validator values.
  - `description` (string, optional) — A short description of the field. Markdown syntax is supported.
  - `label` (string, optional) — User friendly field name
  - `metadata` (any, optional) — Useful for any contextual metadata regarding the schema. Store any valid json here.
  - `readonly` (boolean, optional)
  - `treatments` (list of string, optional) — A unique presentation for a field in the UI.
  - `isArray` (boolean, optional, deprecated) — Will allow multiple values and store as an array. Use enum-list type instead.
- `type`: `string-list`
  - `key` (string, required)
  - `actions` (list of Action, optional) — An array of actions that end users can perform on this Column.
  - `alternativeNames` (list of string, optional)
  - `appearance` (FieldAppearance, optional) — Control the appearance of this field when it's displayed in a table or input
  - `constraints` (list of Constraint, optional) — A list of constraints that should be applied to this field. This is limited to a maximum of 10 constraints and all external and stored constraints must have unique validator values.
  - `description` (string, optional) — A short description of the field. Markdown syntax is supported.
  - `label` (string, optional) — User friendly field name
  - `metadata` (any, optional) — Useful for any contextual metadata regarding the schema. Store any valid json here.
  - `readonly` (boolean, optional)
  - `treatments` (list of string, optional) — A unique presentation for a field in the UI.
- `type`: `enum-list`
  - `config` (EnumPropertyConfig, required)
  - `key` (string, required)
  - `actions` (list of Action, optional) — An array of actions that end users can perform on this Column.
  - `alternativeNames` (list of string, optional)
  - `appearance` (FieldAppearance, optional) — Control the appearance of this field when it's displayed in a table or input
  - `constraints` (list of Constraint, optional) — A list of constraints that should be applied to this field. This is limited to a maximum of 10 constraints and all external and stored constraints must have unique validator values.
  - `description` (string, optional) — A short description of the field. Markdown syntax is supported.
  - `label` (string, optional) — User friendly field name
  - `metadata` (any, optional) — Useful for any contextual metadata regarding the schema. Store any valid json here.
  - `readonly` (boolean, optional)
  - `treatments` (list of string, optional) — A unique presentation for a field in the UI.

### Action

- `label` (string, required) — The text on the Button itself
- `confirm` (boolean, optional) — Whether to show a modal to confirm the action
- `constraints` (list of ActionConstraint, optional) — A limitation or restriction on the action.
- `createdFrom` (string, optional) — The action that this action was cloned from
- `deletedAt` (datetime, optional) — The time this action was deleted
- `description` (string, optional) — The text that appears in the dialog after the action is clicked.
- `guardrail` (Guardrail, optional)
- `guide` (Guide, optional)
- `icon` (string, optional) — Icon will work on primary actions. It will only accept an already existing Flatfile design system icon.
- `inputForm` (InputForm, optional) — Adds an input form for this action after it is clicked.
- `invalidConditionalMessaging` (boolean, optional) — When enabled, shows dynamic confirmation messages based on record validation status instead of the static description
- `invalidRecordsMessage` (string, optional) — Custom message to show when there are invalid records (only used when invalidConditionalMessaging is true)
- `lastPropagatedAt` (datetime, optional) — The last time this action was propagated to a workbook
- `messages` (list of ActionMessage, optional)
- `mode` (enum, optional) — Foreground and toolbarBlocking action mode will prevent interacting with the resource until complete
  - Allowed values: `foreground`, `background`, `toolbarBlocking`
- `mount` (ActionMount, optional)
- `operation` (string, optional) — This will become the job operation that is triggered
- `primary` (boolean, optional) — A primary action will be more visibly present, whether in Sheet or Workbook.
- `schedule` (enum, optional) — Determines if the action should happen on a regular cadence.
  - Allowed values: `weekly`, `daily`, `hourly`
- `tooltip` (string, optional) — A tooltip that appears when hovering the action button
- `type` (string, optional) — **This is deprecated.**
- `validRecordsMessage` (string, optional) — Custom message to show when all records are valid (only used when invalidConditionalMessaging is true)
- `requireAllValid` (boolean, optional, deprecated) — **This is deprecated. Use `constraints` instead.**
- `requireSelection` (boolean, optional, deprecated) — **This is deprecated. Use `constraints` instead.**
- `slug` (string, optional, deprecated) — **This is deprecated. Use `operation` instead.**

### SheetConstraint

- `type`: `unique`
  - `fields` (list of string, required) — The fields that must be unique together
  - `name` (string, required) — The name of the constraint
  - `strategy` (enum, required)
    - Allowed values: `hash`, `concat`
  - `config` (CompositeUniqueConstraintConfig, optional) — Configuration options for the composite unique constraint
  - `requiredFields` (list of string, optional) — Fields that, when empty, will cause this unique constraint to be ignored
- `type`: `external`
  - `validator` (string, required)
  - `config` (any, optional)
  - `fields` (list of string, optional) — The fields that must be unique together

### MappingRuleOrConfig

- `name` (string, required) — Name of the mapping rule
- `type` (string, required)
- `acceptedAt` (datetime, optional) — Time the mapping rule was last updated
- `acceptedBy` (string, optional) — User ID of the contributor of the mapping rule
- `confidence` (integer, optional) — Confidence of the mapping rule
- `config` (any, optional)
- `createdAt` (datetime, optional) — Time the mapping rule was created
- `createdBy` (string, optional) — User ID of the creator of the mapping rule
- `deletedAt` (datetime, optional) — Time the mapping rule was deleted
- `id` (string, optional) — ID of the mapping rule
- `metadata` (any, optional) — Metadata of the mapping rule
- `updatedAt` (datetime, optional) — Time the mapping rule was last updated

### ProgramSummary

- `totalRuleCount` (integer, required) — Total number of mapping rules
- `addedRuleCount` (integer, required) — Number of mapping rules added
- `deletedRuleCount` (integer, required) — Number of mapping rules deleted

### FieldAppearance

Control the appearance of this field when it's displayed in a table or input

- `size` (enum, optional) — The default visual sizing. This sizing may be overridden by a user
  - Allowed values: `xs`, `s`, `m`, `l`, `xl`

### StringConfig

- `size` (enum, required) — How much text should be storeable in this field
  - Allowed values: `tiny`, `normal`, `medium`, `long`

### Constraint

- `type`: `required`
  - `config` (RequiredConstraintConfig, optional)
- `type`: `unique`
  - `config` (UniqueConstraintConfig, optional)
- `type`: `computed`
- `type`: `external`
  - `validator` (string, required)
  - `config` (any, optional)
  - `description` (string, optional) — A full description of what this constraint configuration does
  - `label` (string, optional) — A short description of what this constraint constraint should do, example - values between 1 and 100
- `type`: `stored`
  - `validator` (string, required) — Must match the constraint validator name.
  - `config` (any, optional)
  - `description` (string, optional) — A full description of what this constraint configuration does
  - `label` (string, optional) — A short description of what this constraint constraint should do, example - values between 1 and 100
  - `version` (integer, optional) — The version of the stored constraint to use. (Defaults to version 1.)

### NumberConfig

- `decimalPlaces` (integer, optional, deprecated) — Number of decimal places to round data to

### BooleanPropertyConfig

- `allowIndeterminate` (boolean, required) — Allow a neither true or false state to be stored as `null`

### EnumPropertyConfig

- `options` (list of EnumPropertyOption, required)
- `allowCustom` (boolean, optional) — Permit the user to create new options for this specific field.
- `sortBy` (enum, optional) — Sort the options by the value of this property. Defaults to `label`.
  - Allowed values: `label`, `value`, `ordinal`

### ReferencePropertyConfig

- `ref` (string, required) — Full path reference to a sheet configuration. Must be in the same workbook.
- `key` (string, required) — Key of the property to use as the reference key. Defaults to `id`
- `filter` (ReferenceFilter, optional) — Optional filter to narrow the set of records in the reference sheet used as valid values
- `relationship` (enum, optional, deprecated) — The type of relationship this defines
  - Allowed values: `has-one`, `has-many`

### ReferenceListPropertyConfig

- `ref` (string, required) — Full path reference to a sheet configuration. Must be in the same workbook.
- `key` (string, required) — Key of the property to use as the reference key. Defaults to `id`
- `filter` (ReferenceFilter, optional) — Optional filter to narrow the set of records in the reference sheet used as valid values

### ActionConstraint

- `type`: `hasAllValid`
  - `ignoreSelection` (boolean, optional)
- `type`: `hasSelection`
- `type`: `hasData`
- `type`: `hasColumnEnabled`

### Guardrail

- `content` (string, required) — Markdown guardrail for this action

### Guide

- `content` (string, required) — Markdown guidance for this action

### InputForm

- `type` (enum, required)
  - Allowed values: `simple`
- `fields` (list of InputField, required)

### ActionMessage

- `type` (enum, required)
  - Allowed values: `error`, `info`
- `content` (string, required)

### ActionMount

- `type`: `sheet`
  - `slugs` (list of string, optional)
- `type`: `workbook`
  - `slugs` (list of string, optional)
- `type`: `field`
  - `keys` (list of string, optional)
- `type`: `document`
- `type`: `file`

### CompositeUniqueConstraintConfig

- `message` (string, optional) — Custom validation message to display when the constraint fails
- `level` (enum, optional) — Validation level (error, warn, info). Defaults to error.
  - Allowed values: `error`, `warn`, `info`

### RequiredConstraintConfig

- `message` (string, optional) — Custom validation message to display when the constraint fails
- `level` (enum, optional) — Validation level (error, warn, info). Defaults to error.
  - Allowed values: `error`, `warn`, `info`

### UniqueConstraintConfig

- `caseSensitive` (boolean, optional) — Ignore casing when determining uniqueness
- `ignoreEmpty` (boolean, optional) — Do not flag empty values as duplicate
- `message` (string, optional) — Custom validation message to display when the constraint fails
- `level` (enum, optional) — Validation level (error, warn, info). Defaults to error.
  - Allowed values: `error`, `warn`, `info`

### EnumPropertyOption

- `value` (any, required) — The value or ID of this option. This value will be sent in egress. The type is a string | integer | boolean.
- `label` (string, optional) — A visual label for this option
- `description` (string, optional) — A short description for this option
- `color` (string, optional) — An optional color to assign this option
- `icon` (string, optional) — A reference pointer to a previously registered icon
- `meta` (map from string to any, optional) — An arbitrary JSON object to be associated with this option and made available to hooks
- `alternativeNames` (list of string, optional) — Alternative names to match this enum option to
- `ordinal` (integer, optional) — The order of this option in the list. SortBy must be set to `ordinal` to use this.

### ReferenceFilter

If provided, the reference filter will narrow the set of records in the reference sheet used as the set of valid values for the record. Only rows where the value in the reference sheet's refField matches the value in this record's recordField will be used.

- `refField` (string, required) — The field key of the reference sheet to filter with
- `recordField` (string, required) — The field key of the record used to filter the reference field

### InputField

- `key` (string, required) — Unique key for a Field.
- `label` (string, required) — Visible name of a Field.
- `type` (string, required) — Field Types inform the user interface how to sort and display data.
- `description` (string, optional) — Brief description below the name of the Field.
- `defaultValue` (any, optional) — Default value for a Field.
- `config` (InputConfig, optional) — Additional configuration for enum Fields.
- `constraints` (list of InputConstraint, optional) — Indicate additional validations that will be applied to the Field.

### InputConfig

- `options` (list of InputEnumPropertyOption, required)

### InputConstraint

- `type` (enum, required)
  - Allowed values: `required`

### InputEnumPropertyOption

- `value` (any, required) — The value or ID of this option. This value will be sent in egress. The type is a string | integer | boolean.
- `label` (string, optional) — A visual label for this option, defaults to value if not provided
- `description` (string, optional) — A short description for this option
- `color` (string, optional) — An optional color to assign this option
- `icon` (string, optional) — A reference pointer to a previously registered icon
- `meta` (map from string to any, optional) — An arbitrary JSON object to be associated with this option and made available to hooks

## Examples

**Request**

```json
{
  "source": {
    "name": "name",
    "fields": [
      {
        "type": "string",
        "key": "key"
      },
      {
        "type": "string",
        "key": "key"
      }
    ]
  },
  "destination": {
    "name": "name",
    "fields": [
      {
        "type": "string",
        "key": "key"
      },
      {
        "type": "string",
        "key": "key"
      }
    ]
  }
}
```

**Response**

```json
{
  "data": {
    "rules": [
      {
        "name": "name",
        "type": "type",
        "acceptedAt": "2024-01-15T09:30:00Z",
        "acceptedBy": "acceptedBy",
        "confidence": 1,
        "config": {
          "key": "value"
        },
        "createdAt": "2024-01-15T09:30:00Z",
        "createdBy": "createdBy",
        "deletedAt": "2024-01-15T09:30:00Z",
        "id": "id",
        "metadata": {
          "key": "value"
        },
        "updatedAt": "2024-01-15T09:30:00Z"
      },
      {
        "name": "name",
        "type": "type",
        "acceptedAt": "2024-01-15T09:30:00Z",
        "acceptedBy": "acceptedBy",
        "confidence": 1,
        "config": {
          "key": "value"
        },
        "createdAt": "2024-01-15T09:30:00Z",
        "createdBy": "createdBy",
        "deletedAt": "2024-01-15T09:30:00Z",
        "id": "id",
        "metadata": {
          "key": "value"
        },
        "updatedAt": "2024-01-15T09:30:00Z"
      }
    ],
    "sourceKeys": [
      "sourceKeys",
      "sourceKeys"
    ],
    "destinationKeys": [
      "destinationKeys",
      "destinationKeys"
    ],
    "id": "id",
    "namespace": "namespace",
    "familyId": "familyId",
    "createdAt": "2024-01-15T09:30:00Z",
    "createdBy": "createdBy",
    "summary": {
      "totalRuleCount": 1,
      "addedRuleCount": 1,
      "deletedRuleCount": 1
    },
    "accessToken": "accessToken",
    "acceptedAt": "2024-01-15T09:30:00Z",
    "acceptedBy": "acceptedBy"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.x.flatfile.com/v1/mapping"

payload = {
    "source": {
        "name": "name",
        "fields": [
            {
                "type": "string",
                "key": "key"
            },
            {
                "type": "string",
                "key": "key"
            }
        ]
    },
    "destination": {
        "name": "name",
        "fields": [
            {
                "type": "string",
                "key": "key"
            },
            {
                "type": "string",
                "key": "key"
            }
        ]
    }
}
headers = {
    "X-Disable-Hooks": "true",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```typescript
import { FlatfileClient } from "@flatfile/api";

const client = new FlatfileClient({ token: "YOUR_TOKEN" });
await client.mapping.createMappingProgram({
    body: {
        source: {
            name: "name",
            fields: [{
                    type: "string",
                    key: "key"
                }, {
                    type: "string",
                    key: "key"
                }]
        },
        destination: {
            name: "name",
            fields: [{
                    type: "string",
                    key: "key"
                }, {
                    type: "string",
                    key: "key"
                }]
        }
    }
});

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.x.flatfile.com/v1/mapping"

	payload := strings.NewReader("{\n  \"source\": {\n    \"name\": \"name\",\n    \"fields\": [\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      },\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      }\n    ]\n  },\n  \"destination\": {\n    \"name\": \"name\",\n    \"fields\": [\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      },\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      }\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-Disable-Hooks", "true")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.x.flatfile.com/v1/mapping")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Disable-Hooks"] = 'true'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"source\": {\n    \"name\": \"name\",\n    \"fields\": [\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      },\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      }\n    ]\n  },\n  \"destination\": {\n    \"name\": \"name\",\n    \"fields\": [\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      },\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      }\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.x.flatfile.com/v1/mapping")
  .header("X-Disable-Hooks", "true")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"source\": {\n    \"name\": \"name\",\n    \"fields\": [\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      },\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      }\n    ]\n  },\n  \"destination\": {\n    \"name\": \"name\",\n    \"fields\": [\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      },\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      }\n    ]\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.x.flatfile.com/v1/mapping', [
  'body' => '{
  "source": {
    "name": "name",
    "fields": [
      {
        "type": "string",
        "key": "key"
      },
      {
        "type": "string",
        "key": "key"
      }
    ]
  },
  "destination": {
    "name": "name",
    "fields": [
      {
        "type": "string",
        "key": "key"
      },
      {
        "type": "string",
        "key": "key"
      }
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'X-Disable-Hooks' => 'true',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.x.flatfile.com/v1/mapping");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Disable-Hooks", "true");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"source\": {\n    \"name\": \"name\",\n    \"fields\": [\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      },\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      }\n    ]\n  },\n  \"destination\": {\n    \"name\": \"name\",\n    \"fields\": [\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      },\n      {\n        \"type\": \"string\",\n        \"key\": \"key\"\n      }\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Disable-Hooks": "true",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "source": [
    "name": "name",
    "fields": [
      [
        "type": "string",
        "key": "key"
      ],
      [
        "type": "string",
        "key": "key"
      ]
    ]
  ],
  "destination": [
    "name": "name",
    "fields": [
      [
        "type": "string",
        "key": "key"
      ],
      [
        "type": "string",
        "key": "key"
      ]
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.x.flatfile.com/v1/mapping")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```