# 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`

```sfdocs-code {"lang":"json", "title": "Sample API Payload"}
{
  "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`

```sfdocs-code {"lang":"json", "title": "Sample API Payload"}
{
  "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](/docs/service/messaging-byob/guide/configure-flow-routework.md).
