The issue is that you're trying to add headers under metadata, but headers should be specified in the server object.
Here's the correct payload structure:
{
"server": {
"url": "
",
"timeoutSeconds": 30,
"headers": {
"x-api": "34343434"
}
},
"function": {
"async": false,
"name": "getdata"
},
"type": "function",
"async": false
}
The error you're seeing about metadata is because the metadata field is not meant for request configuration - it's used for other purposes in the system. Headers should always be configured within the server object.