POST/api/v1/projects/{project_id}/lists
create_list
Creates a mailing list in a project, the audience campaigns go to.
- Call it
- before adding subscribers.
- Needs
- an admin key with
project_id, or a project key with scopewrite(its own project; the argument is ignored), and, withdouble_opt_in, aconfirmation_template_idnaming a message template of the project (create_template). Names need not be unique. - Returns
- the list, the same as
POST /api/v1/projects/{project_id}/lists. There is noIdempotency-Key: if a call gets no answer, checklist_listsbefore calling again, or a second list is made.
Arguments
- object
-
namestringrequiredWhat people call the list: 1 to 128 characters. Two lists may share a name.
example
Weekly news -
confirmation_template_idstring · uuid | nullThe template of the confirmation letter: the id of a message template of the project; required with
double_opt_in. Null or left out: none. -
double_opt_inbooleanSubscribers confirm by a link before they get campaigns; default false. Needs
confirmation_template_id. -
from_overrideFromOverrideArguments | nullThe sender of the list’s own letters (confirmations) in place of the project’s; null or left out: the project’s.
2 fields
- FromOverrideArguments object
-
from_emailstringrequiredThe sender address.
example
news@acme.example -
from_namestring | nullThe sender name, 1 to 128 characters, no line breaks; null or left out: the project’s
settings.from_name.
-
project_idstring · uuid | nullThe project to create the list in. An admin key must pass it; a project key’s own project is used and this is ignored.
No other arguments are accepted.
Result
The result comes back as structuredContent, with the same JSON as a text block.
- object · all fields required
-
confirmation_template_idstring · uuid | nullThe template of the confirmation letter;
null: none. -
created_atstring · date-time -
deleted_atstring · date-time | nullWhen the list was deleted;
nullwhile it is live. A deleted list can only be read. -
double_opt_inbooleanSubscribers confirm by a link before they get campaigns.
-
from_overrideFromOverride | nullThe sender of the list’s own letters;
null: the project’s.2 fields
- FromOverride object · all fields required
-
from_emailstring -
from_namestring | nullnull: the project’ssettings.from_name.
-
idstring · uuid -
namestring -
project_idstring · uuidThe list’s project.
-
updated_atstring · date-timeThe latest change: creation, name, options, deletion.
Definitions
FromOverride
The sender of a list’s own letters.
- object · all fields required
-
from_emailstring -
from_namestring | nullnull: the project’ssettings.from_name.
FromOverrideArguments
The sender of a list’s own letters.
- object
-
from_emailstringrequiredThe sender address.
example
news@acme.example -
from_namestring | nullThe sender name, 1 to 128 characters, no line breaks; null or left out: the project’s
settings.from_name.
Errors
A failed call answers isError: true with a code from the same table as the HTTP API, and detail. How tools report errors
HTTP API
The same operation over HTTP: POST /api/v1/projects/{project_id}/lists