---
schema_version: "1"
id: c0c6cd130a209fce1e94739c17b3b48cca0647fdfb37986ec2089145b1cfafdf
title: Add Support for Custom Parameters
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/messaging-partner/guides/add-custom-objects.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-partner/guide/add-custom-objects.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0f78d1700f60f6be8534eae5bb1fd54f7b83908b50544316f84226ca7ed0b586
products:
  - Bring Your Own Channel for Messaging
  - Service Cloud Developer Content
---
# Add Support for Custom Parameters

Use parameters, parameter mappings, and flows to route custom data to Salesforce objects. For example, pass the name of a Messaging end user to the messaging session object using a flow.

1. To pass custom parameters in the API, set the `capabilitiesSupportsCustomChannelParameters` field to `true` in ConversationChannelDefinition.
2. Ask your admin to use the guidance in [Route Data to Objects in Bring Your Own Channel](https://help.salesforce.com/s/articleView?id=service.partner_messaging_parameters.htm) to take these steps. Their business needs will be different than those in the example, so the exact flow logic will differ.

   - The admin should create an Omni-Channel flow with a variable that’s used to route data to an object. For example, use a variable named `newEndUserName` to update the Name field of a Messaging User object.

   - In Messaging Settings, the admin should create a custom parameter that matches the variable name in the Omni-Channel flow and add a parameter mapping for the custom parameter. For example, the admin creates a custom parameter named newEndUserName and maps it. When the admin creates the new parameter and mapping, ask them to note the Channel Variable Name and the Maximum Length.

     ![Note Channel Variable Name in new parameter](https://developer.salesforce.com/docs/media/messaging-partner/messaging_byoc_add_custom_parameter.png '{"class": "image-md"}')

3. To send a message while passing the parameter and its value to the object, make a call to the Interaction Service API. Choose the endpoint that matches your use case.

   - If the messaging end user sends the first message in the conversation, call the Interactions API (`POST /api/v1/interactions`).
   - If an AI agent sends the first message in the conversation through proactive messaging, call the Establish Conversation API (`POST /api/v1/conversation`).
   - For either endpoint, use the `routingAttributes` parameter to pass the key-value pair for the flow variable in the format `"routingAttribute" : "key" : "value"`, where `key` is the channel variable name in the parameter mapping, and `value` is the value. The value length must be less than or equal to the Maximum Length that the Salesforce admin set for the custom parameter in Messaging Settings.

   In the sample payload, in `routingAttributes` the key is set to `newEndUserName` which is mapped to the input `newEndUserName` parameter in Salesforce.

   Here is a sample payload for `POST /api/v1/interactions`.

   ```json
{
     "to": "b8a600d5-9c5f-4e9a-a42a-0b82cee60ede",
     "from": "APlusCustomer",
     "routingAttributes": {
       "newEndUserName" : "Sally Goforth"
     },
     "interactions": [
       {
         "timestamp": 8002345678,
         "interactionType": "EntryInteraction",
         "payload": {
         "id": "f7904eb8-5352-5c5e-bdf6-5f1005001007",
         "entryType": "Message",
         "abstractMessage": {
           "messageType": "StaticContentMessage",
           "id": "f7904eb8-5352-5c5e-bdf6-5f1005001007",
           "staticContent": {
             "formatType": "Text",
             "text": "Hi there"
             }
           }
         }
       }
     ]
   }
```

**See Also**

- _Salesforce Help_: [Route Data to Objects in Bring Your Own Channel](https://help.salesforce.com/s/articleView?id=service.partner_messaging_parameters.htm)
- _Salesforce Help_: [Understand the Details of the Routing Lifecycle](https://help.salesforce.com/s/articleView?id=service.omnichannel_psr_lifecycle.htm)
- [Interaction Service API](https://developer.salesforce.com/docs/service/interaction-service-api/guide/get-started.html)
- _GitHub_: [Interaction Service APIs](https://github.com/salesforce-misc/interaction-service-apis)
