---
schema_version: "1"
id: 6ffecaa1d73c9a75ffe0f02c671513c661aa60fa7d0bfa37e769957c2d654819
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-byoc-ccaas/guides/add-custom-objects.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-byoc-ccaas/guide/add-custom-objects.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 281c7de771abd2507e7545ee75fa2acc0443c95e2cd988f372dda87e5f1dcb10
products:
  - Bring Your Own Channel for CCaaS
  - 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.
   - Ask the admin for the DurableId of their flow. The DurableId always starts with 300 and is different from the FlowId.
   - 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 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 route the flow if your implementation uses partner-owned routing (`ConversationChannelDefinition.routingOwner` is `Partner`), make a call to the Interaction Service Route Conversation API (`POST /api/v1/route`).

   - Set `routingType` to `Initial`, and pass in the target flow ID and fallback queue ID through `routingInfo.flow`.
   - Use the `routingAttributes` parameter to pass the key-value pair for the flow variable in the format `"routingAttributes" : {"key" : "value"}`, where `key` is the channel variable name in the parameter mapping, and `value` is the value. The value length should 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/route`.

   ```json
{
      "conversationIdentifier": "1234a5bc-52b8-43ed-9608-7997f7b88dc1",
      "routingType": "Initial",
      "routingInfo": {
        "flow":{
          "flowId": "300SG00000H3idpYAB",
          "queueId": "00GSG000004PZNl"
        },
        "routingAttributes": {
          "newEndUserName" : "Sally Goforth"
        }
      }
    }
```

**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)
