> For the complete documentation index, see [llms.txt](https://developers.gleantap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.gleantap.com/update-data/create-or-update-contact.md).

# Create or Update Contact

## Create new contact

> Create a new or update contact in the system. To update existing contact, provide the user\_id or the same email & firstname, or phone & firstname. In addition to the attributes listed below, you can add any custom attributes to the contact.

```json
{"openapi":"3.0.0","info":{"title":"Gleantap External API","version":"1.0.0"},"tags":[{"name":"Contacts","description":"Contacts"}],"servers":[{"url":"https://api.gleantap.com","description":"Production server"}],"paths":{"/v2/ExternalApi/newContact":{"post":{"tags":["Contacts"],"summary":"Create new contact","description":"Create a new or update contact in the system. To update existing contact, provide the user_id or the same email & firstname, or phone & firstname. In addition to the attributes listed below, you can add any custom attributes to the contact.","operationId":"aecf2e930433a1ee55c7ca351a4647d3","parameters":[{"name":"X-API-KEY","in":"header","description":"Your API key","required":true,"schema":{"type":"string"}},{"name":"X-SECRET-KEY","in":"header","description":"Your Secret key","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"required":["app_id","first_name","last_name"],"properties":{"app_id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"address":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"},"source":{"type":"string"},"user_id":{"type":"string"},"dob":{"description":"YYYY-MM-DD","type":"string","format":"date"},"created_date":{"description":"YYYY-MM-DD HH:MM:SS","type":"string","format":"date-time"},"gender":{"type":"string"},"type":{"description":"eg. member, past, prospect","type":"string"},"status":{"description":"eg. active, inactive, non-member etc","type":"string"},"location":{"type":"string"},"optin_sms":{"type":"boolean"},"optout_email":{"type":"boolean"},"tags":{"description":"comma separated tags","type":"string"},"tag_action":{"description":"add or remove","type":"string"}},"type":"object"}}}},"responses":{"200":{"description":"Contact created successfully","content":{"application/json":{"schema":{"properties":{"status":{"type":"string"},"_id":{"type":"string"}},"type":"object"}}}},"400":{"description":"Invalid request"}}}}}}
```
