> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Update Contact

- Component: `appmixer.loops.core.UpdateContact`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.loops 1.0.0](https://connectors.appmixer.com/connector/appmixer.loops/1.0.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.loops/1.0.0/component/appmixer.loops.core.UpdateContact>

Update a contact identified by email. Loops creates the contact when no matching contact exists. To change a contact's email, provide its User ID together with the new email.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Email (`email`) | text | The contact's email address. Identifies the contact; when User ID is also provided and matches a contact, that contact's email is changed to this value. |
| User ID (`userId`) | text | The contact's unique user ID. Optional; provide it together with a new Email to change the contact's email address. |
| First Name (`firstName`) | text | The contact's first name. |
| Last Name (`lastName`) | text | The contact's last name. |
| User Group (`userGroup`) | text | The contact's user group. |
| Source (`source`) | text | A custom source value. |
| Subscription (`subscribed`) | select | Leave unchanged unless you specifically want to unsubscribe or re-subscribe the contact from campaign and workflow emails. |
| Add To Mailing Lists (`mailingLists`) | multiselect | Mailing lists to add the contact to. Pick lists, or map a comma-separated list of mailing list IDs. |
| Remove From Mailing Lists (`removeFromMailingLists`) | multiselect | Mailing lists to remove the contact from. Pick lists, or map a comma-separated list of mailing list IDs. |
| Custom Properties (`customProperties`) | textarea | Optional JSON object of custom contact properties, for example `{"planName": "Pro", "seats": 5}`. Values can be strings, numbers, booleans or dates. Create the properties in Loops first (see Create Contact Property). |

## Output ports

### Port `out`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.loops.core.UpdateContact",
  "label": "Update Contact",
  "description": "Update a contact identified by email. Loops creates the contact when no matching contact exists. To change a contact's email, provide its User ID together with the new email.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:loops"
  },
  "quota": {
    "manager": "appmixer:loops",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "userGroup": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "subscribed": {
            "type": "string",
            "enum": [
              "",
              "subscribe",
              "unsubscribe"
            ]
          },
          "mailingLists": {
            "type": [
              "array",
              "string"
            ]
          },
          "removeFromMailingLists": {
            "type": [
              "array",
              "string"
            ]
          },
          "customProperties": {
            "type": "string"
          }
        },
        "required": [
          "email"
        ]
      },
      "inspector": {
        "inputs": {
          "email": {
            "type": "text",
            "index": 1,
            "label": "Email",
            "tooltip": "The contact's email address. Identifies the contact; when User ID is also provided and matches a contact, that contact's email is changed to this value."
          },
          "userId": {
            "type": "text",
            "index": 2,
            "label": "User ID",
            "tooltip": "The contact's unique user ID. Optional; provide it together with a new Email to change the contact's email address."
          },
          "firstName": {
            "type": "text",
            "index": 3,
            "label": "First Name",
            "tooltip": "The contact's first name."
          },
          "lastName": {
            "type": "text",
            "index": 4,
            "label": "Last Name",
            "tooltip": "The contact's last name."
          },
          "userGroup": {
            "type": "text",
            "index": 5,
            "label": "User Group",
            "tooltip": "The contact's user group."
          },
          "source": {
            "type": "text",
            "index": 6,
            "label": "Source",
            "tooltip": "A custom source value."
          },
          "subscribed": {
            "type": "select",
            "index": 7,
            "label": "Subscription",
            "defaultValue": "",
            "tooltip": "Leave unchanged unless you specifically want to unsubscribe or re-subscribe the contact from campaign and workflow emails.",
            "options": [
              {
                "label": "Leave unchanged",
                "value": ""
              },
              {
                "label": "Subscribe",
                "value": "subscribe"
              },
              {
                "label": "Unsubscribe",
                "value": "unsubscribe"
              }
            ]
          },
          "mailingLists": {
            "type": "multiselect",
            "index": 8,
            "label": "Add To Mailing Lists",
            "tooltip": "Mailing lists to add the contact to. Pick lists, or map a comma-separated list of mailing list IDs.",
            "source": {
              "url": "/component/appmixer/loops/core/ListMailingLists?outPort=out",
              "data": {
                "messages": {
                  "in/outputType": "array"
                },
                "properties": {
                  "isSource": true
                },
                "transform": "./ListMailingLists#toSelectArray"
              }
            }
          },
          "removeFromMailingLists": {
            "type": "multiselect",
            "index": 9,
            "label": "Remove From Mailing Lists",
            "tooltip": "Mailing lists to remove the contact from. Pick lists, or map a comma-separated list of mailing list IDs.",
            "source": {
              "url": "/component/appmixer/loops/core/ListMailingLists?outPort=out",
              "data": {
                "messages": {
                  "in/outputType": "array"
                },
                "properties": {
                  "isSource": true
                },
                "transform": "./ListMailingLists#toSelectArray"
              }
            }
          },
          "customProperties": {
            "type": "textarea",
            "index": 10,
            "label": "Custom Properties",
            "tooltip": "Optional JSON object of custom contact properties, for example <code>{\"planName\": \"Pro\", \"seats\": 5}</code>. Values can be strings, numbers, booleans or dates. Create the properties in Loops first (see Create Contact Property)."
          }
        }
      }
    }
  ],
  "outPorts": [
    "out"
  ],
  "icon": "(data URI omitted)"
}
```
