Static Lists

Static Lists Endpoint Reference

List Membership Endpoint Reference

Marketo offers a set of REST APIs for performing CRUD operations on static lists.  These APIs follow the standard interface pattern for asset APIs providing Query, Create, Update, and Delete options.

Query

Querying static lists follows the standard query types for assets of by id, by name, and browse.

By Id

Query by id takes a single static list id as a path parameter and returns a single static list record.

By Name

Query by name takes a static list name as a parameter and returns a single static list record.   An exact string match is performed against all static list names in the instance, and returns a result for the static list matching that name.

Browse

Static lists can also be retrieved in batches.  The folder parameter can be used to specify the parent folder under which the query will be performed and is formatted as a JSON object containing id and type.  Like other bulk asset retrieval endpoints, offset and maxReturn are optional parameters that can be used for for paging.  The earliestUpdatedAt and latestUpdatedAt parameters allow you to set low and high datetime watermarks for returning static lists created or updated within the given range.  Datetime values must be valid ISO-8601 strings, and should not include milliseconds

Create and Update

Creating a static list is executed with an application/x-www-form-urlencoded POST with two required parameters.  The folder parameter is used to specify the parent folder under which the static list will be created and is formatted as a JSON object containing id and type.  The name parameter is used to name the static list and must be unique.  Optionally the description parameter may be used to describe the  static list.

Updates to a static list are made through a separate endpoint with two optional parameters.  The description parameter may be used to update the static list descriptionThe name parameter may be used to update the static list name and must be unique.

Delete

Deleting a static list takes a single static list id as a path parameter.  Deletions cannot be made to static lists that are in use by an import or export operation, or are in use by other assets.

List Membership

The list membership endpoints provide ability to add, remove, and query static list members.  In addition, you can query static list membership.

Add to List

The Add to List endpoint is used add one or more members to a list.  The endpoint takes a required listId path parameter, and one or more id query parameters which contain lead ids (maximum allowed is 300).

The response contains a result array comprised of JSON objects with the status for each lead id that was specified in the request.

Remove from List

The Remove from List endpoint is used remove one or more members from a list.  The endpoint takes a required listId path parameter, and one or more id query parameters which contain lead ids (maximum allowed is 300).

The response contains a result array comprised of JSON objects with the status for each lead id that was specified in the request.

Query List

The Get Leads by List Id endpoint is used to retrieve members of a list.   The endpoint takes a required listId path parameter, and allows several optional query parameters to specify filtering criteria.

The batchSize parameter is used to specify the number of lead records to be returned in a single call (default and max is 300).

The nextPageToken parameter is  used to paginate through large result sets.  This parameter is not passed in the first call, but only in subsequent calls for the pagination.

The fields parameter contains a comma separated list of field names to be returned in the response.  If the fields parameter is not included in this request, the following default fields will be returned: email, updatedAt, createdAt, lastName, firstName, and id.

The response contains a result array comprised of JSON objects containing the lead fields that were specified in the request.

Query List Membership by Lead Id

The Member of List endpoint is used to see if one or more leads are members of a list.  The endpoint takes a required listId path parameter, and one or more id query parameters which contain lead ids (maximum allowed is 300).

The response contains a result array comprised of JSON objects with the status for each lead id that was specified in the request.