Update contact CURL

I have my CURL working to update the client details, but when I include the contact details, it is creating a new blank contact and marking the old one as deleted

This is how the CURL code looks:
{"id":"1","name":"test2 test2","address1":"my house","city":"my city","state":"my state","postal_code":"12345","work_phone":"myphone","contacts":[{"id":1,"first_name":"test2","last_name":"test2","email":"me@me.co.uk","phone":"myphone"}]}

I’m not sure, that looks ok to me?

Note: if you’re comparing to the database the API id uses the public_id field not the id field.

Thank you, so which ID should I give for the contacts, the one for the client? I wonder if I’m giving it the wrong ID

Contacts have their own id, you can use the /clients GET request to load the client and contacts.

The ID seems right, when I run this on a terminal I get illegal port number and “curl: (3) [globbing] bad range specification in column 38”

Then it updates the client and blanks the contact details (it also increments the contact id)

curl -X PUT https://mywebsite/api/v1/clients/1 -H "X-Ninja-Token: mytoken" -H 'X-Requested-With: XMLHttpRequest'-H 'Content-Type: application/json' -d "
{"id":"1","name":"test2 test2","address1":"my house","city":"my city","state":"my state","postal_code":"12345","work_phone":"0489393","contacts":[{"id":36,"first_name":"test2","last_name":"test2","email":"my@email.com","phone":"023322"}]}" --insecure