--- title: Manage the mapping configuration of a source slug: '29' canonical_url: https://docs.coveo.com/en/29/ collection: index-content source_format: adoc --- # Manage the mapping configuration of a source The _mapping configuration_ of a [source](https://docs.coveo.com/en/246/) may include any number of [mappings](https://docs.coveo.com/en/217/). Each mapping may contain one or more [rules](https://docs.coveo.com/en/236/) that are evaluated sequentially when the [Coveo indexing pipeline](https://docs.coveo.com/en/184/) processes an incoming [item](https://docs.coveo.com/en/210/) in that source to determine how to use its [metadata](https://docs.coveo.com/en/218/) to populate [fields](https://docs.coveo.com/en/200/) in the [index](https://docs.coveo.com/en/204/). Each individual mapping can apply to all incoming items in a source, or only to a specific item type. Use the [Update mapping configuration](https://platform.cloud.coveo.com/docs?urls.primaryName=Source#/Mappings/rest_organizations_paramId_sources_paramId_mappings_put) operation to manage the mapping configuration of a specific source in a [Coveo organization](https://docs.coveo.com/en/185/). Alternatively, you can perform this action from the [Coveo Administration Console](https://docs.coveo.com/en/183/). See [Manage source mappings](https://docs.coveo.com/en/1640/) for details. **Request template** ```http PUT https://platform.cloud.coveo.com/rest/organizations//sources//mappings?rebuild= HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Bearer ``` Payload: ```json { "common": { "rules": [ * ] }, "types": [ { "rules": [ * ], "type": }* ] } ``` In the request path: * Replace `` with your [organization ID](https://docs.coveo.com/en/148/). * Replace `` with the [ID of the target source](https://docs.coveo.com/en/3390#copy-a-source-name-or-id). In the request query string, set the `rebuild` parameter to `true` to rebuild your source after the mapping configuration is successfully updated. > **Note** > > Setting the `rebuild` parameter to `true` has no effect if the target source is a Push source managed by custom external code. In the `Authorization` HTTP header: * Replace `` with an access token that grants the [privilege](https://docs.coveo.com/en/228/) to edit sources (that is, the **Edit** [access level](https://docs.coveo.com/en/2818/) on the **Sources** [domain](https://docs.coveo.com/en/2819/)) in the target Coveo organization. See [Create an API key](https://docs.coveo.com/en/1718#create-an-api-key) for details. In the request body: * In the `common` property, in the `rules` array, for each mapping you want to evaluate when processing an incoming item in the target source (regardless of its type), replace `*` with a valid mapping definition. See [Mapping definition examples](https://docs.coveo.com/en/66/) for details. * In the `types` array, for each type of item for which you want to specify a mapping: ** In the `rules` array, replace `*` with one or more valid mapping definitions. Replace `` with the `objecttype`, `mappingtype`, `documenttype`, or `filetype` standard metadata value an incoming item must match for the type-specific mappings to be evaluated for this item. See [Source item types](https://docs.coveo.com/en/1965/) for details. A successful response (`200 OK`) contains information about the new mapping configuration. > **Note** > > A unique alphanumeric `id` is automatically assigned to each mapping and type. > You can later refer to these identifiers to modify specific aspects of a source mapping configuration. **Example** **Defining the entire mapping configuration of a source** ```http PUT https://platform.cloud.coveo.com/rest/organizations/mycoveocloudv2organizationg8tp8wu3/sources/mycoveocloudv2organizationg8tp8wu3-rp5rxzbdz753uhndklv2ztkfgy/mappings?rebuild=false HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Bearer **********-****-****-****-************ ``` Payload ```json { "common": { "rules": [ { "content": [ "%[productname]" ], "field": "product" }, // ...More common mappings... ] }, "types": [ { "rules": [ { "content": [ "%[dominantcolorshade]", " ", "%[dominantcolorname]" ], "field": "dominantcolor" }, // ...More type-specific mappings... ], "type": "Image" }, // ...More item type definitions... ] } ``` **200 OK response body** ```json { "common": { "rules": [ { "content": [ "%[productname]" ], "field": "product", "id": "tmc7uozasfgjae554xyvdjkkxu" }, // ...More common mappings... ] }, "types": [ { "rules": [ { "content": [ "%[dominantcolorshade]", " ", "%[dominantcolorname]" ], "field": "dominantcolor", "id": "v25gsykuqp7g5wdenx6isikkei" }, // ...More type-specific mappings... ], "type": "Image", "id": "Image" }, // ...More item type definitions... ] } ```