Email Custom Headers created via API

Your software
My Mautic version is: 4
My PHP version is: 7
My Database type and version is:

Your problem

My problem is: how I can manage custom headers of an email template through the API?

I use POST api/emails/new and add input headers in the json.

“Headers”: [
{
“My-custom-header”: “email code”
}
]

I received error code 400 headers: this form should not contain extra fields.

For anyone else who has the same problem and finds this, the correct format is:

$email['headers'] = [
	'list' => [
		[
			'label' => 'X-Header-XYZ',
			'value' => 'value'
		]
	]
];