PUT
/
v1
/
contacts
/
update
Update contact
curl --request PUT \
  --url https://app.loops.so/api/v1/contacts/update \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "<string>",
  "userId": "<string>",
  "firstName": "<string>",
  "lastName": "<string>",
  "source": "<string>",
  "subscribed": true,
  "userGroup": "<string>",
  "mailingLists": {}
}'
{
  "success": true,
  "id": "id_of_contact"
}
Update an existing contact by sending a request containing contact properties. This endpoint will create a contact if a matching contact does not already exist in your audience.
If you want to update a contact’s email address, the contact will first need a userId value. You can then make a request containing the userId field along with an updated email address.

Request

Body

Provide either email or userId to identify the contact you want to update.
If both are provided, the system will look for a contact with either a matching email or userId value. If a contact is found for one of the values (e.g. email), the other value (e.g. userId) will be updated. If a contact is not found, a new contact will be created using both email and userId values.
email
string
The contact’s email address. If there is no contact with this email, one will be created.
Required if userId is not provided.
userId
string
A unique user ID (for example, from an external application). Read more Required if email is not provided.
firstName
string
The contact’s first name.
lastName
string
The contact’s last name.
source
string
A custom source value to replace the default “API”. Read more
subscribed
boolean
Whether the contact will receive campaign and loops emails. Read more.
If you send subscribed: true in your update calls, contacts who have previously unsubscribed will be re-subscribed. We recommend leaving this field out of your requests unless you specifically want to unsubscribe or re-subscribe a contact.
userGroup
string
You can use groups to segment users when sending emails. Currently, a contact can only be in one user group. Read more
mailingLists
object
Manage mailling list subscriptions.
Include key-value pairs of mailing list IDs and a boolean denoting if the contact should be added (true) or removed (false) from the list. Read more
"mailingLists": {
  "cm06f5v0e45nf0ml5754o9cix": true,
  "cm16k73gq014h0mmj5b6jdi9r": false
}

Custom properties

You can also include custom contact properties in your request body. These should be added as top-level attributes in the request. Custom properties can be of type string, number, boolean or date (see allowed date formats).
{
  "email": "hello@gmail.com",
  "plan": "pro", /* Custom property */
  "favoriteColor": "Blue" /* Custom property */
}
There are a few reserved names that you cannot use for custom properties.
To empty or reset the value of a contact property, send a null value.

Response

Success

success
boolean
required
id
string
required
The ID of the contact.

Error

Errors will be 400 Bad Request.
success
boolean
required
message
string
required
An error message describing the problem with the request.
{
  "success": true,
  "id": "id_of_contact"
}