---
schema_version: "1"
id: a15387f88d90040792f95cd296aff846ce6dc862fbf088e4cfbd6b095089b7e2
title: Event Definition Schema
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-apis/event-definition-schema.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/event-definition-schema.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 77b669d4797aae82076239fe339f111a476e9637494b52cd58347b73bed6ad27
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Event Definition Schema

When creating an event definition, the API uses the information contained in the `schema` object to create a data extension associated with the event definition. The schema defines the name, nullability, and default values of the fields to be included in the data extension.

## Example JSON Schema Definition

```json
{
  "schema": {
    "sendableCustomObjectField": "contactKey",
    "SendableSubscriberField": "contactKey",
    "fields": [
      {
        "name": "firstName",
        "dataType": "text",
        "maxLength": "100",
        "isNullable": false,
        "defaultValue": ""
      },
      {
        "name": "contactKey",
        "dataType": "text",
        "maxLength": "100",
        "isNullable": false,
        "defaultValue": ""
      }
    ]
  }
}
```

## Schema Fields

The event definition schema must specify a subscriber key field. This can be a subscriber key or email address, depending on the account type. The field specified will be used as the contact key when invoking journeys.

| Field                     | Description                                                                                                                                                                                                                                         |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SendableCustomObjectField | This field maps to the subscriber key (or subscriber id/email address). This field should hold, in most cases, the contact key. Journey Builder uses this field to populate the contact key when invoking journeys. Journeys require a contact key. |
| SendableSubscriberField   | Valid options are SubscriberKey, SubscriberId or EmailAddress. Most API implementations use the SubscriberKey value.                                                                                                                                |

## See Also

- _Salesforce Help_: [Data Extension Data Types](https://help.salesforce.com/articleView?id=mktg.mc_es_data_extension_data_types.htm)
