MailAirCmdesign
AI-generatedSummary
Create or retrieve list fields, subscribers, and other MailAir resources based on selected action.
Inputs
- action (required) — The operation to perform (e.g., createListField, getAllLists).
- listId (required) — Target list ID or identifier; can be an expression.
- segmentId (required) — Segment unique ID to retrieve.
- subscriberId (required) — Subscriber unique ID to retrieve.
- fieldId (required) — List field ID to retrieve or manipulate.
- email (required) — Subscriber email address.
- segmentName (required) — Name of a segment to create.
- pageNumber — Current page to retrieve.
- perPage — Items per page for pagination.
- subscriberStatus (required) — Status value to filter subscribers (e.g., confirmed, unconfirmed).
- createIfNotExists — Whether to create a subscriber if not exists.
- fieldType (required) — Field type identifier.
- fieldLabel (required) — Label for the list field.
- fieldTag (required) — Tag for the list field.
- fieldRequired (required) — Whether the field is required.
- fieldVisibility (required) — Visibility of the field.
- fieldSortOrder (required) — Sort order of the field.
- fieldHelpText (required) — Help text for the field.
- fieldDefaultValue (required) — Default value for the field.
- fieldDescription (required) — Description of the field.
- fieldOptions (required) — Options for the field.
- fieldMinLength (required) — Minimum length for text fields.
- fieldMaxLength (required) — Maximum length for text fields (max 255).
- fieldContentRule (required) — Content rule for validation.
- fieldContentRegex (required) — Regex pattern for validation.
- fieldAllowedScheme (required) — Allowed URL scheme.
- fieldWhitelistDomains (required) — Whitelisted domains for URL fields.
- fieldBlacklistDomains (required) — Blacklisted domains for URL fields.
- fieldMaxStars (required) — Maximum star rating.
- fieldDefaultCountry (required) — Default country code for phone fields.
- subscriberFieldMapping — Mapping of incoming data to MailAir subscriber fields.
- subscribers — JSON array of subscriber objects for bulk create.
Output shape
An array containing a single object with the API response (the json field holds the returned data).
Errors are thrown as NodeApiError; successful calls return the API response wrapped in the
jsonproperty.
Examples
Example 1: Create a new list field
Action: createListField; List Name or ID: myList; Field Type: text; Label: Email; Required: true; Create if Not Exists: false
Example 2: Retrieve all subscribers of a segment
Action: getAllSubscribers; List Name or ID: myList; Segment ID: seg123; Page Number: 1; Items per Page: 10
Example 3: Search subscriber by email
Action: searchSubscriberByEmail; Email: user@example.com