What can we help you with?

Do POST requests require body field data if all fields are optional?

Yes. When receiving a POST request, the Marqeta platform expects data in the body of the request, even if the endpoint does not require any fields.

If you send a cURL request to an endpoint with no required body fields, you must still include an empty object in the data parameter of your cURL.

For example, the following request produces an error:

curl -X POST https://shared-sandbox-api.marqeta.com/v3/users \
-H "Content-type: application/json" \
-u *username:password*

To avoid errors, include the -d parameter and an empty object:

curl -X POST https://shared-sandbox-api.marqeta.com/v3/users \
-H "Content-type: application/json" \
-u *username:password* \
-d { }
Thanks for the feedback
Thanks for the feedback
Was this article helpful?

We've recieved your feedback.

Contact Developer Support
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.