---
schema_version: "1"
id: b8286f97146b9c08ddd766fdf4a914c09cd6a390409f3c56a542da69e9a76a75
title: EventSubscription
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_eventsubscription.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_eventsubscription.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: f08321fd972f5d3fcf03acb826168fb7e0a47339f004dc664d53eb0b23200945
description: Represents a subscription to an event type. Removed in API version 46.0. This type extends the Metadata metadata type and inherits its fullName field.
---
# EventSubscription

Represents a subscription to an event type. Removed in API version 46.0. This type extends the Metadata metadata type and inherits its fullName field.

## File Suffix and Directory Location

EventSubscription components have the suffix file path .subscription, and are stored in the eventSubscriptions folder.

## Version

Event subscription components are available in API versions 41.0 to 45.0.

## Limits

Your org can have a maximum of:

- 4,000 total event subscriptions
- 2,000 active event subscriptions

## Fields

| Field Name | Field Type | Description |
| --- | --- | --- |
| active | boolean | If the subscription isn’t active, it never receives any events. |
| eventParameters | [EventParameterMap](#eventparametermap)\[\] | An array of parameters that must be true for published events. |
| eventType | string | Required. The name of the platform event. |
| referenceData | string | Required. If the subscriber is a flow of type CustomEvent, referenceData is flowName\_versionNumber. For example, Printer\_Management\_2. |

## EventParameterMap

An array of parameters that must be true for published events. For example, subscribe to Vendor Response events only if Status\_\_c is Shipped.

Each event subscription can have up to 10 parameters.

| Field Name | Field Type | Description |
| --- | --- | --- |
| parameterName | string | Required. The published event’s field name. |
| parameterValue | string | The value that must be true. |

## Declarative Metadata Sample Definition

The following is an example of an active event subscription.

<?xml version="1.0" encoding="UTF-8"?>
<EventSubscription xmlns="http://soap.sforce.com/2006/04/metadata">
    <active\>true</active\>
    <eventType\>Printer\_Status\_\_e</eventType\>
    <referenceData\>Printer\_Management</referenceData\>
</EventSubscription\>

The following is an example of an inactive event subscription that sets event parameters.

<?xml version="1.0" encoding="UTF-8"?>
<EventSubscription xmlns="http://soap.sforce.com/2006/04/metadata">
   <name>MySubscription</name>
   <active>false</active>
   <eventParameters>
      <parameterName>Ink\_Status\_\_c</parameterName>
      <parameterValue>low</parameterValue> 
   </eventParameters>
   <eventParameters>
      <parameterName>Serial\_Number\_\_c</parameterName>
      <parameterValue>00123456789</parameterValue>
   </eventParameters>
   <eventType>Printer\_Status\_\_e</eventType>
   <referenceData>My\_Event\_Based\_Process\_1</referenceData>
</EventSubscription>

The following is an example package.xml that deploys or retrieves all the available event subscription metadata in your org.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
   <types\>
      <members\>\*</members\>
      <name\>EventSubscription</name\>
   </types\>
   <version\>41.0</version\>
</Package\>

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).