How to Create a Data Extension from JSON

Note: Deployment Manager was retired in 2022 and replaced with Package Manager.

With Deployment Manager you can create a Data Extension automatically from a JSON file. This is a huge time saver when you’ve got a DE to create with 30+ fields!

This is what the JSON looks like:

[{
	"componentPayloadVersion": 1,
	"componentType": "DataExtension",
	"clusterComponentKey": "DataExtension.1",
	"created": "TIMESTAMP",
	"component": {
		"dataRetentionProperties": {
			"isDeleteAtEndOfRetentionPeriod": false,
			"isRowBasedRetention": false,
			"isResetRetentionPeriodOnImport": false,
			"rowBasedThreshold": 100000000
		},
		"description": "ADD DE DESC",
		"devicePreferenceFieldName": "",
		"name": "ADD DE NAME",
		"status": 0,
		"fields": [{
			"description": "",
			"isHidden": false,
			"isInheritable": false,
			"isNullable": false,
			"isOverridable": false,
			"isPrimaryKey": false,
			"isReadOnly": false,
			"isTemplateField": false,
			"length": 50,
			"masktype": "None",
			"mustOverride": false,
			"name": "FIELD_NAME",
			"ordinal": 0,
			"storagetype": "Plain",
			"type": "Text",
			"clusterComponentKey": "DataExtension.field.X",
			"idClusterComponentKey": "DataExtension.field.id.X"
		}],
		"customerKey": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
		"isSendable": true,
		"isTestable": false,
		"isFieldModificationAllowed": true,
		"isFieldAdditionAllowed": true,
		"sendableCustomObjectField": "Subscriber Key",
		"sendableSubscriberField": "_SubscriberKey"
	},
	"dependencies": [],
	"namedDependencies": {},
	"metadata": {}
}]

When you select a JSON file to deploy, minify the JSON first to avoid this error:

On the Deploy Snapshot screen this error means there’s a problem with your JSON:

Check these things in the JSON fields array:

  • ordinal starts at 0 and increments per field
  • DataExtension.field.X starts at 1 and increments per field
  • DataExtension.field.id.X starts at 1 and increments per field
  • Make sure your data types are correct
  • Decimal types need length and scale key-value pairs
  • Fields with type EmailAddress should have 254 chars max
  • Number and Decimal fields should have null for length
  • Change the customerKey to something random that’s not already in use, if attempting to re-deploy a DE that already exists