Troubleshooting malformed_client_response error in Vercel Storage integration API

Hi!

I’m trying to automate the creation of a Supabase database through the Vercel integration, by using the Vercel API.

I followed the instructions to obtain the integration configuration, plan, etc. and then:

curl \
--request POST \
--url "https://api.vercel.com/v1/storage/stores/integration/direct?slug=veecle" \
--header "Authorization: Bearer $VERCEL_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"name": "$NAME",
"integrationConfigurationId": "icfg_xxxx",
"integrationProductIdOrSlug": "supabase",
"metadata": {
"environment": "production",
"project": "$PROJECT",
"region": "fra1"
},
"billingPlanId": "pro"
}'
{"error":{"code":"malformed_client_response","message":"Client received an unexpected response body from the integration server"}}

I think I’m on the right track, because prior to adding the region, I was getting:

{"error":{"code":"validation_error","message":"Failed to validate metadata: metadata should have required property ‘region’","fields":[{"key":"required","message":"should have required property ‘region’"}]}}

But after adding the region, the error does not give me much of a path forward.

Thanks in advance,

Àlex

This was an issue on my end, `environment` and `project` should not be in `metadata`. Reading the documentation properly was the way :slight_smile:

(Maybe `publicEnvVarPrefix` is required, too.)

Sometimes that happens :person_shrugging:

Thanks for sharing what worked for you!

Hey there, @alexcorcoles-5798! Just checking in—did you find a solid solution for the malformed client response error, or do you still need assistance with anything? Excited to help!