PUT target-lists/{listname}

Overview

The Target-List API permits interaction with target lists associated with your company. You can use the API's PUT /v2/target-lists/{listname} to create a target list, or modify the name of an existing target list.  If the target list {listname} in the URI does not exist, the call is interpreted as a request to create a new target list.  If the target list does exist, the call is interpreted as a request to modify it.

The members of a target list are not modified via this call.  This can be done via PUT /v2/target-lists/{listname}/members/{id}, POST /v2/target-lists/{listname}/members/import or POST /v2/target-lists/{listname}/members/file-import

Resource URI

PUT https://api.yesmail.com/v2/target-lists/{listname}

Call Description

The/target-lists/{listname} call creates a target list, or modifies the name of an existing target list.

HTTP Return Codes

Code

Description

200 OK

The request has successfully modified an existing target list.

201 Created

The new target list has been created successfully.

400 Bad Request The request could not be understood by the server due to malformed syntax.  For example, missing "name" in request payload; {listname} in URI does not exist, and "name" in request payload does not equal "listname"; attempt to rename {listname} to a name of a target list that already exists or is archived.

401 Unauthorized

The request requires user authentication.  Invalid Api-User and/or Api-Key header value.

409 Conflict

This occurs when the If-Match condition is used, and the specified ETag does not match the current ETag for the resource.
Request Payload: 
{
     "name": "seedList1"
}
Response Payload: 
{
    "name": "seedList1",
    "memberCount":  2
}