# Create contact using REST API error :: {"message": "General error" }

**URL:** <https://integration.keap.com/t/create-contact-using-rest-api-error-message-general-error/78652>\
**Category:** API Q&A\
**Tags:** api\
**Created:** [July 23, 2020, 5:45am UTC](https://integration.keap.com/t/create-contact-using-rest-api-error-message-general-error/78652 "2020-07-23T05:45:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deep\_Sleep\_Test](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@Deep\_Sleep\_Test](https://integration.keap.com/u/Deep_Sleep_Test)\
**Post date:** [July 23, 2020, 5:45am UTC](https://integration.keap.com/t/create-contact-using-rest-api-error-message-general-error/78652/1 "2020-07-23T05:45:02Z")

</div>

I am trying to create contact using REST API and I am having General Error even if my payload is as expected.

Attaching the payload below. Please guide me on what I am doing wrong.

```
{
   "id":0,
   "owner_id":0,
   "given_name":"Divyesh",
   "middle_name":null,
   "family_name":"Desai",
   "email_status":null,
   "email_opted_in":false,
   "date_created":null,
   "email_addresses":[
      {
         "email":"divyesh7@softsages.com",
         "field":"EMAIL1"
      }
   ],
   "addresses":[
      {
         "line1":"17 Mystic Lane",
         "line2":"Suite 2A",
         "locality":"Malvern",
         "region":"PA",
         "field":"BILLING",
         "postal_code":"19355",
         "zip_code":"19355",
         "zip_four":null,
         "country_code":"USA"
      }
   ],
   "phone_numbers":null,
   "custom_fields":null
}

```

---

<div class="post-metadata">

**Author:** ![Matthew\_Beeston](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@Matthew\_Beeston](https://integration.keap.com/u/Matthew_Beeston)\
**Post date:** [July 31, 2020, 1:33pm UTC](https://integration.keap.com/t/create-contact-using-rest-api-error-message-general-error/78652/2 "2020-07-31T13:33:30Z")

</div>

Hi @Deep_Sleep_Test,

I had a similar issue with creating contacts and my solution was to format the email\_addresses field differently.  
Maybe give that a try and see if it gets you any further.

```auto
{
	"email_addresses": {
		"0": {
			"email": "divyesh7@softsages.com",
			"field": "EMAIL1"
		}
	}
}

```

> [@Create contact with SDK and REST not working](https://integration.keap.com/t/create-contact-with-sdk-and-rest-not-working/77734/4):
>
> I found an answer after rereading @Andrew_Johnson’s post and finding this post in the forums: In my case the email\_addresses field needed to be a multidimensional array. I corrected my code to produce the following output: { "email\_addresses": { "0": { "email": "name@email.com", "field": "EMAIL1" } } } It would be extremely helpful if somewhere between the SDK and the API could give more detailed feedback as to which element of the input is invalid.
