---
schema_version: "1"
id: 25c1d5fb557c3f6acf5904024a39a9386f8837c1704590c03c484e46f5a90958
title: "Step 4: Create the External Bot Definition and Vendor Integration Records"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/messaging-byob/guides/create-entity-records.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-byob/guide/create-entity-records.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3f6898f733e55b7fe062b63608e4ce743ed35e8b593d46d2a0e3e6b8b6fda5d9
products:
  - Bring Your Own Bot for Messaging
  - Service Cloud Developer Content
---
# Step 4: Create the External Bot Definition and Vendor Integration Records

The Vendor Integration (ExtConvParticipantIntegDef) and External Bot Definition (ExternalConversationBotDef) records contain the metadata needed to connect your external bot to Salesforce.
Use your preferred method, such as [Metadata API](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_intro.htm) or [Tooling API](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/intro_api_tooling.htm), and the sample payload to create the record.

This section outlines the steps to create essential entity records in Salesforce using [Tooling API](https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/intro_api_tooling.htm). It shows you how to create both the `ExtConvParticipantIntegDef` and `ExternalConversationBotDef` records. These records are important for making sure your external bot connects to Salesforce.

:**note:** Bring Your Own Bot (BYOB) requires Salesforce API version 64.0 or later. The examples below use `v64.0`. Use a later version if your org supports one.:

## Create the ExtConvParticipantIntegDef Record

Use Tooling API to create the `ExtConvParticipantIntegDef` record.

**Method**: POST  
**URI**: `/services/data/v64.0/tooling/sobjects/ExtConvParticipantIntegDef`

```json
{
  "masterLabel": "Google Integration",
  "developerName": "Partner_AgentForce",
  "customPlatformEvent": "byob256__Platform_Event__e",
  "customEventPayloadField": "byob256__Payload__c",
  "customEventTypeField": "byob256__Event_Type__c"
}
```

In the payload, `masterLabel` can be any value, and `developerName` is the API name of the external client app you created.

The `customEventPayloadField`, `customEventTypeField`, and `customPlatformEvent` are the API names of the custom fields you created. The `customPlatformEvent` is the API name of the platform event created above.

Save the returned record ID for creating `ExternalConversationBotDef`.

If you encounter `INVALID_SESSION_ID` issues, use the Metadata API via Workbench (Utilities tab).

## Create the ExternalConversationBotDef Record

Use Tooling API to create the `ExternalConversationBotDef` record.

**Method**: POST  
**URI**: `/services/data/v64.0/tooling/sobjects/ExternalConversationBotDef`

```json
{
  "extConvParticipantIntegDefId": "1JYRZ00000000014AA",
  "externalId": "3264",
  "isActive": true,
  "displayName": "CliniCore"
}
```

In the payload, `extConvParticipantIntegDefId` is the record ID that was returned when you created the `ExtConvParticipantIntegDef` record.

## Next Steps

After you create the entity records, [configure Salesforce Flow with the RouteWork action](https://developer.salesforce.com/docs/service/messaging-byob/guide/configure-flow-routework.md).
