> ## Documentation Index
> Fetch the complete documentation index at: https://developer.voyado.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update contact

Updating the details of a Voyado Engage contact is done through the /contacts endpoint using their unique `contactId` and the PATCH method:

```http theme={null}
PATCH /api/v3/contacts/{contactId}
```

If you don’t have the `contactId`, [you can get it using other contact attributes.](/docs/contacts/identify-contact/find-contact)

<Warning>
  This PATCH endpoint is to be used for single contact updates. Do NOT use it for bulk updates of contacts. In that case, use the [bulk methods provided](/docs/contacts/bulk-contacts-api).
</Warning>

When you have the `contactId` you call the endpoint like this:

```http theme={null}
PATCH /api/v3/contacts/430d3329-7eef-45c0-37f9-ae9300a0daceid
```

As the payload, send ONLY the attributes that you want to change:

```json theme={null}
{
    "lastName": "Examplesson",
    "street": "New Street 1337"
}
```

In this example, the contact has changed their surname and moved to a new address. These attributes will be updated.

<Warning>
  When updating contacts over the API be sure to ONLY send the fields you want to update and nothing else. This applies for individual as well as bulk updates. Any empty fields added to your update payload (string.Empty, null, "", etc.) will overwrite the current values on the contact.
</Warning>

You can't use this endpoint to update a contact's contact type. This has to be done using the `/contacts/[contactId]/updateContactType` endpoint. See the next section.

## Changing contact type

To update `contactType` to "Member" or to another value, you will use this endpoint:

```http theme={null}
POST /api/v3/contacts/{contactId}/updateContactType?contactTypeId=Member
```

In this example we are changing the contact's type to "Member".

This is the only way to update a contact's `contactType`. If you try to use the PATCH method shown above to change `contactType` it will not work.

<Tip>
  The `contactId` is not changed when you change the `contactType`.
</Tip>

## Don't send empty values

You need to be careful to never send empty values in the JSON payload when updating a contact. If a field exists in the payload, Engage will use that value and overwrite the existing one. For example, if a contact's last name isn’t added in the POS, do *not* add that field to the payload.

```json theme={null}
// DO NOT DO THIS!
{
    "firstName": "Example",
    "lastName": "",
    "street": "Big Street 1234"
}
```

In this case, the current value of lastName will be overwritten by an empty string. You probably don't want this.

Instead, do this:

```json theme={null}
// This is how to do it
{
    "firstName": "Example",
    "street": "Big Street 1234"
}
```

Note also that a field which does not exist in the contact's data will be ignored and no error will be returned. This means it is important to make sure you are sending the right name for each field.

```json theme={null}
// This update will be ignored
{
    "firstNam": "Example",
}
```

## **Responses**

A successful update will return *HTTP 200 Ok* along with the contact's new data.

If the request has failed, you'll get one of the following HTTP error codes:

* *400 : NoData*
* *404: Not Found*
