---
schema_version: "1"
id: f89f08cac092d272cbb901b172b92d74a555a7b424a54c2697bb45b6a1c10b5a
title: "Step 1: Create ManagedEventSubscription with Tooling API"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/event-bus/pub-sub-api/guides/qs-java-managed-sub-create.md
canonical_url: https://developer.salesforce.com/docs/platform/pub-sub-api/guide/qs-java-managed-sub-create.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ed9a4851ad19b91a9a8f09bfd9cd7bd63fff631e34c1a72db1356f418f8185ff
products:
  - Pub/Sub API
  - Event Bus Docs
---
# Step 1: Create ManagedEventSubscription with Tooling API

Create a managed subscription configuration for `Order_Event__e`.

**Prerequisites**

- Create the `Order_Event__e` platform event by following the steps in [Step 1: Define a Platform Event](https://developer.salesforce.com/docs/platform/pub-sub-api/guide/qs-java-prereqs.md) in the main Java quick start.
- To complete the steps, you can use your favorite REST API tool. We recommend using Postman with the Salesforce API Collection, which contains handy templates for Salesforce API calls, including calls for creating ManagedEventSubscription. For instructions on how to set up Postman, see [Quick Start: Connect Postman to Salesforce](https://trailhead.salesforce.com/content/learn/projects/quick-start-connect-postman-to-salesforce) in Trailhead.

1. Send a POST request to this REST endpoint: `/services/data/v61.0/tooling/sobjects/ManagedEventSubscription`

   If you’re using Postman, in the Salesforce Platform APIs collection, expand **Event Platform** and **Managed Event Subscriptions**, and then click **Create managed event subscription**. If you don't find the Managed Event Subscriptions folder, refresh the collection. Click **View more actions** (**...**) next to the collection name, click **Pull changes**, and in the new tab, click **Pull Changes**.

   Use this request body.

```
{
  "FullName": "My_Managed_Subscription",
  "Metadata":
  {
      "label" : "My Managed Subscription",
      "topicName" : "/event/Order_Event__e",
      "defaultReplay": "LATEST",
      "state" : "RUN",
      "errorRecoveryReplay" : "LATEST"
  }
}
```

2. After you create the ManagedEventSubscription in Tooling API, the response returned contains the ID of the created ManagedEventSubscription record, similar to this response. Save the ID.

```
{
  "id": "18xKj000000000BIAQ",
  "success": true,
  "errors": [],
  "warnings": [],
  "infos": []
}
```
