> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hotglue.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set tenant mapping

> Adds a mapping object to the `tenant-config.json`.

You can use the **Set Tenant Mapping** endpoint to apply a mapping without using the mapping widget.

<Info>If the **Update Fields on Mapping** widget setting is enabled, the optional `entityType`, `entityId`, and `flow` params are required.</Info>

Below is an example body:

```json theme={null}
{
  "config": {
    "mapping": {
      "<FlowId>": {
        "<InternalTableName>/<RemoteTableName>": {
          "<InternalField>": "<RemoteField>" 
        }
      }
    }
  },
  "entityType": "taps", // optional - `taps` or `connectors`
  "entityId": "salesforce", // optional
  "flow": "FElWoODnU" // optional
}
```


## OpenAPI

````yaml put /tenant/{env_id}/{tenant}/mapping
openapi: 3.1.0
info:
  title: hotglue API
  version: '1.2'
servers:
  - url: https://api.hotglue.com
security:
  - sec0: []
paths:
  /tenant/{env_id}/{tenant}/mapping:
    put:
      summary: Set tenant mapping
      description: Adds a mapping object to the `tenant-config.json`.
      operationId: tenants-set-mapping
      parameters:
        - name: env_id
          in: path
          description: ID of environment
          schema:
            type: string
          required: true
        - name: tenant
          in: path
          description: ID of tenant
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                config:
                  type: object
                  required:
                    - mapping
                  properties:
                    mapping:
                      type: object
                      title: Flow mappings
                      description: Map of Flow ID → Table mappings
                      propertyNames:
                        type: string
                        description: Flow ID (e.g., FElWoODnU)
                      additionalProperties:
                        type: object
                        title: Table mappings
                        description: Map of "InternalTable/RemoteTable" → Field mappings
                        propertyNames:
                          type: string
                          description: >-
                            "InternalTable/RemoteTable" pair (e.g.,
                            Leads/Contact)
                          pattern: ^[^/]+/[^/]+$
                        additionalProperties:
                          type: object
                          title: Field mappings
                          description: Map of internal field → remote field name
                          propertyNames:
                            type: string
                            description: Internal field name (e.g., interest)
                            minLength: 1
                          additionalProperties:
                            type: string
                            description: Remote field name (e.g., LastName)
                            minLength: 1
                entityType:
                  type: string
                  description: >-
                    Optional. Use `taps` for one-way flows, and `connectors` for
                    bi-directional flows.
                  enum:
                    - taps
                    - connectors
                entityId:
                  type: string
                  description: >-
                    Optional. Identifier for the tap/connector (e.g.,
                    "salesforce").
                flow:
                  type: string
                  description: Optional. Flow ID that this operation pertains to.
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: {}
              schema:
                type: object
                properties: {}
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: {}
              schema:
                type: object
                properties: {}
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: x-api-key

````