@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
@returns(200) {email: str(email), added: bool}
@errors {401, 422, 500}

@endpoint POST /allowlists/list
@returns(200)
@errors {401, 500}

@endpoint POST /allowlists/delete
@returns(200) {email: str(email), deleted: bool}
@errors {401, 422, 500}

@endgroup

@group exports
@endpoint POST /exports/info
@returns(200) {id: str, created_at: str, type: str, finished_at: str?, state: str, result_url: str(uri)?}
@errors {401, 404, 500}

@endpoint POST /exports/list
@returns(200)
@errors {401, 500}

@endpoint POST /exports/rejects
@returns(200) {id: str, created_at: str, type: str, finished_at: str?, state: str, result_url: str(uri)?}
@errors {401, 500}

@endpoint POST /exports/whitelist
@returns(200) {id: str, created_at: str, type: str, finished_at: str?, state: str, result_url: str(uri)?}
@errors {401, 500}

@endpoint POST /exports/allowlist
@returns(200) {id: str, created_at: str, type: str, finished_at: str?, state: str, result_url: str(uri)?}
@errors {401, 500}

@endpoint POST /exports/activity
@required {key: map{key!: str}}
@optional {notify_email: str(email), date_from: str, date_to: str, tags: [str], senders: [str(email)], states: [str], api_keys: [str]}
@returns(200) {id: str, created_at: str, type: str, finished_at: str?, state: str, result_url: str(uri)?}
@errors {401, 500}

@endgroup

@group ips
@endpoint POST /ips/list
@returns(200)
@errors {401, 500}

@endpoint POST /ips/info
@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?}}
@errors {401, 500}

@endpoint POST /ips/provision
@returns(200) {requested_at: str}
@errors {401, 402, 404, 500}

@endpoint POST /ips/start-warmup
@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?}}
@errors {401, 404, 500}

@endpoint POST /ips/cancel-warmup
@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?}}
@errors {401, 404, 500}

@endpoint POST /ips/set-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?}}
@errors {400, 401, 404, 500}

@endpoint POST /ips/delete
@returns(200) {ip: str, deleted: bool}
@errors {401, 500}

@endpoint POST /ips/list-pools
@returns(200)
@errors {401, 500}

@endpoint POST /ips/pool-info
@returns(200) {name: str, created_at: str, ips: [map]}
@errors {401, 404, 500}

@endpoint POST /ips/create-pool
@returns(200) {name: str, created_at: str, ips: [map]}
@errors {401, 500}

@endpoint POST /ips/delete-pool
@returns(200) {pool: str, deleted: bool}
@errors {400, 401, 404, 500}

@endpoint POST /ips/check-custom-dns
@returns(200) {valid: bool, error: str?}
@errors {401, 404, 500}

@endpoint POST /ips/set-custom-dns
@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?}}
@errors {400, 401, 404, 500}

@endgroup

@group inbound
@endpoint POST /inbound/domains
@returns(200)
@errors {401, 500}

@endpoint POST /inbound/add-domain
@returns(200) {domain: str, created_at: str, valid_mx: bool}
@errors {401, 500}

@endpoint POST /inbound/check-domain
@returns(200) {domain: str, created_at: str, valid_mx: bool}
@errors {401, 404, 500}

@endpoint POST /inbound/delete-domain
@returns(200) {domain: str, created_at: str, valid_mx: bool}
@errors {401, 404, 500}

@endpoint POST /inbound/routes
@returns(200)
@errors {401, 404, 500}

@endpoint POST /inbound/add-route
@returns(200) {id: str, pattern: str, url: str(uri)}
@errors {401, 404, 500}

@endpoint POST /inbound/update-route
@returns(200) {id: str, pattern: str, url: str(uri)}
@errors {401, 404, 500}

@endpoint POST /inbound/delete-route
@returns(200) {id: str, pattern: str, url: str(uri)}
@errors {401, 404, 500}

@endpoint POST /inbound/send-raw
@returns(200)
@errors {401, 404, 500}

@endgroup

@group mctemplates
@endpoint POST /mctemplates/info
@returns(200)
@errors {401, 404, 500}

@endpoint POST /mctemplates/list
@returns(200)
@errors {401, 500}

@endpoint POST /mctemplates/render
@returns(200) {html: str}
@errors {401, 404, 422, 500}

@endpoint POST /mctemplates/time-series
@returns(200)
@errors {401, 404, 500}

@endgroup

@group messages
@endpoint POST /messages/send
@returns(200)
@errors {401, 402, 404, 500}

@endpoint POST /messages/send-template
@returns(200)
@errors {401, 402, 404, 500}

@endpoint POST /messages/send-mc-template
@returns(200)
@errors {401, 402, 404, 500}

@endpoint POST /messages/search
@returns(200)
@errors {401, 500, 503}

@endpoint POST /messages/search-time-series
@returns(200)
@errors {401, 500, 503}

@endpoint POST /messages/info
@returns(200)
@errors {401, 404, 500}

@endpoint POST /messages/content
@returns(200)
@errors {401, 404, 500}

@endpoint POST /messages/parse
@returns(200) {headers: map, text: str, text_flowed: bool, attachments: [map], from_email: str(email), from_name: str, html: str?, to: [map], subject: str?}
@errors {401, 422, 500}

@endpoint POST /messages/send-raw
@returns(200)
@errors {401, 402, 404, 500}

@endpoint POST /messages/list-scheduled
@returns(200)
@errors {401, 500}

@endpoint POST /messages/cancel-scheduled
@returns(200) {_id: str, created_at: str, send_at: str, from_email: str(email), to: str(email), subject: str}
@errors {401, 404, 500}

@endpoint POST /messages/reschedule
@returns(200) {_id: str, created_at: str, send_at: str, from_email: str(email), to: str(email), subject: str}
@errors {401, 404, 500}

@endpoint POST /messages/send-sms
@returns(200)
@errors {401, 404, 500}

@endgroup

@group metadata
@endpoint POST /metadata/list
@returns(200)
@errors {401, 500}

@endpoint POST /metadata/add
@returns(200) {name: str, state: str, view_template: str?}
@errors {401, 422, 500}

@endpoint POST /metadata/update
@returns(200) {name: str, state: str, view_template: str?}
@errors {401, 404, 500}

@endpoint POST /metadata/delete
@returns(200) {name: str, state: str, view_template: str?}
@errors {401, 404, 500}

@endgroup

@group rejects
@endpoint POST /rejects/add
@returns(200) {email: str(email), added: bool}
@errors {401, 404, 422, 500}

@endpoint POST /rejects/add-sms
@returns(200) {phone: str, added: bool, deleted: bool, subaccount: str?}
@errors {401, 404, 422, 500}

@endpoint POST /rejects/list
@returns(200)
@errors {401, 404, 429, 500}

@endpoint POST /rejects/list-sms
@returns(200)
@errors {401, 422, 429, 500}

@endpoint POST /rejects/delete
@returns(200) {email: str(email), deleted: bool, subaccount: str}
@errors {401, 404, 422, 500}

@endpoint POST /rejects/delete-sms
@returns(200) {phone: str, added: bool, deleted: bool, subaccount: str?}
@errors {401, 404, 422, 500}

@endgroup

@group senders
@endpoint POST /senders/list
@returns(200)
@errors {401, 500}

@endpoint POST /senders/domains
@returns(200)
@errors {401, 500}

@endpoint POST /senders/add-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}
@errors {401, 500}

@endpoint POST /senders/check-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}
@errors {401, 500}

@endpoint POST /senders/verify-domain
@returns(200) {status: str, domain: str(hostname), email: str(email)}
@errors {401, 500}

@endpoint POST /senders/info
@returns(200)
@errors {401, 404, 500}

@endpoint POST /senders/time-series
@returns(200)
@errors {401, 404, 500}

@endpoint POST /senders/delete-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}
@errors {401, 403, 404, 500}

@endgroup

@group subaccounts
@endpoint POST /subaccounts/list
@returns(200)
@errors {401, 500}

@endpoint POST /subaccounts/add
@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}
@errors {401, 422, 500}

@endpoint POST /subaccounts/info
@returns(200)
@errors {401, 404, 500}

@endpoint POST /subaccounts/update
@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}
@errors {401, 404, 500}

@endpoint POST /subaccounts/delete
@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}
@errors {401, 404, 500}

@endpoint POST /subaccounts/pause
@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}
@errors {401, 404, 500}

@endpoint POST /subaccounts/resume
@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}
@errors {401, 404, 500}

@endgroup

@group tags
@endpoint POST /tags/list
@returns(200)
@errors {401, 500}

@endpoint POST /tags/delete
@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}
@errors {400, 401, 500}

@endpoint POST /tags/info
@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}}}
@errors {400, 401, 500}

@endpoint POST /tags/time-series
@returns(200)
@errors {400, 401, 500}

@endpoint POST /tags/all-time-series
@returns(200)
@errors {401, 500}

@endgroup

@group templates
@endpoint POST /templates/add
@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}
@errors {401, 422, 500}

@endpoint POST /templates/info
@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}
@errors {401, 404, 500}

@endpoint POST /templates/update
@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}
@errors {401, 404, 500}

@endpoint POST /templates/publish
@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}
@errors {401, 404, 500}

@endpoint POST /templates/delete
@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}
@errors {401, 404, 500}

@endpoint POST /templates/list
@returns(200)
@errors {401, 500}

@endpoint POST /templates/time-series
@returns(200)
@errors {401, 404, 500}

@endpoint POST /templates/render
@returns(200) {html: str}
@errors {401, 404, 500}

@endgroup

@group urls
@endpoint POST /urls/tracking-domains
@returns(200)
@errors {401, 500}

@endpoint POST /urls/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}
@errors {400, 401, 500}

@endpoint POST /urls/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}
@errors {401, 404, 500}

@endpoint POST /urls/delete-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}
@errors {401, 403, 404, 500}

@endgroup

@group users
@endpoint POST /users/info
@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}}}
@errors {401, 500}

@endpoint POST /users/ping
@returns(200)
@errors {401, 500}

@endpoint POST /users/ping2
@returns(200)
@errors {401, 500}

@endpoint POST /users/senders
@returns(200)
@errors {401, 500}

@endgroup

@group webhooks
@endpoint POST /webhooks/list
@returns(200)
@errors {401, 500}

@endpoint POST /webhooks/add
@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?}
@errors {401, 500}

@endpoint POST /webhooks/info
@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?}
@errors {401, 404, 500}

@endpoint POST /webhooks/update
@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?}
@errors {401, 404, 500}

@endpoint POST /webhooks/delete
@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?}
@errors {401, 404, 500}

@endgroup

@end
