@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Mailchimp Transactional API
@base https://mandrillapp.com/api/1.4
@version 1.4.0
@endpoints 99
@hint download_for_search
@toc allowlists(3), exports(6), ips(13), inbound(9), mctemplates(4), messages(13), metadata(4), rejects(6), senders(8), subaccounts(7), tags(5), templates(8), urls(4), users(4), webhooks(5)

@group allowlists
@endpoint POST /allowlists/add
@desc Add email to allowlist
@returns(200) {email: str(email), added: bool} # Success
@errors {401: Invalid or missing API key., 422: One or more request parameters failed validation., 500: An unexpected internal server error occurred.}

@endpoint POST /allowlists/list
@desc List allowlist entries
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /allowlists/delete
@desc Remove email from allowlist
@returns(200) {email: str(email), deleted: bool} # Success
@errors {401: Invalid or missing API key., 422: One or more request parameters failed validation., 500: An unexpected internal server error occurred.}

@endgroup

@group exports
@endpoint POST /exports/info
@desc Get export job information
@returns(200) {id: str, created_at: str, type: str, finished_at: str?, state: str, result_url: str(uri)?} # Success
@errors {401: Invalid or missing API key., 404: Unknown export job, 500: An unexpected internal server error occurred.}

@endpoint POST /exports/list
@desc List export jobs
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /exports/rejects
@desc Export rejection blacklist
@returns(200) {id: str, created_at: str, type: str, finished_at: str?, state: str, result_url: str(uri)?} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /exports/whitelist
@desc Export rejection allowlist (legacy)
@returns(200) {id: str, created_at: str, type: str, finished_at: str?, state: str, result_url: str(uri)?} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /exports/allowlist
@desc Export rejection allowlist
@returns(200) {id: str, created_at: str, type: str, finished_at: str?, state: str, result_url: str(uri)?} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /exports/activity
@desc Export activity history
@required {key: map{key!: str} # API key field included in request bodies.}
@optional {notify_email: str(email) # Optional email address to notify when the export job has finished, date_from: str # Start date as a UTC string in YYYY-MM-DD HH:MM:SS format, date_to: str # End date as a UTC string in YYYY-MM-DD HH:MM:SS format, tags: [str] # Array of tag names to narrow the export to; will match messages that contain ANY of the tags, senders: [str(email)] # Array of sender email addresses to narrow the export to, states: [str] # Array of message states to narrow the export to; messages with ANY of the states will be included, api_keys: [str] # Array of API keys to narrow the export to; messages sent with ANY of the keys will be included}
@returns(200) {id: str, created_at: str, type: str, finished_at: str?, state: str, result_url: str(uri)?} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endgroup

@group ips
@endpoint POST /ips/list
@desc List dedicated IPs
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /ips/info
@desc Get dedicated IP information
@returns(200) {ip: str(ipv4), created_at: str, pool: str, domain: str, custom_dns: map{enabled: bool, valid: bool, error: str?}, warmup: map{warming_up: bool, start_at: str?, end_at: str?}} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /ips/provision
@desc Request dedicated IP provisioning
@returns(200) {requested_at: str} # Success
@errors {401: Invalid or missing API key., 402: A paid plan is required to use this feature., 404: Unknown IP pool, 500: An unexpected internal server error occurred.}

@endpoint POST /ips/start-warmup
@desc Start IP warmup process
@returns(200) {ip: str(ipv4), created_at: str, pool: str, domain: str, custom_dns: map{enabled: bool, valid: bool, error: str?}, warmup: map{warming_up: bool, start_at: str?, end_at: str?}} # Success
@errors {401: Invalid or missing API key., 404: Unknown dedicated IP, 500: An unexpected internal server error occurred.}

@endpoint POST /ips/cancel-warmup
@desc Cancel IP warmup process
@returns(200) {ip: str(ipv4), created_at: str, pool: str, domain: str, custom_dns: map{enabled: bool, valid: bool, error: str?}, warmup: map{warming_up: bool, start_at: str?, end_at: str?}} # Success
@errors {401: Invalid or missing API key., 404: Unknown dedicated IP, 500: An unexpected internal server error occurred.}

@endpoint POST /ips/set-pool
@desc Move IP to different pool
@returns(200) {ip: str(ipv4), created_at: str, pool: str, domain: str, custom_dns: map{enabled: bool, valid: bool, error: str?}, warmup: map{warming_up: bool, start_at: str?, end_at: str?}} # Success
@errors {400: Cannot leave default pool empty, 401: Invalid or missing API key., 404: Unknown IP or pool, 500: An unexpected internal server error occurred.}

@endpoint POST /ips/delete
@desc Delete dedicated IP
@returns(200) {ip: str, deleted: bool} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /ips/list-pools
@desc List dedicated IP pools
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /ips/pool-info
@desc Get pool information
@returns(200) {name: str, created_at: str, ips: [map]} # Success
@errors {401: Invalid or missing API key., 404: Unknown IP pool, 500: An unexpected internal server error occurred.}

@endpoint POST /ips/create-pool
@desc Create dedicated IP pool
@returns(200) {name: str, created_at: str, ips: [map]} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /ips/delete-pool
@desc Delete dedicated IP pool
@returns(200) {pool: str, deleted: bool} # Success
@errors {400: Cannot delete default pool or non-empty pool, 401: Invalid or missing API key., 404: Unknown IP pool, 500: An unexpected internal server error occurred.}

@endpoint POST /ips/check-custom-dns
@desc Test custom DNS configuration
@returns(200) {valid: bool, error: str?} # Success
@errors {401: Invalid or missing API key., 404: Unknown dedicated IP, 500: An unexpected internal server error occurred.}

@endpoint POST /ips/set-custom-dns
@desc Configure custom DNS for IP
@returns(200) {ip: str(ipv4), created_at: str, pool: str, domain: str, custom_dns: map{enabled: bool, valid: bool, error: str?}, warmup: map{warming_up: bool, start_at: str?, end_at: str?}} # Success
@errors {400: Invalid custom DNS configuration, 401: Invalid or missing API key., 404: Unknown dedicated IP, 500: An unexpected internal server error occurred.}

@endgroup

@group inbound
@endpoint POST /inbound/domains
@desc List inbound domains
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /inbound/add-domain
@desc Add inbound domain
@returns(200) {domain: str, created_at: str, valid_mx: bool} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /inbound/check-domain
@desc Check domain settings
@returns(200) {domain: str, created_at: str, valid_mx: bool} # Success
@errors {401: Invalid or missing API key., 404: Unknown inbound domain, 500: An unexpected internal server error occurred.}

@endpoint POST /inbound/delete-domain
@desc Delete inbound domain
@returns(200) {domain: str, created_at: str, valid_mx: bool} # Success
@errors {401: Invalid or missing API key., 404: Unknown inbound domain, 500: An unexpected internal server error occurred.}

@endpoint POST /inbound/routes
@desc List mailbox routes
@returns(200) Success
@errors {401: Invalid or missing API key., 404: Unknown inbound domain, 500: An unexpected internal server error occurred.}

@endpoint POST /inbound/add-route
@desc Add mailbox route
@returns(200) {id: str, pattern: str, url: str(uri)} # Success
@errors {401: Invalid or missing API key., 404: Unknown inbound domain, 500: An unexpected internal server error occurred.}

@endpoint POST /inbound/update-route
@desc Update mailbox route
@returns(200) {id: str, pattern: str, url: str(uri)} # Success
@errors {401: Invalid or missing API key., 404: Unknown inbound route, 500: An unexpected internal server error occurred.}

@endpoint POST /inbound/delete-route
@desc Delete mailbox route
@returns(200) {id: str, pattern: str, url: str(uri)} # Success
@errors {401: Invalid or missing API key., 404: Unknown inbound route, 500: An unexpected internal server error occurred.}

@endpoint POST /inbound/send-raw
@desc Send mime document
@returns(200) Success
@errors {401: Invalid or missing API key., 404: Unknown inbound domain, 500: An unexpected internal server error occurred.}

@endgroup

@group mctemplates
@endpoint POST /mctemplates/info
@desc Get Mailchimp Transactional template information
@returns(200) Success
@errors {401: Invalid or missing API key., 404: Mailchimp template not found, 500: An unexpected internal server error occurred.}

@endpoint POST /mctemplates/list
@desc List Mailchimp Transactional templates
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /mctemplates/render
@desc Render a Mailchimp Transactional template
@returns(200) {html: str} # Success
@errors {401: Invalid or missing API key., 404: Mailchimp template not found, 422: Invalid mc_template_version parameter, 500: An unexpected internal server error occurred.}

@endpoint POST /mctemplates/time-series
@desc Get Mailchimp Transactional template time series
@returns(200) Success
@errors {401: Invalid or missing API key., 404: Mailchimp template not found, 500: An unexpected internal server error occurred.}

@endgroup

@group messages
@endpoint POST /messages/send
@desc Send a new transactional message through the Transactional API.
@returns(200) Success
@errors {401: Invalid or missing API key., 402: A paid plan is required to use this feature., 404: Unknown subaccount, 500: An unexpected internal server error occurred.}

@endpoint POST /messages/send-template
@desc Send a new transactional message using a template
@returns(200) Success
@errors {401: Invalid or missing API key., 402: A paid plan is required to use this feature., 404: Template or subaccount not found, 500: An unexpected internal server error occurred.}

@endpoint POST /messages/send-mc-template
@desc Send using Mailchimp template
@returns(200) Success
@errors {401: Invalid or missing API key., 402: A paid plan is required to use this feature., 404: Template or subaccount not found, 500: An unexpected internal server error occurred.}

@endpoint POST /messages/search
@desc Search recently sent messages
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred., 503: Service unavailable}

@endpoint POST /messages/search-time-series
@desc Get time series data for message search
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred., 503: Service unavailable}

@endpoint POST /messages/info
@desc Get information about a single sent message
@returns(200) Success
@errors {401: Invalid or missing API key., 404: Message not found, 500: An unexpected internal server error occurred.}

@endpoint POST /messages/content
@desc Get the full content of a sent message
@returns(200) Success
@errors {401: Invalid or missing API key., 404: Message not found, 500: An unexpected internal server error occurred.}

@endpoint POST /messages/parse
@desc Parse a MIME message
@returns(200) {headers: map, text: str, text_flowed: bool, attachments: [map], from_email: str(email), from_name: str, html: str?, to: [map], subject: str?} # Success
@errors {401: Invalid or missing API key., 422: One or more request parameters failed validation., 500: An unexpected internal server error occurred.}

@endpoint POST /messages/send-raw
@desc Send a raw MIME message through Mandrill
@returns(200) Success
@errors {401: Invalid or missing API key., 402: A paid plan is required to use this feature., 404: Unknown subaccount, 500: An unexpected internal server error occurred.}

@endpoint POST /messages/list-scheduled
@desc Get scheduled emails
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /messages/cancel-scheduled
@desc Cancel a scheduled email
@returns(200) {_id: str, created_at: str, send_at: str, from_email: str(email), to: str(email), subject: str} # Success
@errors {401: Invalid or missing API key., 404: Message not found, 500: An unexpected internal server error occurred.}

@endpoint POST /messages/reschedule
@desc Reschedule a scheduled email
@returns(200) {_id: str, created_at: str, send_at: str, from_email: str(email), to: str(email), subject: str} # Success
@errors {401: Invalid or missing API key., 404: Message not found, 500: An unexpected internal server error occurred.}

@endpoint POST /messages/send-sms
@desc Send SMS message
@returns(200) Success
@errors {401: Invalid or missing API key., 404: Unknown subaccount for SMS message, 500: An unexpected internal server error occurred.}

@endgroup

@group metadata
@endpoint POST /metadata/list
@desc List custom metadata fields
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /metadata/add
@desc Add custom metadata field
@returns(200) {name: str, state: str, view_template: str?} # Success
@errors {401: Invalid or missing API key., 422: One or more request parameters failed validation., 500: An unexpected internal server error occurred.}

@endpoint POST /metadata/update
@desc Update custom metadata field
@returns(200) {name: str, state: str, view_template: str?} # Success
@errors {401: Invalid or missing API key., 404: Unknown metadata field, 500: An unexpected internal server error occurred.}

@endpoint POST /metadata/delete
@desc Delete custom metadata field
@returns(200) {name: str, state: str, view_template: str?} # Success
@errors {401: Invalid or missing API key., 404: Unknown metadata field, 500: An unexpected internal server error occurred.}

@endgroup

@group rejects
@endpoint POST /rejects/add
@desc Add email to rejection blacklist
@returns(200) {email: str(email), added: bool} # Success
@errors {401: Invalid or missing API key., 404: Unknown subaccount, 422: One or more request parameters failed validation., 500: An unexpected internal server error occurred.}

@endpoint POST /rejects/add-sms
@desc Add phone number to SMS rejection denylist
@returns(200) {phone: str, added: bool, deleted: bool, subaccount: str?} # Success
@errors {401: Invalid or missing API key., 404: Unknown subaccount, 422: One or more request parameters failed validation., 500: An unexpected internal server error occurred.}

@endpoint POST /rejects/list
@desc List rejection blacklist entries
@returns(200) Success
@errors {401: Invalid or missing API key., 404: Unknown subaccount, 429: Request rate limit exceeded. Retry after a brief delay., 500: An unexpected internal server error occurred.}

@endpoint POST /rejects/list-sms
@desc List SMS rejection denylist entries
@returns(200) Success
@errors {401: Invalid or missing API key., 422: One or more request parameters failed validation., 429: Request rate limit exceeded. Retry after a brief delay., 500: An unexpected internal server error occurred.}

@endpoint POST /rejects/delete
@desc Delete email from rejection blacklist
@returns(200) {email: str(email), deleted: bool, subaccount: str} # Success
@errors {401: Invalid or missing API key., 404: Email not found in rejection list or unknown subaccount, 422: One or more request parameters failed validation., 500: An unexpected internal server error occurred.}

@endpoint POST /rejects/delete-sms
@desc Delete phone number from SMS rejection denylist
@returns(200) {phone: str, added: bool, deleted: bool, subaccount: str?} # Success
@errors {401: Invalid or missing API key., 404: Phone number not found in rejection list or unknown subaccount, 422: One or more request parameters failed validation., 500: An unexpected internal server error occurred.}

@endgroup

@group senders
@endpoint POST /senders/list
@desc List senders used by this account
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /senders/domains
@desc List sender domains
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /senders/add-domain
@desc Add a sender domain
@returns(200) {domain: str(hostname), created_at: str(date-time), last_tested_at: str(date-time), spf: map{valid: bool, valid_after: str(date-time), error: str}, dkim: map{valid: bool, valid_after: str(date-time), error: str}, dkim2: map{valid: bool, valid_after: str(date-time), error: str}, dmarc: map{valid: bool, error: str}, verified_at: str(date-time), valid_signing: bool, verify_txt_key: str} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /senders/check-domain
@desc Check domain SPF and DKIM
@returns(200) {domain: str(hostname), created_at: str(date-time), last_tested_at: str(date-time), spf: map{valid: bool, valid_after: str(date-time), error: str}, dkim: map{valid: bool, valid_after: str(date-time), error: str}, dkim2: map{valid: bool, valid_after: str(date-time), error: str}, dmarc: map{valid: bool, error: str}, verified_at: str(date-time), valid_signing: bool, verify_txt_key: str} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /senders/verify-domain
@desc Verify a sender domain by email
@returns(200) {status: str, domain: str(hostname), email: str(email)} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /senders/info
@desc Get detailed information for a sender
@returns(200) Success
@errors {401: Invalid or missing API key., 404: Unknown sender, 500: An unexpected internal server error occurred.}

@endpoint POST /senders/time-series
@desc Get hourly stats for a sender
@returns(200) Success
@errors {401: Invalid or missing API key., 404: Unknown sender, 500: An unexpected internal server error occurred.}

@endpoint POST /senders/delete-domain
@desc Delete a sender domain
@returns(200) {domain: str(hostname), created_at: str(date-time), last_tested_at: str(date-time), spf: map{valid: bool, valid_after: str(date-time), error: str}, dkim: map{valid: bool, valid_after: str(date-time), error: str}, dkim2: map{valid: bool, valid_after: str(date-time), error: str}, dmarc: map{valid: bool, error: str}, verified_at: str(date-time), valid_signing: bool, verify_txt_key: str} # Success
@errors {401: Invalid or missing API key., 403: Cannot delete verified sender domain — please login to confirm deletion, 404: Unknown sender domain, 500: An unexpected internal server error occurred.}

@endgroup

@group subaccounts
@endpoint POST /subaccounts/list
@desc List subaccounts
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /subaccounts/add
@desc Add a new subaccount
@returns(200) {id: str, name: str, created_at: str, first_sent_at: str?, status: str, reputation: int, sent_weekly: int, sent_monthly: int, sent_total: int, custom_quota: int} # Success
@errors {401: Invalid or missing API key., 422: One or more request parameters failed validation., 500: An unexpected internal server error occurred.}

@endpoint POST /subaccounts/info
@desc Get subaccount information
@returns(200) Success
@errors {401: Invalid or missing API key., 404: Unknown subaccount, 500: An unexpected internal server error occurred.}

@endpoint POST /subaccounts/update
@desc Update an existing subaccount
@returns(200) {id: str, name: str, created_at: str, first_sent_at: str?, status: str, reputation: int, sent_weekly: int, sent_monthly: int, sent_total: int, custom_quota: int} # Success
@errors {401: Invalid or missing API key., 404: Unknown subaccount, 500: An unexpected internal server error occurred.}

@endpoint POST /subaccounts/delete
@desc Delete a subaccount
@returns(200) {id: str, name: str, created_at: str, first_sent_at: str?, status: str, reputation: int, sent_weekly: int, sent_monthly: int, sent_total: int, custom_quota: int} # Success
@errors {401: Invalid or missing API key., 404: Unknown subaccount, 500: An unexpected internal server error occurred.}

@endpoint POST /subaccounts/pause
@desc Pause a subaccount
@returns(200) {id: str, name: str, created_at: str, first_sent_at: str?, status: str, reputation: int, sent_weekly: int, sent_monthly: int, sent_total: int, custom_quota: int} # Success
@errors {401: Invalid or missing API key., 404: Unknown subaccount, 500: An unexpected internal server error occurred.}

@endpoint POST /subaccounts/resume
@desc Resume a paused subaccount
@returns(200) {id: str, name: str, created_at: str, first_sent_at: str?, status: str, reputation: int, sent_weekly: int, sent_monthly: int, sent_total: int, custom_quota: int} # Success
@errors {401: Invalid or missing API key., 404: Unknown subaccount, 500: An unexpected internal server error occurred.}

@endgroup

@group tags
@endpoint POST /tags/list
@desc List all user-defined tags
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /tags/delete
@desc Delete a tag permanently
@returns(200) {tag: str, sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, clicks: int, unique_opens: int, unique_clicks: int, reputation: int} # Success
@errors {400: Invalid tag name, 401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /tags/info
@desc Get detailed information about a tag
@returns(200) {tag: str, sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, clicks: int, unique_opens: int, unique_clicks: int, reputation: int, stats: map{today: map{sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, unique_opens: int, clicks: int, unique_clicks: int}, last_7_days: map{sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, unique_opens: int, clicks: int, unique_clicks: int}, last_30_days: map{sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, unique_opens: int, clicks: int, unique_clicks: int}, last_60_days: map{sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, unique_opens: int, clicks: int, unique_clicks: int}, last_90_days: map{sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, unique_opens: int, clicks: int, unique_clicks: int}}} # Success
@errors {400: Invalid tag name, 401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /tags/time-series
@desc Get time series data for a specific tag
@returns(200) Success
@errors {400: Invalid tag name, 401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /tags/all-time-series
@desc Get time series data for all tags
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endgroup

@group templates
@endpoint POST /templates/add
@desc Add a new template
@returns(200) {slug: str, name: str, labels: [str], code: str?, subject: str?, from_email: str(email)?, from_name: str?, text: str?, publish_name: str, publish_code: str?, publish_subject: str?, publish_from_email: str(email)?, publish_from_name: str?, publish_text: str?, published_at: str(date-time)?, created_at: str(date-time), updated_at: str(date-time), draft_updated_at: str(date-time), is_broken_template: bool} # Success
@errors {401: Invalid or missing API key., 422: Invalid template data, 500: An unexpected internal server error occurred.}

@endpoint POST /templates/info
@desc Get template information
@returns(200) {slug: str, name: str, labels: [str], code: str?, subject: str?, from_email: str(email)?, from_name: str?, text: str?, publish_name: str, publish_code: str?, publish_subject: str?, publish_from_email: str(email)?, publish_from_name: str?, publish_text: str?, published_at: str(date-time)?, created_at: str(date-time), updated_at: str(date-time), draft_updated_at: str(date-time), is_broken_template: bool} # Success
@errors {401: Invalid or missing API key., 404: Template not found, 500: An unexpected internal server error occurred.}

@endpoint POST /templates/update
@desc Update an existing template
@returns(200) {slug: str, name: str, labels: [str], code: str?, subject: str?, from_email: str(email)?, from_name: str?, text: str?, publish_name: str, publish_code: str?, publish_subject: str?, publish_from_email: str(email)?, publish_from_name: str?, publish_text: str?, published_at: str(date-time)?, created_at: str(date-time), updated_at: str(date-time), draft_updated_at: str(date-time), is_broken_template: bool} # Success
@errors {401: Invalid or missing API key., 404: Template not found, 500: An unexpected internal server error occurred.}

@endpoint POST /templates/publish
@desc Publish a template
@returns(200) {slug: str, name: str, labels: [str], code: str?, subject: str?, from_email: str(email)?, from_name: str?, text: str?, publish_name: str, publish_code: str?, publish_subject: str?, publish_from_email: str(email)?, publish_from_name: str?, publish_text: str?, published_at: str(date-time)?, created_at: str(date-time), updated_at: str(date-time), draft_updated_at: str(date-time), is_broken_template: bool} # Success
@errors {401: Invalid or missing API key., 404: Template not found, 500: An unexpected internal server error occurred.}

@endpoint POST /templates/delete
@desc Delete a template
@returns(200) {slug: str, name: str, labels: [str], code: str?, subject: str?, from_email: str(email)?, from_name: str?, text: str?, publish_name: str, publish_code: str?, publish_subject: str?, publish_from_email: str(email)?, publish_from_name: str?, publish_text: str?, published_at: str(date-time)?, created_at: str(date-time), updated_at: str(date-time), draft_updated_at: str(date-time), is_broken_template: bool} # Success
@errors {401: Invalid or missing API key., 404: Template not found, 500: An unexpected internal server error occurred.}

@endpoint POST /templates/list
@desc List all templates
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /templates/time-series
@desc Get template time series data
@returns(200) Success
@errors {401: Invalid or missing API key., 404: Template not found, 500: An unexpected internal server error occurred.}

@endpoint POST /templates/render
@desc Render a template
@returns(200) {html: str} # Success
@errors {401: Invalid or missing API key., 404: Template not found, 500: An unexpected internal server error occurred.}

@endgroup

@group urls
@endpoint POST /urls/tracking-domains
@desc Get tracking domains
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /urls/add-tracking-domain
@desc Add tracking domain
@returns(200) {domain: str(hostname), created_at: str, last_tested_at: str, cname: map{valid: bool, valid_after: str?, error: str?}, valid_tracking: bool} # Success
@errors {400: Invalid tracking domain, 401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /urls/check-tracking-domain
@desc Check tracking domain
@returns(200) {domain: str(hostname), created_at: str, last_tested_at: str, cname: map{valid: bool, valid_after: str?, error: str?}, valid_tracking: bool} # Success
@errors {401: Invalid or missing API key., 404: Unknown tracking domain, 500: An unexpected internal server error occurred.}

@endpoint POST /urls/delete-tracking-domain
@desc Delete a tracking domain
@returns(200) {domain: str(hostname), created_at: str, last_tested_at: str, cname: map{valid: bool, valid_after: str?, error: str?}, valid_tracking: bool} # Success
@errors {401: Invalid or missing API key., 403: Cannot delete verified tracking domain — please login to confirm deletion, 404: Unknown tracking domain, 500: An unexpected internal server error occurred.}

@endgroup

@group users
@endpoint POST /users/info
@desc Return the information about the API-connected user
@returns(200) {username: str, created_at: str, public_id: str, reputation: int, hourly_quota: int, backlog: int, stats: map{today: map{sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, unique_opens: int, clicks: int, unique_clicks: int}, last_7_days: map{sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, unique_opens: int, clicks: int, unique_clicks: int}, last_30_days: map{sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, unique_opens: int, clicks: int, unique_clicks: int}, last_60_days: map{sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, unique_opens: int, clicks: int, unique_clicks: int}, last_90_days: map{sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, unique_opens: int, clicks: int, unique_clicks: int}, all_time: map{sent: int, hard_bounces: int, soft_bounces: int, rejects: int, complaints: int, unsubs: int, opens: int, unique_opens: int, clicks: int, unique_clicks: int}}} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /users/ping
@desc Validate an API key and respond to a ping
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /users/ping2
@desc Validate an API key and respond to a ping (strict JSON parser version)
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /users/senders
@desc Return the senders that have tried to use this account
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endgroup

@group webhooks
@endpoint POST /webhooks/list
@desc Get the list of all webhooks
@returns(200) Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /webhooks/add
@desc Add a new webhook
@returns(200) {id: int, url: str(uri), auth_key: str?, description: str?, events: [str], created_at: str, last_sent_at: str?, batches_sent: int, events_sent: int, last_error: str?} # Success
@errors {401: Invalid or missing API key., 500: An unexpected internal server error occurred.}

@endpoint POST /webhooks/info
@desc Get webhook information
@returns(200) {id: int, url: str(uri), auth_key: str?, description: str?, events: [str], created_at: str, last_sent_at: str?, batches_sent: int, events_sent: int, last_error: str?} # Success
@errors {401: Invalid or missing API key., 404: Unknown webhook, 500: An unexpected internal server error occurred.}

@endpoint POST /webhooks/update
@desc Update an existing webhook
@returns(200) {id: int, url: str(uri), auth_key: str?, description: str?, events: [str], created_at: str, last_sent_at: str?, batches_sent: int, events_sent: int, last_error: str?} # Success
@errors {401: Invalid or missing API key., 404: Unknown webhook, 500: An unexpected internal server error occurred.}

@endpoint POST /webhooks/delete
@desc Delete an existing webhook
@returns(200) {id: int, url: str(uri), auth_key: str?, description: str?, events: [str], created_at: str, last_sent_at: str?, batches_sent: int, events_sent: int, last_error: str?} # Success
@errors {401: Invalid or missing API key., 404: Unknown webhook, 500: An unexpected internal server error occurred.}

@endgroup

@end
