---
schema_version: "1"
id: 220d90777495e801e0eee1252770715a2119e7f6c654ecdba0aac68496495b4b
title: Subscribers.Upsert
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_listSubscribersUpsert.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_listSubscribersUpsert.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: fcaee0ad5ce7eba8ad77413932dade7d70d31324802edcd9fe23b5e09fa56631
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Subscribers.Upsert

## Overview

Adds any subscriber not on the specified list and updates any specified attributes

### Syntax

Subscribers.Upsert(1, 2)

### Function Properties

<!--complex table-->

| Ordinal | Type   |              | Description                                                                                                                                   |
| ------- | ------ | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **1**   | string | **Required** | Attribute containing Email address of subscriber or a JSON object containing the EmailAddress and SubscriberKey values for the subscriber     |
| **2**   | string | **Required** | Any additional attributes regarding the subscriber. If the Status attribute exists in the passed attributes, it updates the subscriber status |

## Example

This sample code adds the specified values to the subscriber.

```
var myList = List.Init("myList");
var status = myList.Subscribers.Upsert("aruiz@example.com",{ZipCode:"46202"});
```
