sendpost_ruby_sdk 2.0.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +612 -531
  3. data/docs/AccountCycleUsage.md +18 -0
  4. data/docs/AccountStats.md +3 -3
  5. data/docs/AccountWebhookWithStats.md +58 -0
  6. data/docs/AggregateStat.md +14 -14
  7. data/docs/AggregateStats.md +22 -22
  8. data/docs/Attachment.md +4 -4
  9. data/docs/BlacklistLinks.md +20 -0
  10. data/docs/BlacklistResource.md +38 -0
  11. data/docs/BlacklistedOn.md +20 -0
  12. data/docs/CopyTo.md +6 -6
  13. data/docs/CreateDomainRequest.md +2 -2
  14. data/docs/CreateSuppressionRequest.md +4 -4
  15. data/docs/CreateSuppressionRequestHardBounceInner.md +1 -1
  16. data/docs/CreateSuppressionRequestManualInner.md +1 -1
  17. data/docs/CreateSuppressionRequestSpamComplaintInner.md +1 -1
  18. data/docs/CreateSuppressionRequestUnsubscribeInner.md +1 -1
  19. data/docs/DailyStatistics.md +38 -0
  20. data/docs/DateStat.md +40 -0
  21. data/docs/DeleteResponse.md +4 -4
  22. data/docs/DeleteSubAccountResponse.md +4 -4
  23. data/docs/{DeleteSuppression200ResponseInner.md → DeleteSuppression200Response.md} +2 -4
  24. data/docs/DeleteSuppressionRequest.md +1 -1
  25. data/docs/{EmailMessageReplyTo.md → DeleteSuppressionRequestSuppressionsInner.md} +3 -5
  26. data/docs/DeleteWebhookResponse.md +3 -3
  27. data/docs/Device.md +2 -2
  28. data/docs/DnsRecord.md +22 -0
  29. data/docs/Domain.md +24 -28
  30. data/docs/DomainApi.md +66 -66
  31. data/docs/DomainStat.md +46 -0
  32. data/docs/EIP.md +1 -1
  33. data/docs/EmailAddress.md +4 -4
  34. data/docs/EmailApi.md +4 -4
  35. data/docs/EmailMessage.md +30 -30
  36. data/docs/EmailMessageObject.md +33 -26
  37. data/docs/EmailMessageWithTemplate.md +32 -27
  38. data/docs/EmailResponse.md +10 -10
  39. data/docs/EmailTypeStat.md +40 -0
  40. data/docs/ErrorResponse.md +18 -0
  41. data/docs/ErrorResponseError.md +26 -0
  42. data/docs/ErrorResponseErrorDetailsInner.md +20 -0
  43. data/docs/Event.md +18 -36
  44. data/docs/EventMetadata.md +14 -14
  45. data/docs/GeoLocation.md +8 -8
  46. data/docs/GroupStat.md +40 -0
  47. data/docs/IP.md +13 -43
  48. data/docs/IPAllocationRequest.md +4 -4
  49. data/docs/IPApi.md +19 -19
  50. data/docs/IPDeletionResponse.md +2 -2
  51. data/docs/IPPool.md +13 -21
  52. data/docs/IPPoolCreateRequest.md +10 -8
  53. data/docs/IPPoolDeleteResponse.md +2 -2
  54. data/docs/IPPoolStat.md +44 -0
  55. data/docs/IPPoolUpdateRequest.md +13 -7
  56. data/docs/IPPoolsApi.md +26 -19
  57. data/docs/IPStat.md +46 -0
  58. data/docs/IPUpdateRequest.md +2 -2
  59. data/docs/Label.md +10 -6
  60. data/docs/Member.md +15 -21
  61. data/docs/Message.md +37 -53
  62. data/docs/MessageApi.md +83 -3
  63. data/docs/NewSubAccount.md +18 -0
  64. data/docs/NewWebhook.md +46 -0
  65. data/docs/Os.md +26 -0
  66. data/docs/PostmasterDomainStat.md +30 -0
  67. data/docs/ProviderStat.md +40 -0
  68. data/docs/RAIPPoolStat.md +20 -0
  69. data/docs/RDStat.md +20 -0
  70. data/docs/RIPStat.md +20 -0
  71. data/docs/RStat.md +20 -0
  72. data/docs/Recipient.md +8 -8
  73. data/docs/SDStat.md +42 -0
  74. data/docs/SMTPAuth.md +5 -9
  75. data/docs/SeedContactStats.md +28 -0
  76. data/docs/Stat.md +22 -4
  77. data/docs/StatsAApi.md +24 -24
  78. data/docs/StatsApi.md +19 -19
  79. data/docs/SubAccount.md +13 -27
  80. data/docs/SubAccountApi.md +23 -23
  81. data/docs/SubAccountStat.md +44 -0
  82. data/docs/SubAccountStatForPool.md +42 -0
  83. data/docs/Suppression.md +14 -10
  84. data/docs/SuppressionApi.md +19 -19
  85. data/docs/TPSPStat.md +42 -0
  86. data/docs/UpdateSubAccount.md +2 -2
  87. data/docs/UpdateWebhook.md +23 -23
  88. data/docs/UserAgent.md +7 -7
  89. data/docs/ValidationStat.md +32 -0
  90. data/docs/Webhook.md +31 -29
  91. data/docs/WebhookApi.md +28 -28
  92. data/docs/WebhookObject.md +20 -0
  93. data/docs/WebhookReferenceApi.md +71 -0
  94. data/lib/sendpost_ruby_sdk/api/domain_api.rb +84 -84
  95. data/lib/sendpost_ruby_sdk/api/email_api.rb +6 -6
  96. data/lib/sendpost_ruby_sdk/api/ip_api.rb +24 -24
  97. data/lib/sendpost_ruby_sdk/api/ip_pools_api.rb +25 -25
  98. data/lib/sendpost_ruby_sdk/api/message_api.rb +83 -6
  99. data/lib/sendpost_ruby_sdk/api/stats_a_api.rb +30 -30
  100. data/lib/sendpost_ruby_sdk/api/stats_api.rb +24 -24
  101. data/lib/sendpost_ruby_sdk/api/sub_account_api.rb +33 -33
  102. data/lib/sendpost_ruby_sdk/api/suppression_api.rb +23 -23
  103. data/lib/sendpost_ruby_sdk/api/webhook_api.rb +36 -36
  104. data/lib/sendpost_ruby_sdk/api/webhook_reference_api.rb +82 -0
  105. data/lib/sendpost_ruby_sdk/api_client.rb +2 -2
  106. data/lib/sendpost_ruby_sdk/api_error.rb +2 -2
  107. data/lib/sendpost_ruby_sdk/configuration.rb +2 -2
  108. data/lib/sendpost_ruby_sdk/models/account_cycle_usage.rb +222 -0
  109. data/lib/sendpost_ruby_sdk/models/account_stats.rb +5 -3
  110. data/lib/sendpost_ruby_sdk/models/account_webhook_with_stats.rb +463 -0
  111. data/lib/sendpost_ruby_sdk/models/aggregate_stat.rb +37 -29
  112. data/lib/sendpost_ruby_sdk/models/aggregate_stats.rb +43 -24
  113. data/lib/sendpost_ruby_sdk/models/attachment.rb +48 -4
  114. data/lib/sendpost_ruby_sdk/models/blacklist_links.rb +232 -0
  115. data/lib/sendpost_ruby_sdk/models/blacklist_resource.rb +323 -0
  116. data/lib/sendpost_ruby_sdk/models/blacklisted_on.rb +232 -0
  117. data/lib/sendpost_ruby_sdk/models/copy_to.rb +42 -3
  118. data/lib/sendpost_ruby_sdk/models/create_domain_request.rb +32 -3
  119. data/lib/sendpost_ruby_sdk/models/create_suppression_request.rb +6 -6
  120. data/lib/sendpost_ruby_sdk/models/create_suppression_request_hard_bounce_inner.rb +2 -2
  121. data/lib/sendpost_ruby_sdk/models/create_suppression_request_manual_inner.rb +2 -2
  122. data/lib/sendpost_ruby_sdk/models/create_suppression_request_spam_complaint_inner.rb +2 -2
  123. data/lib/sendpost_ruby_sdk/models/create_suppression_request_unsubscribe_inner.rb +2 -2
  124. data/lib/sendpost_ruby_sdk/models/daily_statistics.rb +322 -0
  125. data/lib/sendpost_ruby_sdk/models/date_stat.rb +339 -0
  126. data/lib/sendpost_ruby_sdk/models/delete_response.rb +5 -4
  127. data/lib/sendpost_ruby_sdk/models/delete_sub_account_response.rb +5 -4
  128. data/lib/sendpost_ruby_sdk/models/delete_suppression200_response.rb +221 -0
  129. data/lib/sendpost_ruby_sdk/models/delete_suppression_request.rb +4 -3
  130. data/lib/sendpost_ruby_sdk/models/delete_suppression_request_suppressions_inner.rb +220 -0
  131. data/lib/sendpost_ruby_sdk/models/delete_webhook_response.rb +5 -4
  132. data/lib/sendpost_ruby_sdk/models/device.rb +5 -3
  133. data/lib/sendpost_ruby_sdk/models/dns_record.rb +276 -0
  134. data/lib/sendpost_ruby_sdk/models/domain.rb +42 -85
  135. data/lib/sendpost_ruby_sdk/models/domain_stat.rb +369 -0
  136. data/lib/sendpost_ruby_sdk/models/eip.rb +4 -3
  137. data/lib/sendpost_ruby_sdk/models/email_address.rb +41 -2
  138. data/lib/sendpost_ruby_sdk/models/email_message.rb +26 -9
  139. data/lib/sendpost_ruby_sdk/models/email_message_object.rb +123 -3
  140. data/lib/sendpost_ruby_sdk/models/email_message_with_template.rb +121 -12
  141. data/lib/sendpost_ruby_sdk/models/email_response.rb +8 -4
  142. data/lib/sendpost_ruby_sdk/models/email_type_stat.rb +339 -0
  143. data/lib/sendpost_ruby_sdk/models/error_response.rb +221 -0
  144. data/lib/sendpost_ruby_sdk/models/error_response_error.rb +297 -0
  145. data/lib/sendpost_ruby_sdk/models/error_response_error_details_inner.rb +231 -0
  146. data/lib/sendpost_ruby_sdk/models/event.rb +94 -118
  147. data/lib/sendpost_ruby_sdk/models/event_metadata.rb +15 -5
  148. data/lib/sendpost_ruby_sdk/models/geo_location.rb +20 -14
  149. data/lib/sendpost_ruby_sdk/models/group_stat.rb +339 -0
  150. data/lib/sendpost_ruby_sdk/models/ip.rb +72 -375
  151. data/lib/sendpost_ruby_sdk/models/ip_allocation_request.rb +29 -33
  152. data/lib/sendpost_ruby_sdk/models/ip_deletion_response.rb +5 -4
  153. data/lib/sendpost_ruby_sdk/models/ip_pool.rb +94 -82
  154. data/lib/sendpost_ruby_sdk/models/ip_pool_create_request.rb +91 -29
  155. data/lib/sendpost_ruby_sdk/models/ip_pool_delete_response.rb +5 -2
  156. data/lib/sendpost_ruby_sdk/models/ip_pool_stat.rb +359 -0
  157. data/lib/sendpost_ruby_sdk/models/ip_pool_update_request.rb +97 -7
  158. data/lib/sendpost_ruby_sdk/models/ip_stat.rb +369 -0
  159. data/lib/sendpost_ruby_sdk/models/ip_update_request.rb +4 -20
  160. data/lib/sendpost_ruby_sdk/models/label.rb +101 -6
  161. data/lib/sendpost_ruby_sdk/models/member.rb +49 -57
  162. data/lib/sendpost_ruby_sdk/models/message.rb +39 -120
  163. data/lib/sendpost_ruby_sdk/models/new_sub_account.rb +257 -0
  164. data/lib/sendpost_ruby_sdk/models/new_webhook.rb +407 -0
  165. data/lib/sendpost_ruby_sdk/models/os.rb +262 -0
  166. data/lib/sendpost_ruby_sdk/models/postmaster_domain_stat.rb +282 -0
  167. data/lib/sendpost_ruby_sdk/models/provider_stat.rb +339 -0
  168. data/lib/sendpost_ruby_sdk/models/r_stat.rb +231 -0
  169. data/lib/sendpost_ruby_sdk/models/raip_pool_stat.rb +231 -0
  170. data/lib/sendpost_ruby_sdk/models/rd_stat.rb +231 -0
  171. data/lib/sendpost_ruby_sdk/models/recipient.rb +82 -3
  172. data/lib/sendpost_ruby_sdk/models/rip_stat.rb +231 -0
  173. data/lib/sendpost_ruby_sdk/models/sd_stat.rb +349 -0
  174. data/lib/sendpost_ruby_sdk/models/seed_contact_stats.rb +281 -0
  175. data/lib/sendpost_ruby_sdk/models/smtp_auth.rb +10 -29
  176. data/lib/sendpost_ruby_sdk/models/stat.rb +108 -16
  177. data/lib/sendpost_ruby_sdk/models/sub_account.rb +57 -115
  178. data/lib/sendpost_ruby_sdk/models/sub_account_stat.rb +359 -0
  179. data/lib/sendpost_ruby_sdk/models/sub_account_stat_for_pool.rb +349 -0
  180. data/lib/sendpost_ruby_sdk/models/suppression.rb +82 -15
  181. data/lib/sendpost_ruby_sdk/models/tpsp_stat.rb +349 -0
  182. data/lib/sendpost_ruby_sdk/models/update_sub_account.rb +32 -3
  183. data/lib/sendpost_ruby_sdk/models/update_webhook.rb +83 -37
  184. data/lib/sendpost_ruby_sdk/models/user_agent.rb +11 -6
  185. data/lib/sendpost_ruby_sdk/models/validation_stat.rb +292 -0
  186. data/lib/sendpost_ruby_sdk/models/webhook.rb +108 -67
  187. data/lib/sendpost_ruby_sdk/models/webhook_object.rb +232 -0
  188. data/lib/sendpost_ruby_sdk/version.rb +3 -3
  189. data/lib/sendpost_ruby_sdk.rb +36 -27
  190. data/sendpost_ruby_sdk.gemspec +39 -0
  191. data/spec/api/webhook_reference_api_spec.rb +46 -0
  192. data/spec/models/account_cycle_usage_spec.rb +36 -0
  193. data/spec/models/account_webhook_with_stats_spec.rb +160 -0
  194. data/spec/models/blacklist_links_spec.rb +42 -0
  195. data/spec/models/blacklist_resource_spec.rb +96 -0
  196. data/spec/models/blacklisted_on_spec.rb +42 -0
  197. data/spec/models/daily_statistics_spec.rb +96 -0
  198. data/spec/models/date_stat_spec.rb +102 -0
  199. data/spec/models/delete_suppression200_response_spec.rb +36 -0
  200. data/spec/models/delete_suppression_request_suppressions_inner_spec.rb +36 -0
  201. data/spec/models/dns_record_spec.rb +52 -0
  202. data/spec/models/domain_stat_spec.rb +120 -0
  203. data/spec/models/email_type_stat_spec.rb +102 -0
  204. data/spec/models/error_response_error_details_inner_spec.rb +42 -0
  205. data/spec/models/error_response_error_spec.rb +64 -0
  206. data/spec/models/error_response_spec.rb +36 -0
  207. data/spec/models/group_stat_spec.rb +102 -0
  208. data/spec/models/ip_pool_stat_spec.rb +114 -0
  209. data/spec/models/ip_stat_spec.rb +120 -0
  210. data/spec/models/new_sub_account_spec.rb +36 -0
  211. data/spec/models/new_webhook_spec.rb +120 -0
  212. data/spec/models/os_spec.rb +60 -0
  213. data/spec/models/postmaster_domain_stat_spec.rb +72 -0
  214. data/spec/models/provider_stat_spec.rb +102 -0
  215. data/spec/models/r_stat_spec.rb +42 -0
  216. data/spec/models/raip_pool_stat_spec.rb +42 -0
  217. data/spec/models/rd_stat_spec.rb +42 -0
  218. data/spec/models/rip_stat_spec.rb +42 -0
  219. data/spec/models/sd_stat_spec.rb +108 -0
  220. data/spec/models/seed_contact_stats_spec.rb +66 -0
  221. data/spec/models/sub_account_stat_for_pool_spec.rb +108 -0
  222. data/spec/models/sub_account_stat_spec.rb +114 -0
  223. data/spec/models/tpsp_stat_spec.rb +108 -0
  224. data/spec/models/validation_stat_spec.rb +78 -0
  225. data/spec/models/webhook_object_spec.rb +42 -0
  226. data/spec/spec_helper.rb +2 -2
  227. metadata +143 -219
  228. data/LICENSE +0 -21
  229. data/docs/AccountStatsStat.md +0 -38
  230. data/docs/AggregatedEmailStats.md +0 -38
  231. data/docs/AutoWarmupPlan.md +0 -80
  232. data/docs/CreateSubAccountRequest.md +0 -18
  233. data/docs/CreateWebhookRequest.md +0 -46
  234. data/docs/DomainDkim.md +0 -22
  235. data/docs/DomainDmarc.md +0 -22
  236. data/docs/DomainGpt.md +0 -22
  237. data/docs/DomainReturnPath.md +0 -22
  238. data/docs/DomainSpf.md +0 -22
  239. data/docs/DomainTrack.md +0 -22
  240. data/docs/EmailMessageFrom.md +0 -20
  241. data/docs/EmailMessageToInner.md +0 -26
  242. data/docs/EmailMessageToInnerBccInner.md +0 -22
  243. data/docs/EmailMessageToInnerCcInner.md +0 -22
  244. data/docs/EmailStats.md +0 -20
  245. data/docs/EmailStatsStats.md +0 -38
  246. data/docs/MessageHeaderTo.md +0 -26
  247. data/docs/MessageTo.md +0 -26
  248. data/docs/OperatingSystem.md +0 -26
  249. data/docs/Person.md +0 -20
  250. data/docs/StatStat.md +0 -38
  251. data/docs/StatStats.md +0 -38
  252. data/docs/ThirdPartySendingProvider.md +0 -38
  253. data/lib/sendpost_ruby_sdk/models/account_stats_stat.rb +0 -311
  254. data/lib/sendpost_ruby_sdk/models/aggregated_email_stats.rb +0 -321
  255. data/lib/sendpost_ruby_sdk/models/auto_warmup_plan.rb +0 -531
  256. data/lib/sendpost_ruby_sdk/models/create_sub_account_request.rb +0 -221
  257. data/lib/sendpost_ruby_sdk/models/create_webhook_request.rb +0 -361
  258. data/lib/sendpost_ruby_sdk/models/delete_suppression200_response_inner.rb +0 -231
  259. data/lib/sendpost_ruby_sdk/models/domain_dkim.rb +0 -239
  260. data/lib/sendpost_ruby_sdk/models/domain_dmarc.rb +0 -239
  261. data/lib/sendpost_ruby_sdk/models/domain_gpt.rb +0 -239
  262. data/lib/sendpost_ruby_sdk/models/domain_return_path.rb +0 -239
  263. data/lib/sendpost_ruby_sdk/models/domain_spf.rb +0 -239
  264. data/lib/sendpost_ruby_sdk/models/domain_track.rb +0 -239
  265. data/lib/sendpost_ruby_sdk/models/email_message_from.rb +0 -229
  266. data/lib/sendpost_ruby_sdk/models/email_message_reply_to.rb +0 -229
  267. data/lib/sendpost_ruby_sdk/models/email_message_to_inner.rb +0 -262
  268. data/lib/sendpost_ruby_sdk/models/email_message_to_inner_bcc_inner.rb +0 -240
  269. data/lib/sendpost_ruby_sdk/models/email_message_to_inner_cc_inner.rb +0 -240
  270. data/lib/sendpost_ruby_sdk/models/email_stats.rb +0 -230
  271. data/lib/sendpost_ruby_sdk/models/email_stats_stats.rb +0 -321
  272. data/lib/sendpost_ruby_sdk/models/message_header_to.rb +0 -268
  273. data/lib/sendpost_ruby_sdk/models/message_to.rb +0 -268
  274. data/lib/sendpost_ruby_sdk/models/operating_system.rb +0 -256
  275. data/lib/sendpost_ruby_sdk/models/person.rb +0 -231
  276. data/lib/sendpost_ruby_sdk/models/stat_stat.rb +0 -322
  277. data/lib/sendpost_ruby_sdk/models/stat_stats.rb +0 -321
  278. data/lib/sendpost_ruby_sdk/models/third_party_sending_provider.rb +0 -310
  279. data/spec/api/domain_api_spec.rb +0 -85
  280. data/spec/api/email_api_spec.rb +0 -59
  281. data/spec/api/ip_api_spec.rb +0 -98
  282. data/spec/api/ip_pools_api_spec.rb +0 -98
  283. data/spec/api/message_api_spec.rb +0 -47
  284. data/spec/api/stats_a_api_spec.rb +0 -89
  285. data/spec/api/stats_api_spec.rb +0 -78
  286. data/spec/api/sub_account_api_spec.rb +0 -98
  287. data/spec/api/suppression_api_spec.rb +0 -76
  288. data/spec/api/webhook_api_spec.rb +0 -98
  289. data/spec/models/account_stats_spec.rb +0 -42
  290. data/spec/models/account_stats_stat_spec.rb +0 -96
  291. data/spec/models/aggregate_stat_spec.rb +0 -96
  292. data/spec/models/aggregate_stats_spec.rb +0 -96
  293. data/spec/models/aggregated_email_stats_spec.rb +0 -96
  294. data/spec/models/attachment_spec.rb +0 -42
  295. data/spec/models/auto_warmup_plan_spec.rb +0 -222
  296. data/spec/models/copy_to_spec.rb +0 -48
  297. data/spec/models/create_domain_request_spec.rb +0 -36
  298. data/spec/models/create_sub_account_request_spec.rb +0 -36
  299. data/spec/models/create_suppression_request_hard_bounce_inner_spec.rb +0 -36
  300. data/spec/models/create_suppression_request_manual_inner_spec.rb +0 -36
  301. data/spec/models/create_suppression_request_spam_complaint_inner_spec.rb +0 -36
  302. data/spec/models/create_suppression_request_spec.rb +0 -54
  303. data/spec/models/create_suppression_request_unsubscribe_inner_spec.rb +0 -36
  304. data/spec/models/create_webhook_request_spec.rb +0 -120
  305. data/spec/models/delete_response_spec.rb +0 -42
  306. data/spec/models/delete_sub_account_response_spec.rb +0 -42
  307. data/spec/models/delete_suppression200_response_inner_spec.rb +0 -42
  308. data/spec/models/delete_suppression_request_spec.rb +0 -36
  309. data/spec/models/delete_webhook_response_spec.rb +0 -42
  310. data/spec/models/device_spec.rb +0 -36
  311. data/spec/models/domain_dkim_spec.rb +0 -48
  312. data/spec/models/domain_dmarc_spec.rb +0 -48
  313. data/spec/models/domain_gpt_spec.rb +0 -48
  314. data/spec/models/domain_return_path_spec.rb +0 -48
  315. data/spec/models/domain_spec.rb +0 -150
  316. data/spec/models/domain_spf_spec.rb +0 -48
  317. data/spec/models/domain_track_spec.rb +0 -48
  318. data/spec/models/eip_spec.rb +0 -36
  319. data/spec/models/email_address_spec.rb +0 -42
  320. data/spec/models/email_message_from_spec.rb +0 -42
  321. data/spec/models/email_message_object_spec.rb +0 -120
  322. data/spec/models/email_message_reply_to_spec.rb +0 -42
  323. data/spec/models/email_message_spec.rb +0 -138
  324. data/spec/models/email_message_to_inner_bcc_inner_spec.rb +0 -48
  325. data/spec/models/email_message_to_inner_cc_inner_spec.rb +0 -48
  326. data/spec/models/email_message_to_inner_spec.rb +0 -60
  327. data/spec/models/email_message_with_template_spec.rb +0 -138
  328. data/spec/models/email_response_spec.rb +0 -60
  329. data/spec/models/email_stats_spec.rb +0 -42
  330. data/spec/models/email_stats_stats_spec.rb +0 -96
  331. data/spec/models/event_metadata_spec.rb +0 -84
  332. data/spec/models/event_spec.rb +0 -150
  333. data/spec/models/geo_location_spec.rb +0 -60
  334. data/spec/models/ip_allocation_request_spec.rb +0 -42
  335. data/spec/models/ip_deletion_response_spec.rb +0 -42
  336. data/spec/models/ip_pool_create_request_spec.rb +0 -66
  337. data/spec/models/ip_pool_delete_response_spec.rb +0 -42
  338. data/spec/models/ip_pool_spec.rb +0 -108
  339. data/spec/models/ip_pool_update_request_spec.rb +0 -54
  340. data/spec/models/ip_spec.rb +0 -168
  341. data/spec/models/ip_update_request_spec.rb +0 -36
  342. data/spec/models/label_spec.rb +0 -48
  343. data/spec/models/member_spec.rb +0 -102
  344. data/spec/models/message_header_to_spec.rb +0 -60
  345. data/spec/models/message_spec.rb +0 -210
  346. data/spec/models/message_to_spec.rb +0 -60
  347. data/spec/models/operating_system_spec.rb +0 -60
  348. data/spec/models/person_spec.rb +0 -42
  349. data/spec/models/recipient_spec.rb +0 -60
  350. data/spec/models/smtp_auth_spec.rb +0 -60
  351. data/spec/models/stat_spec.rb +0 -42
  352. data/spec/models/stat_stat_spec.rb +0 -96
  353. data/spec/models/stat_stats_spec.rb +0 -96
  354. data/spec/models/sub_account_spec.rb +0 -130
  355. data/spec/models/suppression_spec.rb +0 -60
  356. data/spec/models/third_party_sending_provider_spec.rb +0 -96
  357. data/spec/models/update_sub_account_spec.rb +0 -36
  358. data/spec/models/update_webhook_spec.rb +0 -120
  359. data/spec/models/user_agent_spec.rb +0 -54
  360. data/spec/models/webhook_spec.rb +0 -144
data/README.md CHANGED
@@ -1,671 +1,752 @@
1
- # SendPost Ruby SDK
1
+ # sendpost_ruby_sdk
2
2
 
3
- A Ruby gem for sending emails and managing your SendPost account programmatically.
3
+ Sendpost - the Ruby gem for the SendPost API
4
4
 
5
- ## What is SendPost?
5
+ # Introduction
6
6
 
7
- SendPost is an email delivery service that helps you send transactional and marketing emails reliably. With SendPost, you can:
7
+ > ### 📌 API versioning & the v1 response contract
8
+ >
9
+ > This reference documents the **v1 response contract** — the stable, camelCase
10
+ > response shape that SendPost commits to. This is the shape you should build against.
11
+ >
12
+ > **During the current deprecation window**, requests authenticated with an account
13
+ > or sub-account API key receive the **legacy** response shape by default, so existing
14
+ > integrations keep working unchanged. To receive the documented v1 shape today, send:
15
+ >
16
+ > ```
17
+ > X-SendPost-Public-Contract: v1
18
+ > ```
19
+ >
20
+ > **How to tell which shape you got.** Every public response echoes the applied
21
+ > contract in the `X-SendPost-Public-Contract` response header. While the legacy
22
+ > shape is being served, responses also carry standard deprecation signals:
23
+ > `Deprecation: true`, a `Sunset` header with the exact cut-over date, and a
24
+ > `Link: <...>; rel=\"deprecation\"` header pointing at the migration guide. **Read the
25
+ > `Sunset` header for the authoritative end date** rather than hardcoding one.
26
+ >
27
+ > **After the sunset date**, v1 becomes the default and the legacy shape is no longer
28
+ > served. New integrations should send `X-SendPost-Public-Contract: v1` now and rely on
29
+ > the shapes in this reference.
8
30
 
9
- - Send personalized emails to multiple recipients
10
- - Track email opens and link clicks
11
- - Monitor email statistics (deliveries, bounces, spam complaints)
12
- - Manage multiple sending domains and IP addresses
13
- - Set up webhooks to receive real-time email event notifications
31
+ SendPost provides email API and SMTP relay which can be used not just to send & measure but also alert & optimised email sending.
14
32
 
15
- ## Installation
33
+ You can use SendPost to:
16
34
 
17
- ### Install from RubyGems (Recommended)
35
+ * Send personalised emails to multiple recipients using email API
18
36
 
19
- ```bash
20
- gem install sendpost_ruby_sdk
21
- ```
37
+ * Track opens and clicks
22
38
 
23
- ### Install from Source
39
+ * Analyse statistics around open, clicks, bounce, unsubscribe and spam
24
40
 
25
- If you're installing from the source code:
26
41
 
27
- ```bash
28
- gem build sendpost_ruby_sdk.gemspec
29
- gem install ./sendpost_ruby_sdk-2.0.0.gem
30
- ```
42
+ At and advanced level you can use it to:
31
43
 
32
- ### Add to Your Gemfile
44
+ * Manage multiple sub-accounts which may map to your promotional or transactional sending, multiple product lines or multiple customers
33
45
 
34
- Add this line to your application's `Gemfile`:
46
+ * Classify your emails using groups for better analysis
35
47
 
36
- ```ruby
37
- gem 'sendpost_ruby_sdk', '~> 2.0.0'
38
- ```
48
+ * Analyse and fix email sending at sub-account level, IP Pool level or group level
39
49
 
40
- Then run:
50
+ * Have automated alerts to notify disruptions regarding email sending
41
51
 
42
- ```bash
43
- bundle install
44
- ```
52
+ * Manage different dedicated IP Pools so to better control your email sending
45
53
 
46
- ## Quick Start
54
+ * Automatically know when IP or domain is blacklisted or sender score is down
47
55
 
48
- ### 1. Get Your API Keys
56
+ * Leverage pro deliverability tools to get significantly better email deliverability & inboxing
49
57
 
50
- Before you can use the SDK, you need API keys from SendPost:
51
58
 
52
- 1. Sign up at [https://app.sendpost.io/register](https://app.sendpost.io/register)
53
- 2. Log in to your SendPost dashboard
54
- 3. Navigate to API Keys section
55
- 4. Copy your **Sub-Account API Key** (for sending emails)
56
- 5. Copy your **Account API Key** (for managing sub-accounts, IPs, etc.)
59
+ [<img src=\"https://run.pstmn.io/button.svg\" alt=\"Run In Postman\" style=\"width: 128px; height: 32px;\">](https://god.gw.postman.com/run-collection/33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D33476323-e6dbd27f-c4a7-4d49-bcac-94b0611b938b%26entityType%3Dcollection%26workspaceId%3D6b1e4f65-96a9-4136-9512-6266c852517e)
57
60
 
58
- ### 2. Configure the SDK
61
+ # Overview
59
62
 
60
- ```ruby
61
- require 'sendpost_ruby_sdk'
63
+ ## REST API
62
64
 
63
- # Create configuration
64
- config = Sendpost::Configuration.new
65
- config.host = 'https://api.sendpost.io/api/v1'
65
+ SendPost API is built on REST API principles. Authenticated users can interact with any of the API endpoints to perform:
66
66
 
67
- # Set your Sub-Account API Key (for sending emails)
68
- config.api_key['X-SubAccount-ApiKey'] = 'your_sub_account_api_key_here'
69
- ```
67
+ * **GET**- to get a resource
70
68
 
71
- ### 3. Send Your First Email
69
+ * **POST** - to create a resource
72
70
 
73
- ```ruby
74
- # Create API client
75
- api_client = Sendpost::ApiClient.new(config)
76
- email_api = Sendpost::EmailApi.new(api_client)
77
-
78
- # Create email message
79
- email_message = Sendpost::EmailMessageObject.new
80
-
81
- # Set sender
82
- from_addr = Sendpost::EmailMessageFrom.new
83
- from_addr.email = 'sender@yourdomain.com'
84
- from_addr.name = 'Your Name'
85
- email_message.from = from_addr
86
-
87
- # Set recipient
88
- recipient = Sendpost::EmailMessageToInner.new
89
- recipient.email = 'recipient@example.com'
90
- recipient.name = 'Recipient Name'
91
- email_message.to = [recipient]
92
-
93
- # Set email content
94
- email_message.subject = 'Hello from SendPost!'
95
- email_message.html_body = '<h1>Welcome!</h1><p>This is your first email sent with SendPost Ruby SDK.</p>'
96
- email_message.text_body = 'Welcome! This is your first email sent with SendPost Ruby SDK.'
97
-
98
- # Enable tracking
99
- email_message.track_opens = true
100
- email_message.track_clicks = true
101
-
102
- # Send the email
103
- begin
104
- responses = email_api.send_email(email_message)
105
- if responses && !responses.empty?
106
- puts "Email sent successfully! Message ID: #{responses[0].message_id}"
107
- end
108
- rescue Sendpost::ApiError => e
109
- puts "Error sending email: #{e.code} - #{e.response_body}"
110
- end
111
- ```
71
+ * **PUT** - to update an existing resource
112
72
 
113
- ## Detailed Usage Guide
73
+ * **DELETE** - to delete a resource
114
74
 
115
- ### Understanding API Keys
116
75
 
117
- SendPost uses two types of API keys:
76
+ The API endpoint for all API calls is:
77
+ <code>https://api.sendpost.io/api/v1</code>
118
78
 
119
- **Sub-Account API Key (`X-SubAccount-ApiKey`)**
120
- - Used for: Sending emails, managing domains, viewing sub-account statistics
121
- - Where to find: SendPost Dashboard → Sub-Accounts → API Keys
122
79
 
123
- **Account API Key (`X-Account-ApiKey`)**
124
- - Used for: Creating sub-accounts, managing IPs, creating webhooks, account-level statistics
125
- - Where to find: SendPost Dashboard → Account Settings → API Keys
80
+ Some conventions that have been followed in the API design overall are following:
126
81
 
127
- ### Sending Emails
128
82
 
129
- #### Basic Email
83
+ * All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header.
130
84
 
131
- ```ruby
132
- require 'sendpost_ruby_sdk'
85
+ * All resource endpoints end with singular name and not plural. So we have <code>domain</code> instead of domains for domain resource endpoint. Likewise we have <code>sender</code> instead of senders for sender resource endpoint.
133
86
 
134
- # Setup
135
- config = Sendpost::Configuration.new
136
- config.host = 'https://api.sendpost.io/api/v1'
137
- config.api_key['X-SubAccount-ApiKey'] = 'your_sub_account_api_key'
138
-
139
- api_client = Sendpost::ApiClient.new(config)
140
- email_api = Sendpost::EmailApi.new(api_client)
141
-
142
- # Create message
143
- email_message = Sendpost::EmailMessageObject.new
144
-
145
- # From address
146
- from = Sendpost::EmailMessageFrom.new
147
- from.email = 'noreply@yourdomain.com'
148
- from.name = 'Your Company'
149
- email_message.from = from
150
-
151
- # To address
152
- to = Sendpost::EmailMessageToInner.new
153
- to.email = 'customer@example.com'
154
- to.name = 'Customer Name'
155
- email_message.to = [to]
156
-
157
- # Email content
158
- email_message.subject = 'Order Confirmation'
159
- email_message.html_body = '<h1>Thank you for your order!</h1>'
160
- email_message.text_body = 'Thank you for your order!'
161
-
162
- # Send
163
- responses = email_api.send_email(email_message)
164
- puts "Sent! Message ID: #{responses[0].message_id}"
165
- ```
87
+ * Body submitted for POST / PUT API calls as well as JSON response from SendPost API follow camelcase convention
166
88
 
167
- #### Email with Multiple Recipients
89
+ * All timestamps returned in response (created or submittedAt response fields) are UNIX nano epoch timestamp.
168
90
 
169
- ```ruby
170
- # Create multiple recipients
171
- recipient1 = Sendpost::EmailMessageToInner.new
172
- recipient1.email = 'user1@example.com'
173
- recipient1.name = 'User One'
174
-
175
- recipient2 = Sendpost::EmailMessageToInner.new
176
- recipient2.email = 'user2@example.com'
177
- recipient2.name = 'User Two'
178
-
179
- # Add CC recipients
180
- cc_recipient = Sendpost::EmailMessageToInnerCcInner.new
181
- cc_recipient.email = 'cc@example.com'
182
- recipient1.cc = [cc_recipient]
183
-
184
- # Add BCC recipients
185
- bcc_recipient = Sendpost::EmailMessageToInnerBccInner.new
186
- bcc_recipient.email = 'bcc@example.com'
187
- recipient1.bcc = [bcc_recipient]
188
-
189
- # Set all recipients
190
- email_message.to = [recipient1, recipient2]
191
- ```
192
91
 
193
- #### Email with Attachments
92
+ <aside class=\"success\">
93
+ All resources have either <code>/api/v1/subaccount</code> or <code>/api/v1/account</code> in their API call resource path based on who is authorised for the resource. All API calls with path <code>/api/v1/subaccount</code> use <code>X-SubAccount-ApiKey</code> in their request header. Likewise all API calls with path <code>/api/v1/account</code> use <code>X-Account-ApiKey</code> in their request header.
94
+ </aside>
194
95
 
195
- ```ruby
196
- # Create attachment
197
- attachment = Sendpost::Attachment.new
198
- attachment.name = 'invoice.pdf'
199
- attachment.content = Base64.encode64(File.read('path/to/invoice.pdf'))
200
- attachment.content_type = 'application/pdf'
201
96
 
202
- email_message.attachments = [attachment]
203
- ```
97
+ SendPost uses conventional HTTP response codes to indicate the success or failure of an API request.
204
98
 
205
- #### Email with Custom Fields and Headers
206
99
 
207
- ```ruby
208
- # Add custom fields to recipient (for personalization)
209
- recipient = Sendpost::EmailMessageToInner.new
210
- recipient.email = 'customer@example.com'
211
- recipient.custom_fields = {
212
- 'customer_id' => '12345',
213
- 'order_number' => 'ORD-67890',
214
- 'total_amount' => '99.99'
215
- }
100
+ * Codes in the <code>2xx</code> range indicate success.
216
101
 
217
- # Add custom headers
218
- email_message.headers = {
219
- 'X-Order-ID' => '12345',
220
- 'X-Email-Type' => 'transactional'
221
- }
102
+ * Codes in the <code>4xx</code> range indicate an error owing due to unauthorize access, incorrect request parameters or body etc.
222
103
 
223
- # Add groups for analytics
224
- email_message.groups = ['transactional', 'order-confirmation']
225
- ```
104
+ * Code in the <code>5xx</code> range indicate an eror with SendPost's servers ( internal service issue or maintenance )
226
105
 
227
- #### Email with Reply-To
228
106
 
229
- ```ruby
230
- reply_to = Sendpost::EmailMessageReplyTo.new
231
- reply_to.email = 'support@yourdomain.com'
232
- reply_to.name = 'Support Team'
233
- email_message.reply_to = reply_to
234
- ```
107
+ <aside class=\"info\">
108
+ SendPost all responses return <code>created</code> in UNIX nano epoch timestamp.
109
+ </aside>
235
110
 
236
- ### Managing Domains
237
111
 
238
- Before sending emails, you need to add and verify your sending domain.
112
+ ## Authentication
239
113
 
240
- #### Add a Domain
114
+ SendPost uses API keys for authentication. You can register a new SendPost API key at our [developer portal](https://app.sendpost.io/register).
241
115
 
242
- ```ruby
243
- # Use Sub-Account API Key
244
- config = Sendpost::Configuration.new
245
- config.host = 'https://api.sendpost.io/api/v1'
246
- config.api_key['X-SubAccount-ApiKey'] = 'your_sub_account_api_key'
247
116
 
248
- api_client = Sendpost::ApiClient.new(config)
249
- domain_api = Sendpost::DomainApi.new(api_client)
117
+ SendPost expects the API key to be included in all API requests to the server in a header that looks like the following:
250
118
 
251
- # Create domain request
252
- domain_request = Sendpost::CreateDomainRequest.new
253
- domain_request.name = 'yourdomain.com'
254
119
 
255
- # Add domain
256
- domain = domain_api.subaccount_domain_post(domain_request)
120
+ `X-SubAccount-ApiKey: AHEZEP8192SEGH`
257
121
 
258
- puts "Domain added! ID: #{domain.id}"
259
- puts "DKIM Record: #{domain.dkim.text_value}" if domain.dkim
260
122
 
261
- # IMPORTANT: Add the DNS records shown to your domain's DNS settings
262
- ```
123
+ This API key is used for all Sub-Account level operations such as:
263
124
 
264
- #### List All Domains
125
+ * Sending emails
265
126
 
266
- ```ruby
267
- domains = domain_api.get_all_domains
127
+ * Retrieving stats regarding open, click, bounce, unsubscribe and spam
268
128
 
269
- domains.each do |domain|
270
- puts "Domain: #{domain.name}"
271
- puts "Verified: #{domain.verified ? 'Yes' : 'No'}"
272
- puts "---"
273
- end
274
- ```
129
+ * Uploading suppressions list
275
130
 
276
- #### Get Domain Details
131
+ * Verifying sending domains
132
+ and more
277
133
 
278
- ```ruby
279
- domain_id = 'your_domain_id'
280
- domain = domain_api.subaccount_domain_domain_id_get(domain_id)
134
+ In addition to <code>X-SubAccount-ApiKey</code> you also have another API Key <code>X-Account-APIKey</code> which is used for Account level operations such as :
281
135
 
282
- puts "Domain: #{domain.name}"
283
- puts "Verified: #{domain.verified}"
284
- puts "DKIM: #{domain.dkim.text_value}" if domain.dkim
285
- ```
136
+ * Creating and managing sub-accounts
286
137
 
287
- ### Viewing Statistics
138
+ * Allocating IPs for your account
288
139
 
289
- #### Get Sub-Account Statistics
140
+ * Getting overall billing and usage information
290
141
 
291
- ```ruby
292
- require 'date'
142
+ * Email List validation
293
143
 
294
- # Use Account API Key for statistics
295
- config = Sendpost::Configuration.new
296
- config.host = 'https://api.sendpost.io/api/v1'
297
- config.api_key['X-Account-ApiKey'] = 'your_account_api_key'
144
+ * Creating and managing alerts
145
+ and more
298
146
 
299
- api_client = Sendpost::ApiClient.new(config)
300
- stats_api = Sendpost::StatsApi.new(api_client)
301
147
 
302
- # Get stats for last 7 days
303
- sub_account_id = 'your_sub_account_id'
304
- to_date = Date.today
305
- from_date = to_date - 7
148
+ <aside class=\"notice\">
149
+ You must look at individual API reference page to look at whether <code>X-SubAccount-ApiKey</code> is required or <code>X-Account-ApiKey</code>
150
+ </aside>
306
151
 
307
- stats = stats_api.account_subaccount_stat_subaccount_id_get(
308
- from_date,
309
- to_date,
310
- sub_account_id
311
- )
312
152
 
313
- stats.each do |stat|
314
- puts "Date: #{stat.date}"
315
- if stat.stats
316
- puts " Processed: #{stat.stats.processed || 0}"
317
- puts " Delivered: #{stat.stats.delivered || 0}"
318
- puts " Opened: #{stat.stats.opened || 0}"
319
- puts " Clicked: #{stat.stats.clicked || 0}"
320
- puts " Bounced: #{stat.stats.hard_bounced || 0}"
321
- puts " Spam: #{stat.stats.spam || 0}"
322
- end
323
- puts "---"
324
- end
325
- ```
153
+ In case an incorrect API Key header is specified or if it is missed you will get HTTP Response 401 ( Unauthorized ) response from SendPost.
326
154
 
327
- #### Get Aggregate Statistics
328
155
 
329
- ```ruby
330
- # Get overall stats for a sub-account
331
- aggregate_stat = stats_api.account_subaccount_stat_subaccount_id_aggregate_get(
332
- from_date,
333
- to_date,
334
- sub_account_id
335
- )
156
+ ## HTTP Response Headers
336
157
 
337
- puts "Total Processed: #{aggregate_stat.processed || 0}"
338
- puts "Total Delivered: #{aggregate_stat.delivered || 0}"
339
- puts "Total Opened: #{aggregate_stat.opened || 0}"
340
- puts "Total Clicked: #{aggregate_stat.clicked || 0}"
341
- ```
342
158
 
343
- #### Get Account-Level Statistics
159
+ Code | Reason | Details
160
+ ---------------| -----------------------| -----------
161
+ 200 | Success | Everything went well
162
+ 401 | Unauthorized | Incorrect or missing API header either <code>X-SubAccount-ApiKey</code> or <code>X-Account-ApiKey</code>
163
+ 403 | Forbidden | Typically sent when resource with same name or details already exist
164
+ 406 | Missing resource id | Resource id specified is either missing or doesn't exist
165
+ 422 | Unprocessable entity | Request body is not in proper format
166
+ 500 | Internal server error | Some error happened at SendPost while processing API request
167
+ 503 | Service Unavailable | SendPost is offline for maintenance. Please try again later
344
168
 
345
- ```ruby
346
- # Use StatsAApi for account-level stats
347
- stats_a_api = Sendpost::StatsAApi.new(api_client)
169
+ # API SDKs
348
170
 
349
- account_stats = stats_a_api.get_all_account_stats(from_date, to_date)
171
+ We have native SendPost SDKs in the following programming languages. You can integrate with them or create your own SDK with our API specification. In case you need any assistance with respect to API then do reachout to our team from website chat or email us at **hello@sendpost.io**
350
172
 
351
- account_stats.each do |stat|
352
- puts "Date: #{stat.date}"
353
- if stat.stat
354
- puts " Processed: #{stat.stat.processed || 0}"
355
- puts " Delivered: #{stat.stat.delivered || 0}"
356
- end
357
- end
358
- ```
359
173
 
360
- ### Managing Sub-Accounts
174
+ * [PHP](https://github.com/sendpost/sendpost_php_sdk)
361
175
 
362
- #### List All Sub-Accounts
176
+ * [Javascript](https://github.com/sendpost/sendpost_javascript_sdk)
363
177
 
364
- ```ruby
365
- # Use Account API Key
366
- config = Sendpost::Configuration.new
367
- config.host = 'https://api.sendpost.io/api/v1'
368
- config.api_key['X-Account-ApiKey'] = 'your_account_api_key'
178
+ * [Ruby](https://github.com/sendpost/sendpost_ruby_sdk)
369
179
 
370
- api_client = Sendpost::ApiClient.new(config)
371
- sub_account_api = Sendpost::SubAccountApi.new(api_client)
180
+ * [Python](https://github.com/sendpost/sendpost_python_sdk)
372
181
 
373
- sub_accounts = sub_account_api.get_all_sub_accounts
182
+ * [Golang](https://github.com/sendpost/sendpost_go_sdk)
374
183
 
375
- sub_accounts.each do |sub_account|
376
- puts "ID: #{sub_account.id}"
377
- puts "Name: #{sub_account.name}"
378
- puts "API Key: #{sub_account.api_key}"
379
- puts "---"
380
- end
381
- ```
382
184
 
383
- #### Create a Sub-Account
185
+ # API Reference
384
186
 
385
- ```ruby
386
- new_sub_account = Sendpost::CreateSubAccountRequest.new
387
- new_sub_account.name = "Client Account - #{Time.now.to_i}"
187
+ SendX REST API can be broken down into two major sub-sections:
388
188
 
389
- sub_account = sub_account_api.create_sub_account(new_sub_account)
390
189
 
391
- puts "Created! ID: #{sub_account.id}"
392
- puts "API Key: #{sub_account.api_key}"
393
- ```
190
+ * Sub-Account
394
191
 
395
- #### Get Sub-Account Details
192
+ * Account
396
193
 
397
- ```ruby
398
- sub_account_id = 'your_sub_account_id'
399
- sub_account = sub_account_api.get_sub_account(sub_account_id)
400
194
 
401
- puts "Name: #{sub_account.name}"
402
- puts "Type: #{sub_account.type}"
403
- puts "Blocked: #{sub_account.blocked}"
404
- ```
195
+ Sub-Account API operations enable common email sending API use-cases like sending bulk email, adding new domains or senders for email sending programmatically, retrieving stats, adding suppressions etc. All Sub-Account API operations need to pass <code>X-SubAccount-ApiKey</code> header with every API call.
405
196
 
406
- ### Managing Webhooks
407
197
 
408
- Webhooks allow you to receive real-time notifications when email events occur.
198
+ The Account API operations allow users to manage multiple sub-accounts and manage IPs. A single parent SendPost account can have 100's of sub-accounts. You may want to create sub-accounts for different products your company is running or to segregate types of emails or for managing email sending across multiple customers of yours.
409
199
 
410
- #### Create a Webhook
411
200
 
412
- ```ruby
413
- # Use Account API Key
414
- config = Sendpost::Configuration.new
415
- config.host = 'https://api.sendpost.io/api/v1'
416
- config.api_key['X-Account-ApiKey'] = 'your_account_api_key'
417
-
418
- api_client = Sendpost::ApiClient.new(config)
419
- webhook_api = Sendpost::WebhookApi.new(api_client)
420
-
421
- # Create webhook request
422
- webhook_request = Sendpost::CreateWebhookRequest.new
423
- webhook_request.url = 'https://your-app.com/webhooks/sendpost'
424
- webhook_request.enabled = true
425
-
426
- # Configure which events to receive
427
- webhook_request.processed = true # Email processed
428
- webhook_request.delivered = true # Email delivered
429
- webhook_request.dropped = true # Email dropped
430
- webhook_request.soft_bounced = true # Soft bounce
431
- webhook_request.hard_bounced = true # Hard bounce
432
- webhook_request.opened = true # Email opened
433
- webhook_request.clicked = true # Link clicked
434
- webhook_request.unsubscribed = true # Unsubscribed
435
- webhook_request.spam = true # Marked as spam
436
-
437
- webhook = webhook_api.create_webhook(webhook_request)
438
-
439
- puts "Webhook created! ID: #{webhook.id}"
440
- ```
201
+ # SMTP Reference
441
202
 
442
- #### List All Webhooks
203
+ Simple Mail Transfer Protocol (SMTP) is a quick and easy way to send email from one server to another. SendPost provides an SMTP service that allows you to deliver your email via our servers instead of your own client or server.
204
+ This means you can count on SendPost's delivery at scale for your SMTP needs.
443
205
 
444
- ```ruby
445
- webhooks = webhook_api.get_all_webhooks
446
206
 
447
- webhooks.each do |webhook|
448
- puts "ID: #{webhook.id}"
449
- puts "URL: #{webhook.url}"
450
- puts "Enabled: #{webhook.enabled}"
451
- puts "---"
452
- end
453
- ```
207
+ ## Integrating SMTP
454
208
 
455
- ### Retrieving Message Details
456
209
 
457
- ```ruby
458
- # Use Account API Key
459
- config = Sendpost::Configuration.new
460
- config.host = 'https://api.sendpost.io/api/v1'
461
- config.api_key['X-Account-ApiKey'] = 'your_account_api_key'
462
-
463
- api_client = Sendpost::ApiClient.new(config)
464
- message_api = Sendpost::MessageApi.new(api_client)
465
-
466
- # Get message by ID (from email send response)
467
- message_id = 'your_message_id'
468
- message = message_api.get_message_by_id(message_id)
469
-
470
- puts "Message ID: #{message.message_id}"
471
- puts "From: #{message.from.email}" if message.from
472
- puts "To: #{message.to.email}" if message.to
473
- puts "Subject: #{message.subject}"
474
- puts "Submitted At: #{message.submitted_at}"
475
- puts "IP Used: #{message.public_ip}"
210
+ 1. Get the SMTP `username` and `password` from your SendPost account.
211
+
212
+ 2. Set the server host in your email client or application to `smtp.sendpost.io`. This setting is sometimes referred to as the external SMTP server or the SMTP relay.
213
+
214
+ 3. Set the `username` and `password`.
215
+
216
+ 4. Set the port to `587` (or as specified below).
217
+
218
+ ## SMTP Ports
219
+
220
+
221
+ - For an unencrypted or a TLS connection, use port `25`, `2525` or `587`.
222
+
223
+ - For a SSL connection, use port `465`
224
+
225
+ - Check your firewall and network to ensure they're not blocking any of our SMTP Endpoints.
226
+
227
+
228
+ SendPost supports STARTTLS for establishing a TLS-encrypted connection. STARTTLS is a means of upgrading an unencrypted connection to an encrypted connection. There are versions of STARTTLS for a variety of protocols; the SMTP version is defined in [RFC 3207](https://www.ietf.org/rfc/rfc3207.txt).
229
+
230
+
231
+ To set up a STARTTLS connection, the SMTP client connects to the SendPost SMTP endpoint `smtp.sendpost.io` on port 25, 587, or 2525, issues an EHLO command, and waits for the server to announce that it supports the STARTTLS SMTP extension. The client then issues the STARTTLS command, initiating TLS negotiation. When negotiation is complete, the client issues an EHLO command over the new encrypted connection, and the SMTP session proceeds normally.
232
+
233
+
234
+ <aside class=\"success\">
235
+ If you are unsure which port to use, a TLS connection on port 587 is typically recommended.
236
+ </aside>
237
+
238
+
239
+ ## Sending email from your application
240
+
241
+
242
+ ```javascript
243
+ \"use strict\";
244
+
245
+ const nodemailer = require(\"nodemailer\");
246
+
247
+ async function main() {
248
+ // create reusable transporter object using the default SMTP transport
249
+ let transporter = nodemailer.createTransport({
250
+ host: \"smtp.sendpost.io\",
251
+ port: 587,
252
+ secure: false, // true for 465, false for other ports
253
+ auth: {
254
+ user: \"<username>\" , // generated ethereal user
255
+ pass: \"<password>\", // generated ethereal password
256
+ },
257
+ requireTLS: true,
258
+ debug: true,
259
+ logger: true,
260
+ });
261
+
262
+ // send mail with defined transport object
263
+ try {
264
+ let info = await transporter.sendMail({
265
+ from: 'erlich@piedpiper.com',
266
+ to: 'gilfoyle@piedpiper.com',
267
+ subject: 'Test Email Subject',
268
+ html: '<h1>Hello Geeks!!!</h1>',
269
+ });
270
+ console.log(\"Message sent: %s\", info.messageId);
271
+ } catch (e) {
272
+ console.log(e)
273
+ }
274
+ }
275
+
276
+ main().catch(console.error);
476
277
  ```
477
278
 
478
- ### Managing Suppressions
279
+ For PHP
479
280
 
480
- Suppressions are email addresses that should not receive emails (unsubscribed, bounced, etc.).
481
281
 
482
- #### Add Suppressions
282
+ ```php
283
+ <?php
284
+ // Import PHPMailer classes into the global namespace
285
+ use PHPMailer\\PHPMailer\\PHPMailer;
286
+ use PHPMailer\\PHPMailer\\SMTP;
287
+ use PHPMailer\\PHPMailer\\Exception;
483
288
 
484
- ```ruby
485
- # Use Sub-Account API Key
486
- config = Sendpost::Configuration.new
487
- config.host = 'https://api.sendpost.io/api/v1'
488
- config.api_key['X-SubAccount-ApiKey'] = 'your_sub_account_api_key'
489
-
490
- api_client = Sendpost::ApiClient.new(config)
491
- suppression_api = Sendpost::SuppressionApi.new(api_client)
492
-
493
- # Create suppression request
494
- suppression_request = Sendpost::CreateSuppressionRequest.new
495
-
496
- # Add hard bounces
497
- hard_bounce = Sendpost::CreateSuppressionRequestHardBounceInner.new
498
- hard_bounce.email = 'bounced@example.com'
499
- suppression_request.hard_bounce = [hard_bounce]
500
-
501
- # Add unsubscribes
502
- unsubscribe = Sendpost::CreateSuppressionRequestUnsubscribeInner.new
503
- unsubscribe.email = 'unsubscribed@example.com'
504
- suppression_request.unsubscribe = [unsubscribe]
505
-
506
- # Add spam complaints
507
- spam = Sendpost::CreateSuppressionRequestSpamComplaintInner.new
508
- spam.email = 'spam@example.com'
509
- suppression_request.spam_complaint = [spam]
510
-
511
- # Add manual suppressions
512
- manual = Sendpost::CreateSuppressionRequestManualInner.new
513
- manual.email = 'manual@example.com'
514
- suppression_request.manual = [manual]
515
-
516
- suppression_api.create_suppression(suppression_request)
517
- puts "Suppressions added successfully"
289
+ // Load Composer's autoloader
290
+ require 'vendor/autoload.php';
291
+
292
+ $mail = new PHPMailer(true);
293
+
294
+ // Settings
295
+ try {
296
+ $mail->SMTPDebug = SMTP::DEBUG_CONNECTION; // Enable verbose debug output
297
+ $mail->isSMTP(); // Send using SMTP
298
+ $mail->Host = 'smtp.sendpost.io'; // Set the SMTP server to send through
299
+ $mail->SMTPAuth = true; // Enable SMTP authentication
300
+ $mail->Username = '<username>'; // SMTP username
301
+ $mail->Password = '<password>'; // SMTP password
302
+ $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable implicit TLS encryption
303
+ $mail->Port = 587; // TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
304
+
305
+ //Recipients
306
+ $mail->setFrom('erlich@piedpiper.com', 'Erlich');
307
+ $mail->addAddress('gilfoyle@piedpiper.com', 'Gilfoyle');
308
+
309
+ //Content
310
+ $mail->isHTML(true); //Set email format to HTML
311
+ $mail->Subject = 'Here is the subject';
312
+ $mail->Body = 'This is the HTML message body <b>in bold!</b>';
313
+ $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
314
+
315
+ $mail->send();
316
+ echo 'Message has been sent';
317
+
318
+ } catch (Exception $e) {
319
+ echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\";
320
+ }
321
+ ```
322
+ For Python
323
+ ```python
324
+ #!/usr/bin/python3
325
+
326
+ import sys
327
+ import os
328
+ import re
329
+
330
+ from smtplib import SMTP
331
+ import ssl
332
+
333
+ from email.mime.text import MIMEText
334
+
335
+ SMTPserver = 'smtp.sendpost.io'
336
+ PORT = 587
337
+ sender = 'erlich@piedpiper.com'
338
+ destination = ['gilfoyle@piedpiper.com']
339
+
340
+ USERNAME = \"<username>\"
341
+ PASSWORD = \"<password>\"
342
+
343
+ # typical values for text_subtype are plain, html, xml
344
+ text_subtype = 'plain'
345
+
346
+ content=\"\"\"\\
347
+ Test message
348
+ \"\"\"
349
+
350
+ subject=\"Sent from Python\"
351
+
352
+ try:
353
+ msg = MIMEText(content, text_subtype)
354
+ msg['Subject']= subject
355
+ msg['From'] = sender
356
+
357
+ conn = SMTP(SMTPserver, PORT)
358
+ conn.ehlo()
359
+ context = ssl.create_default_context()
360
+ conn.starttls(context=context) # upgrade to tls
361
+ conn.ehlo()
362
+ conn.set_debuglevel(True)
363
+ conn.login(USERNAME, PASSWORD)
364
+
365
+ try:
366
+ resp = conn.sendmail(sender, destination, msg.as_string())
367
+ print(\"Send Mail Response: \", resp)
368
+ except Exception as e:
369
+ print(\"Send Email Error: \", e)
370
+ finally:
371
+ conn.quit()
372
+
373
+ except Exception as e:
374
+ print(\"Error:\", e)
518
375
  ```
376
+ For Golang
377
+ ```go
378
+ package main
379
+
380
+ import (
381
+ \"fmt\"
382
+ \"net/smtp\"
383
+ \"os\"
384
+ )
519
385
 
520
- #### List Suppressions
386
+ // Sending Email Using Smtp in Golang
521
387
 
522
- ```ruby
523
- to_date = Date.today
524
- from_date = to_date - 7
388
+ func main() {
525
389
 
526
- suppressions = suppression_api.get_suppression_list(from_date, to_date)
390
+ username := \"<username>\"
391
+ password := \"<password>\"
392
+
393
+ from := \"erlich@piedpiper.com\"
394
+ toList := []string{\"gilfoyle@piedpiper.com\"}
395
+ host := \"smtp.sendpost.io\"
396
+ port := \"587\" // recommended
397
+
398
+ // This is the message to send in the mail
399
+ msg := \"Hello geeks!!!\"
400
+
401
+ // We can't send strings directly in mail,
402
+ // strings need to be converted into slice bytes
403
+ body := []byte(msg)
404
+
405
+ // PlainAuth uses the given username and password to
406
+ // authenticate to host and act as identity.
407
+ // Usually identity should be the empty string,
408
+ // to act as username.
409
+ auth := smtp.PlainAuth(\"\", username, password, host)
410
+
411
+ // SendMail uses TLS connection to send the mail
412
+ // The email is sent to all address in the toList,
413
+ // the body should be of type bytes, not strings
414
+ // This returns error if any occured.
415
+ err := smtp.SendMail(host+\":\"+port, auth, from, toList, body)
416
+
417
+ // handling the errors
418
+ if err != nil {
419
+ fmt.Println(err)
420
+ os.Exit(1)
421
+ }
422
+
423
+ fmt.Println(\"Successfully sent mail to all user in toList\")
424
+ }
527
425
 
528
- suppressions.each do |suppression|
529
- puts "Email: #{suppression.email}"
530
- puts "Type: #{suppression.type}"
531
- puts "---"
532
- end
533
426
  ```
427
+ For Java
428
+ ```java
429
+ // implementation 'com.sun.mail:javax.mail:1.6.2'
534
430
 
535
- ## Error Handling
431
+ import java.util.Properties;
536
432
 
537
- The SDK raises `Sendpost::ApiError` when API calls fail. Always wrap API calls in begin/rescue blocks:
433
+ import javax.mail.Message;
434
+ import javax.mail.Session;
435
+ import javax.mail.Transport;
436
+ import javax.mail.internet.InternetAddress;
437
+ import javax.mail.internet.MimeMessage;
538
438
 
539
- ```ruby
540
- begin
541
- responses = email_api.send_email(email_message)
542
- puts "Success!"
543
- rescue Sendpost::ApiError => e
544
- puts "API Error:"
545
- puts " Status Code: #{e.code}"
546
- puts " Response: #{e.response_body}"
547
-
548
- case e.code
549
- when 401
550
- puts " Issue: Invalid or missing API key"
551
- when 403
552
- puts " Issue: Resource already exists or insufficient permissions"
553
- when 404
554
- puts " Issue: Resource not found"
555
- when 422
556
- puts " Issue: Invalid request data"
557
- when 500
558
- puts " Issue: SendPost server error"
559
- end
560
- rescue StandardError => e
561
- puts "Unexpected error: #{e.message}"
562
- end
439
+ public class SMTPConnect {
440
+
441
+ // This address must be verified.
442
+ static final String FROM = \"erlich@piedpiper.com\";
443
+ static final String FROMNAME = \"Erlich Bachman\";
444
+
445
+ // Replace recipient@example.com with a \"To\" address. If your account
446
+ // is still in the sandbox, this address must be verified.
447
+ static final String TO = \"gilfoyle@piedpiper.com\";
448
+
449
+ // Replace smtp_username with your SendPost SMTP user name.
450
+ static final String SMTP_USERNAME = \"<username>\";
451
+
452
+ // Replace smtp_password with your SendPost SMTP password.
453
+ static final String SMTP_PASSWORD = \"<password>\";
454
+
455
+ // SMTP Host Name
456
+ static final String HOST = \"smtp.sendpost.io\";
457
+
458
+ // The port you will connect to on SendPost SMTP Endpoint.
459
+ static final int PORT = 587;
460
+
461
+ static final String SUBJECT = \"SendPost SMTP Test (SMTP interface accessed using Java)\";
462
+
463
+ static final String BODY = String.join(
464
+ System.getProperty(\"line.separator\"),
465
+ \"<h1>SendPost SMTP Test</h1>\",
466
+ \"<p>This email was sent with SendPost using the \",
467
+ \"<a href='https://github.com/eclipse-ee4j/mail'>Javamail Package</a>\",
468
+ \" for <a href='https://www.java.com'>Java</a>.\"
469
+ );
470
+
471
+ public static void main(String[] args) throws Exception {
472
+
473
+ // Create a Properties object to contain connection configuration information.
474
+ Properties props = System.getProperties();
475
+ props.put(\"mail.transport.protocol\", \"smtp\");
476
+ props.put(\"mail.smtp.port\", PORT);
477
+ props.put(\"mail.smtp.starttls.enable\", \"true\");
478
+ props.put(\"mail.smtp.debug\", \"true\");
479
+ props.put(\"mail.smtp.auth\", \"true\");
480
+
481
+ // Create a Session object to represent a mail session with the specified properties.
482
+ Session session = Session.getDefaultInstance(props);
483
+
484
+ // Create a message with the specified information.
485
+ MimeMessage msg = new MimeMessage(session);
486
+ msg.setFrom(new InternetAddress(FROM,FROMNAME));
487
+ msg.setRecipient(Message.RecipientType.TO, new InternetAddress(TO));
488
+ msg.setSubject(SUBJECT);
489
+ msg.setContent(BODY,\"text/html\");
490
+
491
+ // Create a transport.
492
+ Transport transport = session.getTransport();
493
+
494
+ // Send the message.
495
+ try {
496
+ System.out.println(\"Sending...\");
497
+
498
+ // Connect to SendPost SMTP using the SMTP username and password you specified above.
499
+ transport.connect(HOST, SMTP_USERNAME, SMTP_PASSWORD);
500
+
501
+ // Send the email.
502
+ transport.sendMessage(msg, msg.getAllRecipients());
503
+ System.out.println(\"Email sent!\");
504
+
505
+ } catch (Exception ex) {
506
+
507
+ System.out.println(\"The email was not sent.\");
508
+ System.out.println(\"Error message: \" + ex.getMessage());
509
+ System.out.println(ex);
510
+ }
511
+ // Close and terminate the connection.
512
+ }
513
+ }
563
514
  ```
564
515
 
565
- ### Common HTTP Status Codes
516
+ Many programming languages support sending email using SMTP. This capability might be built into the programming language itself, or it might be available as an add-on, plug-in, or library. You can take advantage of this capability by sending email through SendPost from within application programs that you write.
566
517
 
567
- | Code | Meaning | What to Do |
568
- |------|---------|------------|
569
- | 200 | Success | Everything worked |
570
- | 401 | Unauthorized | Check your API key |
571
- | 403 | Forbidden | Resource exists or no permission |
572
- | 404 | Not Found | Resource ID doesn't exist |
573
- | 422 | Invalid Data | Check your request body |
574
- | 500 | Server Error | Try again later |
575
- | 503 | Service Unavailable | SendPost is down for maintenance |
518
+ We have provided examples in Python3, Golang, Java, PHP, JS.
576
519
 
577
- ## Complete Example
520
+ # API Contract Versioning (Public REST)
578
521
 
579
- Here's a complete example that demonstrates common operations:
522
+ The public REST API uses a versioned response contract so field changes stay non-breaking:
580
523
 
581
- ```ruby
582
- #!/usr/bin/env ruby
583
- require 'sendpost_ruby_sdk'
584
- require 'date'
524
+ * Send `X-SendPost-Public-Contract: v1` to opt into the current v1 response shape, or `legacy` for the pre-v1 shape. If the header is omitted, the applied contract is policy-driven — `legacy` before the published sunset date, `v1` after it.
525
+ * Every response echoes `X-SendPost-Public-Contract: <applied>`. When the `legacy` contract is served, responses also include `Deprecation: true`, `Sunset: <RFC1123 date>`, and `Link: <doc-url>; rel=\"deprecation\"`.
526
+ * Migrate to `v1` before the sunset date. Notable legacy → v1 field changes: Suppression `smtp_error` → `smtpError`, Stat `email_type` → `emailType`.
585
527
 
586
- # Configuration
587
- SUB_ACCOUNT_API_KEY = ENV['SENDPOST_SUB_ACCOUNT_API_KEY'] || 'your_key_here'
588
- ACCOUNT_API_KEY = ENV['SENDPOST_ACCOUNT_API_KEY'] || 'your_key_here'
528
+ > `X-SendPost-Private-Api: true` is an internal header used only by the SendPost dashboard to receive richer internal objects. It is not part of the public SDK contract and should not be set by API integrations.
589
529
 
590
- # Setup Sub-Account API (for sending emails)
591
- sub_config = Sendpost::Configuration.new
592
- sub_config.host = 'https://api.sendpost.io/api/v1'
593
- sub_config.api_key['X-SubAccount-ApiKey'] = SUB_ACCOUNT_API_KEY
594
530
 
595
- sub_api_client = Sendpost::ApiClient.new(sub_config)
596
- email_api = Sendpost::EmailApi.new(sub_api_client)
531
+ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
597
532
 
598
- # Setup Account API (for managing resources)
599
- account_config = Sendpost::Configuration.new
600
- account_config.host = 'https://api.sendpost.io/api/v1'
601
- account_config.api_key['X-Account-ApiKey'] = ACCOUNT_API_KEY
533
+ - API version: 1.3.0
534
+ - Package version: 3.0.0
535
+ - Generator version: 7.13.0
536
+ - Build package: org.openapitools.codegen.languages.RubyClientCodegen
602
537
 
603
- account_api_client = Sendpost::ApiClient.new(account_config)
538
+ ## Installation
604
539
 
605
- # Send an email
606
- email_message = Sendpost::EmailMessageObject.new
540
+ ### Build a gem
607
541
 
608
- from = Sendpost::EmailMessageFrom.new
609
- from.email = 'sender@yourdomain.com'
610
- from.name = 'Your Company'
611
- email_message.from = from
542
+ To build the Ruby code into a gem:
612
543
 
613
- to = Sendpost::EmailMessageToInner.new
614
- to.email = 'recipient@example.com'
615
- to.name = 'Recipient'
616
- email_message.to = [to]
544
+ ```shell
545
+ gem build sendpost_ruby_sdk.gemspec
546
+ ```
617
547
 
618
- email_message.subject = 'Test Email'
619
- email_message.html_body = '<h1>Hello!</h1><p>This is a test email.</p>'
620
- email_message.text_body = 'Hello! This is a test email.'
621
- email_message.track_opens = true
622
- email_message.track_clicks = true
548
+ Then either install the gem locally:
623
549
 
624
- begin
625
- responses = email_api.send_email(email_message)
626
- message_id = responses[0].message_id
627
- puts "Email sent! Message ID: #{message_id}"
628
-
629
- # Get message details
630
- message_api = Sendpost::MessageApi.new(account_api_client)
631
- message = message_api.get_message_by_id(message_id)
632
- puts "Message details retrieved successfully"
633
-
634
- rescue Sendpost::ApiError => e
635
- puts "Error: #{e.code} - #{e.response_body}"
636
- end
550
+ ```shell
551
+ gem install ./sendpost_ruby_sdk-3.0.0.gem
637
552
  ```
638
553
 
639
- ## API Reference
554
+ (for development, run `gem install --dev ./sendpost_ruby_sdk-3.0.0.gem` to install the development dependencies)
555
+
556
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
557
+
558
+ Finally add this to the Gemfile:
559
+
560
+ gem 'sendpost_ruby_sdk', '~> 3.0.0'
561
+
562
+ ### Install from Git
563
+
564
+ If the Ruby gem is hosted at a git repository: https://github.com/sendpost/sendpost-ruby-sdk, then add the following in the Gemfile:
565
+
566
+ gem 'sendpost_ruby_sdk', :git => 'https://github.com/sendpost/sendpost-ruby-sdk.git'
640
567
 
641
- For complete API documentation, see the [API Reference](docs/) directory. Key API classes:
568
+ ### Include the Ruby code directly
642
569
 
643
- - `Sendpost::EmailApi` - Send emails
644
- - `Sendpost::DomainApi` - Manage domains
645
- - `Sendpost::SubAccountApi` - Manage sub-accounts
646
- - `Sendpost::StatsApi` - View statistics
647
- - `Sendpost::WebhookApi` - Manage webhooks
648
- - `Sendpost::SuppressionApi` - Manage suppressions
649
- - `Sendpost::MessageApi` - Retrieve message details
570
+ Include the Ruby code directly using `-I` as follows:
650
571
 
651
- ## Requirements
572
+ ```shell
573
+ ruby -Ilib script.rb
574
+ ```
652
575
 
653
- - Ruby 2.7 or higher
654
- - Internet connection
576
+ ## Getting Started
655
577
 
656
- ## Getting Help
578
+ Please follow the [installation](#installation) procedure and then run the following code:
657
579
 
658
- - **Documentation**: [https://docs.sendpost.io](https://docs.sendpost.io)
659
- - **Email Support**: hello@sendpost.io
660
- - **Website**: [https://sendpost.io](https://sendpost.io)
661
- - **Developer Portal**: [https://app.sendpost.io](https://app.sendpost.io)
580
+ ```ruby
581
+ # Load the gem
582
+ require 'sendpost_ruby_sdk'
662
583
 
663
- ## License
584
+ # Setup authorization
585
+ Sendpost.configure do |config|
586
+ # Configure API key authorization: subAccountAuth
587
+ config.api_key['X-SubAccount-ApiKey'] = 'YOUR API KEY'
588
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
589
+ # config.api_key_prefix['X-SubAccount-ApiKey'] = 'Bearer'
590
+ end
664
591
 
665
- This SDK is provided under the Unlicense. See LICENSE file for details.
592
+ api_instance = Sendpost::DomainApi.new
593
+ create_domain_request = Sendpost::CreateDomainRequest.new({name: 'piedpiper.com'}) # CreateDomainRequest |
666
594
 
667
- ## Version
595
+ begin
596
+ #Create Domain
597
+ result = api_instance.create_sub_account_domain(create_domain_request)
598
+ p result
599
+ rescue Sendpost::ApiError => e
600
+ puts "Exception when calling DomainApi->create_sub_account_domain: #{e}"
601
+ end
602
+
603
+ ```
668
604
 
669
- Current version: 2.0.0
605
+ ## Documentation for API Endpoints
606
+
607
+ All URIs are relative to *https://api.sendpost.io/api/v1*
608
+
609
+ Class | Method | HTTP request | Description
610
+ ------------ | ------------- | ------------- | -------------
611
+ *Sendpost::DomainApi* | [**create_sub_account_domain**](docs/DomainApi.md#create_sub_account_domain) | **POST** /subaccount/domain | Create Domain
612
+ *Sendpost::DomainApi* | [**delete_sub_account_domain**](docs/DomainApi.md#delete_sub_account_domain) | **DELETE** /subaccount/domain/{domain_id} | Delete Domain
613
+ *Sendpost::DomainApi* | [**get_all_domains**](docs/DomainApi.md#get_all_domains) | **GET** /subaccount/domain | List Domains
614
+ *Sendpost::DomainApi* | [**get_sub_account_domain**](docs/DomainApi.md#get_sub_account_domain) | **GET** /subaccount/domain/{domain_id} | Get Domain
615
+ *Sendpost::EmailApi* | [**send_email**](docs/EmailApi.md#send_email) | **POST** /subaccount/email/ | Send Email
616
+ *Sendpost::EmailApi* | [**send_email_with_template**](docs/EmailApi.md#send_email_with_template) | **POST** /subaccount/email/template | Send Email With Template
617
+ *Sendpost::IPApi* | [**allocate_new_ip**](docs/IPApi.md#allocate_new_ip) | **PUT** /account/ip/allocate | Allocate IP
618
+ *Sendpost::IPApi* | [**delete_ip**](docs/IPApi.md#delete_ip) | **DELETE** /account/ip/{ip_id} | Delete IP
619
+ *Sendpost::IPApi* | [**get_all_ips**](docs/IPApi.md#get_all_ips) | **GET** /account/ip/ | List IPs
620
+ *Sendpost::IPApi* | [**get_specific_ip**](docs/IPApi.md#get_specific_ip) | **GET** /account/ip/{ip_id} | Get IP
621
+ *Sendpost::IPApi* | [**update_ip**](docs/IPApi.md#update_ip) | **PUT** /account/ip/{ip_id} | Update IP
622
+ *Sendpost::IPPoolsApi* | [**create_ip_pool**](docs/IPPoolsApi.md#create_ip_pool) | **POST** /account/ippool | Create IPPool
623
+ *Sendpost::IPPoolsApi* | [**delete_ip_pool**](docs/IPPoolsApi.md#delete_ip_pool) | **DELETE** /account/ippool/{ippool_id} | Delete IPPool
624
+ *Sendpost::IPPoolsApi* | [**get_all_ip_pools**](docs/IPPoolsApi.md#get_all_ip_pools) | **GET** /account/ippool | List IPPools
625
+ *Sendpost::IPPoolsApi* | [**get_ip_pool_by_id**](docs/IPPoolsApi.md#get_ip_pool_by_id) | **GET** /account/ippool/{ippool_id} | Get IPPool
626
+ *Sendpost::IPPoolsApi* | [**update_ip_pool**](docs/IPPoolsApi.md#update_ip_pool) | **PUT** /account/ippool/{ippool_id} | Update IPPool
627
+ *Sendpost::MessageApi* | [**get_all_messages**](docs/MessageApi.md#get_all_messages) | **GET** /account/message | List Messages
628
+ *Sendpost::MessageApi* | [**get_message_by_id**](docs/MessageApi.md#get_message_by_id) | **GET** /account/message/{message_id} | Get Message
629
+ *Sendpost::StatsApi* | [**account_subaccount_stat_subaccount_id_aggregate_get**](docs/StatsApi.md#account_subaccount_stat_subaccount_id_aggregate_get) | **GET** /account/subaccount/stat/{subaccount_id}/aggregate | Get Aggregate Stats
630
+ *Sendpost::StatsApi* | [**account_subaccount_stat_subaccount_id_get**](docs/StatsApi.md#account_subaccount_stat_subaccount_id_get) | **GET** /account/subaccount/stat/{subaccount_id} | List Stats
631
+ *Sendpost::StatsApi* | [**get_aggregate_stats_by_group**](docs/StatsApi.md#get_aggregate_stats_by_group) | **GET** /account/subaccount/stat/{subaccount_id}/group | Get Group Aggregate Stats
632
+ *Sendpost::StatsAApi* | [**get_account_aggregate_stats**](docs/StatsAApi.md#get_account_aggregate_stats) | **GET** /account/stat/aggregate | Get Account Aggregate Stats
633
+ *Sendpost::StatsAApi* | [**get_account_aggregate_stats_by_group**](docs/StatsAApi.md#get_account_aggregate_stats_by_group) | **GET** /account/stat/aggregate/group | Get Account Group Aggregate Stats
634
+ *Sendpost::StatsAApi* | [**get_account_stats_by_group**](docs/StatsAApi.md#get_account_stats_by_group) | **GET** /account/stat/group | List Account Group Stats
635
+ *Sendpost::StatsAApi* | [**get_all_account_stats**](docs/StatsAApi.md#get_all_account_stats) | **GET** /account/stat | List Account Stats
636
+ *Sendpost::SubAccountApi* | [**create_sub_account**](docs/SubAccountApi.md#create_sub_account) | **POST** /account/subaccount/ | Create Sub-Account
637
+ *Sendpost::SubAccountApi* | [**delete_sub_account**](docs/SubAccountApi.md#delete_sub_account) | **DELETE** /account/subaccount/{subaccount_id} | Delete Sub-Account
638
+ *Sendpost::SubAccountApi* | [**get_all_sub_accounts**](docs/SubAccountApi.md#get_all_sub_accounts) | **GET** /account/subaccount/ | List Sub-Accounts
639
+ *Sendpost::SubAccountApi* | [**get_sub_account**](docs/SubAccountApi.md#get_sub_account) | **GET** /account/subaccount/{subaccount_id} | Get Sub-Account
640
+ *Sendpost::SubAccountApi* | [**update_sub_account**](docs/SubAccountApi.md#update_sub_account) | **PUT** /account/subaccount/{subaccount_id} | Update Sub-Account
641
+ *Sendpost::SuppressionApi* | [**create_suppression**](docs/SuppressionApi.md#create_suppression) | **POST** /subaccount/suppression | Create Suppressions
642
+ *Sendpost::SuppressionApi* | [**delete_suppression**](docs/SuppressionApi.md#delete_suppression) | **DELETE** /subaccount/suppression | Delete Suppressions
643
+ *Sendpost::SuppressionApi* | [**get_suppression_list**](docs/SuppressionApi.md#get_suppression_list) | **GET** /subaccount/suppression | List Suppressions
644
+ *Sendpost::WebhookApi* | [**create_webhook**](docs/WebhookApi.md#create_webhook) | **POST** /account/webhook | Create Webhook
645
+ *Sendpost::WebhookApi* | [**delete_webhook**](docs/WebhookApi.md#delete_webhook) | **DELETE** /account/webhook/{webhook_id} | Delete Webhook
646
+ *Sendpost::WebhookApi* | [**get_all_webhooks**](docs/WebhookApi.md#get_all_webhooks) | **GET** /account/webhook | List Webhooks
647
+ *Sendpost::WebhookApi* | [**get_webhook**](docs/WebhookApi.md#get_webhook) | **GET** /account/webhook/{webhook_id} | Get Webhook
648
+ *Sendpost::WebhookApi* | [**update_webhook**](docs/WebhookApi.md#update_webhook) | **PUT** /account/webhook/{webhook_id} | Update Webhook
649
+
650
+
651
+ ## Documentation for Models
652
+
653
+ - [Sendpost::AccountCycleUsage](docs/AccountCycleUsage.md)
654
+ - [Sendpost::AccountStats](docs/AccountStats.md)
655
+ - [Sendpost::AccountWebhookWithStats](docs/AccountWebhookWithStats.md)
656
+ - [Sendpost::AggregateStat](docs/AggregateStat.md)
657
+ - [Sendpost::AggregateStats](docs/AggregateStats.md)
658
+ - [Sendpost::Attachment](docs/Attachment.md)
659
+ - [Sendpost::BlacklistLinks](docs/BlacklistLinks.md)
660
+ - [Sendpost::BlacklistResource](docs/BlacklistResource.md)
661
+ - [Sendpost::BlacklistedOn](docs/BlacklistedOn.md)
662
+ - [Sendpost::CopyTo](docs/CopyTo.md)
663
+ - [Sendpost::CreateDomainRequest](docs/CreateDomainRequest.md)
664
+ - [Sendpost::CreateSuppressionRequest](docs/CreateSuppressionRequest.md)
665
+ - [Sendpost::CreateSuppressionRequestHardBounceInner](docs/CreateSuppressionRequestHardBounceInner.md)
666
+ - [Sendpost::CreateSuppressionRequestManualInner](docs/CreateSuppressionRequestManualInner.md)
667
+ - [Sendpost::CreateSuppressionRequestSpamComplaintInner](docs/CreateSuppressionRequestSpamComplaintInner.md)
668
+ - [Sendpost::CreateSuppressionRequestUnsubscribeInner](docs/CreateSuppressionRequestUnsubscribeInner.md)
669
+ - [Sendpost::DailyStatistics](docs/DailyStatistics.md)
670
+ - [Sendpost::DateStat](docs/DateStat.md)
671
+ - [Sendpost::DeleteResponse](docs/DeleteResponse.md)
672
+ - [Sendpost::DeleteSubAccountResponse](docs/DeleteSubAccountResponse.md)
673
+ - [Sendpost::DeleteSuppression200Response](docs/DeleteSuppression200Response.md)
674
+ - [Sendpost::DeleteSuppressionRequest](docs/DeleteSuppressionRequest.md)
675
+ - [Sendpost::DeleteSuppressionRequestSuppressionsInner](docs/DeleteSuppressionRequestSuppressionsInner.md)
676
+ - [Sendpost::DeleteWebhookResponse](docs/DeleteWebhookResponse.md)
677
+ - [Sendpost::Device](docs/Device.md)
678
+ - [Sendpost::DnsRecord](docs/DnsRecord.md)
679
+ - [Sendpost::Domain](docs/Domain.md)
680
+ - [Sendpost::DomainStat](docs/DomainStat.md)
681
+ - [Sendpost::EIP](docs/EIP.md)
682
+ - [Sendpost::EmailAddress](docs/EmailAddress.md)
683
+ - [Sendpost::EmailMessage](docs/EmailMessage.md)
684
+ - [Sendpost::EmailMessageObject](docs/EmailMessageObject.md)
685
+ - [Sendpost::EmailMessageWithTemplate](docs/EmailMessageWithTemplate.md)
686
+ - [Sendpost::EmailResponse](docs/EmailResponse.md)
687
+ - [Sendpost::EmailTypeStat](docs/EmailTypeStat.md)
688
+ - [Sendpost::ErrorResponse](docs/ErrorResponse.md)
689
+ - [Sendpost::ErrorResponseError](docs/ErrorResponseError.md)
690
+ - [Sendpost::ErrorResponseErrorDetailsInner](docs/ErrorResponseErrorDetailsInner.md)
691
+ - [Sendpost::Event](docs/Event.md)
692
+ - [Sendpost::EventMetadata](docs/EventMetadata.md)
693
+ - [Sendpost::GeoLocation](docs/GeoLocation.md)
694
+ - [Sendpost::GroupStat](docs/GroupStat.md)
695
+ - [Sendpost::IP](docs/IP.md)
696
+ - [Sendpost::IPAllocationRequest](docs/IPAllocationRequest.md)
697
+ - [Sendpost::IPDeletionResponse](docs/IPDeletionResponse.md)
698
+ - [Sendpost::IPPool](docs/IPPool.md)
699
+ - [Sendpost::IPPoolCreateRequest](docs/IPPoolCreateRequest.md)
700
+ - [Sendpost::IPPoolDeleteResponse](docs/IPPoolDeleteResponse.md)
701
+ - [Sendpost::IPPoolStat](docs/IPPoolStat.md)
702
+ - [Sendpost::IPPoolUpdateRequest](docs/IPPoolUpdateRequest.md)
703
+ - [Sendpost::IPStat](docs/IPStat.md)
704
+ - [Sendpost::IPUpdateRequest](docs/IPUpdateRequest.md)
705
+ - [Sendpost::Label](docs/Label.md)
706
+ - [Sendpost::Member](docs/Member.md)
707
+ - [Sendpost::Message](docs/Message.md)
708
+ - [Sendpost::NewSubAccount](docs/NewSubAccount.md)
709
+ - [Sendpost::NewWebhook](docs/NewWebhook.md)
710
+ - [Sendpost::Os](docs/Os.md)
711
+ - [Sendpost::PostmasterDomainStat](docs/PostmasterDomainStat.md)
712
+ - [Sendpost::ProviderStat](docs/ProviderStat.md)
713
+ - [Sendpost::RAIPPoolStat](docs/RAIPPoolStat.md)
714
+ - [Sendpost::RDStat](docs/RDStat.md)
715
+ - [Sendpost::RIPStat](docs/RIPStat.md)
716
+ - [Sendpost::RStat](docs/RStat.md)
717
+ - [Sendpost::Recipient](docs/Recipient.md)
718
+ - [Sendpost::SDStat](docs/SDStat.md)
719
+ - [Sendpost::SMTPAuth](docs/SMTPAuth.md)
720
+ - [Sendpost::SeedContactStats](docs/SeedContactStats.md)
721
+ - [Sendpost::Stat](docs/Stat.md)
722
+ - [Sendpost::SubAccount](docs/SubAccount.md)
723
+ - [Sendpost::SubAccountStat](docs/SubAccountStat.md)
724
+ - [Sendpost::SubAccountStatForPool](docs/SubAccountStatForPool.md)
725
+ - [Sendpost::Suppression](docs/Suppression.md)
726
+ - [Sendpost::TPSPStat](docs/TPSPStat.md)
727
+ - [Sendpost::UpdateSubAccount](docs/UpdateSubAccount.md)
728
+ - [Sendpost::UpdateWebhook](docs/UpdateWebhook.md)
729
+ - [Sendpost::UserAgent](docs/UserAgent.md)
730
+ - [Sendpost::ValidationStat](docs/ValidationStat.md)
731
+ - [Sendpost::Webhook](docs/Webhook.md)
732
+ - [Sendpost::WebhookObject](docs/WebhookObject.md)
733
+
734
+
735
+ ## Documentation for Authorization
736
+
737
+
738
+ Authentication schemes defined for the API:
739
+ ### accountAuth
740
+
741
+
742
+ - **Type**: API key
743
+ - **API key parameter name**: X-Account-ApiKey
744
+ - **Location**: HTTP header
745
+
746
+ ### subAccountAuth
747
+
748
+
749
+ - **Type**: API key
750
+ - **API key parameter name**: X-SubAccount-ApiKey
751
+ - **Location**: HTTP header
670
752
 
671
- Generated by [OpenAPI Generator](https://openapi-generator.tech)