hostinger-mail-api-sdk 1.0.2

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 (77) hide show
  1. package/.github/workflows/build-release.yaml +91 -0
  2. package/CODEOWNERS +1 -0
  3. package/README.md +9 -0
  4. package/api.ts +3760 -0
  5. package/base.ts +83 -0
  6. package/common.ts +111 -0
  7. package/configuration.ts +72 -0
  8. package/dist/api.d.ts +2426 -0
  9. package/dist/api.js +2484 -0
  10. package/dist/base.d.ts +63 -0
  11. package/dist/base.js +62 -0
  12. package/dist/common.d.ts +47 -0
  13. package/dist/common.js +118 -0
  14. package/dist/configuration.d.ts +51 -0
  15. package/dist/configuration.js +37 -0
  16. package/dist/esm/api.d.ts +2426 -0
  17. package/dist/esm/api.js +2457 -0
  18. package/dist/esm/base.d.ts +63 -0
  19. package/dist/esm/base.js +57 -0
  20. package/dist/esm/common.d.ts +47 -0
  21. package/dist/esm/common.js +109 -0
  22. package/dist/esm/configuration.d.ts +51 -0
  23. package/dist/esm/configuration.js +33 -0
  24. package/dist/esm/index.d.ts +10 -0
  25. package/dist/esm/index.js +12 -0
  26. package/dist/index.d.ts +10 -0
  27. package/dist/index.js +28 -0
  28. package/docs/AccountApi.md +55 -0
  29. package/docs/Error.md +25 -0
  30. package/docs/FoldersApi.md +259 -0
  31. package/docs/MessagesApi.md +860 -0
  32. package/docs/Pagination.md +27 -0
  33. package/docs/QuotaApi.md +63 -0
  34. package/docs/SendApi.md +68 -0
  35. package/docs/V1FolderMessagesCollection.md +23 -0
  36. package/docs/V1FolderMessagesDeleteBulkRequest.md +21 -0
  37. package/docs/V1FolderMessagesFlagsBulkRequest.md +25 -0
  38. package/docs/V1FolderMessagesFlagsRequest.md +23 -0
  39. package/docs/V1FolderMessagesMessage.md +47 -0
  40. package/docs/V1FolderMessagesMessageAddress.md +23 -0
  41. package/docs/V1FolderMessagesMessageAttachment.md +31 -0
  42. package/docs/V1FolderMessagesMessageText.md +23 -0
  43. package/docs/V1FolderMessagesMessageTextResource.md +21 -0
  44. package/docs/V1FolderMessagesMoveBulkRequest.md +23 -0
  45. package/docs/V1FolderMessagesMoveRequest.md +21 -0
  46. package/docs/V1FolderMessagesResource.md +21 -0
  47. package/docs/V1FolderMessagesSearchRequest.md +45 -0
  48. package/docs/V1FolderMessagesUpdateFlagsResult.md +21 -0
  49. package/docs/V1FolderMessagesUpdateFlagsResultData.md +22 -0
  50. package/docs/V1FolderMessagesUpdateFlagsResultDataFailedInner.md +22 -0
  51. package/docs/V1FoldersCollection.md +23 -0
  52. package/docs/V1FoldersCreateRequest.md +21 -0
  53. package/docs/V1FoldersFolder.md +31 -0
  54. package/docs/V1FoldersResource.md +21 -0
  55. package/docs/V1FoldersUpdateRequest.md +21 -0
  56. package/docs/V1MeMailbox.md +23 -0
  57. package/docs/V1MeResource.md +21 -0
  58. package/docs/V1MeResourceData.md +22 -0
  59. package/docs/V1QuotaQuota.md +29 -0
  60. package/docs/V1QuotaQuotaResource.md +27 -0
  61. package/docs/V1QuotaResource.md +21 -0
  62. package/docs/V1SendAttachment.md +29 -0
  63. package/docs/V1SendRequest.md +35 -0
  64. package/docs/V1WebhooksCollection.md +23 -0
  65. package/docs/V1WebhooksCreateRequest.md +29 -0
  66. package/docs/V1WebhooksResource.md +21 -0
  67. package/docs/V1WebhooksResourceWithSecret.md +21 -0
  68. package/docs/V1WebhooksTestResult.md +21 -0
  69. package/docs/V1WebhooksTestResultData.md +24 -0
  70. package/docs/V1WebhooksUpdateRequest.md +29 -0
  71. package/docs/V1WebhooksWebhook.md +39 -0
  72. package/docs/V1WebhooksWebhookWithSecret.md +41 -0
  73. package/docs/WebhooksApi.md +439 -0
  74. package/index.ts +15 -0
  75. package/package.json +34 -0
  76. package/tsconfig.esm.json +7 -0
  77. package/tsconfig.json +18 -0
@@ -0,0 +1,860 @@
1
+ # MessagesApi
2
+
3
+ All URIs are relative to *https://api.mail.hostinger.com*
4
+
5
+ |Method | HTTP request | Description|
6
+ |------------- | ------------- | -------------|
7
+ |[**deleteAllMessages**](#deleteallmessages) | **DELETE** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages | Delete all messages|
8
+ |[**deleteMessage**](#deletemessage) | **DELETE** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} | Delete message|
9
+ |[**deleteMessages**](#deletemessages) | **POST** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/delete | Delete messages|
10
+ |[**getMessage**](#getmessage) | **GET** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} | Get message|
11
+ |[**getMessageAttachment**](#getmessageattachment) | **GET** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/attachments/{attachmentId} | Download message attachment|
12
+ |[**getMessageSource**](#getmessagesource) | **GET** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/source | Get message source|
13
+ |[**getMessageText**](#getmessagetext) | **GET** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/text | Get message text content|
14
+ |[**listMessages**](#listmessages) | **GET** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages | List messages|
15
+ |[**moveMessage**](#movemessage) | **POST** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}/move | Move message|
16
+ |[**moveMessages**](#movemessages) | **POST** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/move | Move messages|
17
+ |[**patchMessage**](#patchmessage) | **PATCH** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} | Update message flags|
18
+ |[**searchMessages**](#searchmessages) | **POST** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/search | Search messages|
19
+ |[**updateMessageFlags**](#updatemessageflags) | **POST** /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/flags | Update message flags|
20
+
21
+ # **deleteAllMessages**
22
+ > deleteAllMessages()
23
+
24
+ Permanently delete every message in a folder (empty the folder).
25
+
26
+ ### Example
27
+
28
+ ```typescript
29
+ import {
30
+ MessagesApi,
31
+ Configuration
32
+ } from 'hostinger-mail-api-sdk';
33
+
34
+ const configuration = new Configuration();
35
+ const apiInstance = new MessagesApi(configuration);
36
+
37
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
38
+ let folder: string; //Folder path (URL-encoded). (default to undefined)
39
+
40
+ const { status, data } = await apiInstance.deleteAllMessages(
41
+ mailboxResourceId,
42
+ folder
43
+ );
44
+ ```
45
+
46
+ ### Parameters
47
+
48
+ |Name | Type | Description | Notes|
49
+ |------------- | ------------- | ------------- | -------------|
50
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
51
+ | **folder** | [**string**] | Folder path (URL-encoded). | defaults to undefined|
52
+
53
+
54
+ ### Return type
55
+
56
+ void (empty response body)
57
+
58
+ ### Authorization
59
+
60
+ [BearerAuth](../README.md#BearerAuth)
61
+
62
+ ### HTTP request headers
63
+
64
+ - **Content-Type**: Not defined
65
+ - **Accept**: application/json
66
+
67
+
68
+ ### HTTP response details
69
+ | Status code | Description | Response headers |
70
+ |-------------|-------------|------------------|
71
+ |**204** | Messages deleted successfully. | - |
72
+ |**401** | Missing or invalid credentials. | - |
73
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
74
+ |**404** | Resource not found. | - |
75
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
76
+ |**500** | Server-side failure. | - |
77
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
78
+
79
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
80
+
81
+ # **deleteMessage**
82
+ > deleteMessage()
83
+
84
+ Permanently delete a single message.
85
+
86
+ ### Example
87
+
88
+ ```typescript
89
+ import {
90
+ MessagesApi,
91
+ Configuration
92
+ } from 'hostinger-mail-api-sdk';
93
+
94
+ const configuration = new Configuration();
95
+ const apiInstance = new MessagesApi(configuration);
96
+
97
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
98
+ let folder: string; //Folder path (URL-encoded). (default to undefined)
99
+ let uid: number; //Message UID. (default to undefined)
100
+
101
+ const { status, data } = await apiInstance.deleteMessage(
102
+ mailboxResourceId,
103
+ folder,
104
+ uid
105
+ );
106
+ ```
107
+
108
+ ### Parameters
109
+
110
+ |Name | Type | Description | Notes|
111
+ |------------- | ------------- | ------------- | -------------|
112
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
113
+ | **folder** | [**string**] | Folder path (URL-encoded). | defaults to undefined|
114
+ | **uid** | [**number**] | Message UID. | defaults to undefined|
115
+
116
+
117
+ ### Return type
118
+
119
+ void (empty response body)
120
+
121
+ ### Authorization
122
+
123
+ [BearerAuth](../README.md#BearerAuth)
124
+
125
+ ### HTTP request headers
126
+
127
+ - **Content-Type**: Not defined
128
+ - **Accept**: application/json
129
+
130
+
131
+ ### HTTP response details
132
+ | Status code | Description | Response headers |
133
+ |-------------|-------------|------------------|
134
+ |**204** | Message deleted successfully. | - |
135
+ |**401** | Missing or invalid credentials. | - |
136
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
137
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
138
+ |**500** | Server-side failure. | - |
139
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
140
+
141
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
142
+
143
+ # **deleteMessages**
144
+ > deleteMessages(v1FolderMessagesDeleteBulkRequest)
145
+
146
+ Permanently delete multiple messages from a folder.
147
+
148
+ ### Example
149
+
150
+ ```typescript
151
+ import {
152
+ MessagesApi,
153
+ Configuration,
154
+ V1FolderMessagesDeleteBulkRequest
155
+ } from 'hostinger-mail-api-sdk';
156
+
157
+ const configuration = new Configuration();
158
+ const apiInstance = new MessagesApi(configuration);
159
+
160
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
161
+ let folder: string; //Folder path (URL-encoded). (default to undefined)
162
+ let v1FolderMessagesDeleteBulkRequest: V1FolderMessagesDeleteBulkRequest; //
163
+
164
+ const { status, data } = await apiInstance.deleteMessages(
165
+ mailboxResourceId,
166
+ folder,
167
+ v1FolderMessagesDeleteBulkRequest
168
+ );
169
+ ```
170
+
171
+ ### Parameters
172
+
173
+ |Name | Type | Description | Notes|
174
+ |------------- | ------------- | ------------- | -------------|
175
+ | **v1FolderMessagesDeleteBulkRequest** | **V1FolderMessagesDeleteBulkRequest**| | |
176
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
177
+ | **folder** | [**string**] | Folder path (URL-encoded). | defaults to undefined|
178
+
179
+
180
+ ### Return type
181
+
182
+ void (empty response body)
183
+
184
+ ### Authorization
185
+
186
+ [BearerAuth](../README.md#BearerAuth)
187
+
188
+ ### HTTP request headers
189
+
190
+ - **Content-Type**: application/json
191
+ - **Accept**: application/json
192
+
193
+
194
+ ### HTTP response details
195
+ | Status code | Description | Response headers |
196
+ |-------------|-------------|------------------|
197
+ |**204** | Messages deleted successfully. | - |
198
+ |**401** | Missing or invalid credentials. | - |
199
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
200
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
201
+ |**500** | Server-side failure. | - |
202
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
203
+
204
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
205
+
206
+ # **getMessage**
207
+ > V1FolderMessagesResource getMessage()
208
+
209
+ Retrieve a single message by UID.
210
+
211
+ ### Example
212
+
213
+ ```typescript
214
+ import {
215
+ MessagesApi,
216
+ Configuration
217
+ } from 'hostinger-mail-api-sdk';
218
+
219
+ const configuration = new Configuration();
220
+ const apiInstance = new MessagesApi(configuration);
221
+
222
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
223
+ let folder: string; //Folder path (URL-encoded). (default to undefined)
224
+ let uid: number; //Message UID. (default to undefined)
225
+
226
+ const { status, data } = await apiInstance.getMessage(
227
+ mailboxResourceId,
228
+ folder,
229
+ uid
230
+ );
231
+ ```
232
+
233
+ ### Parameters
234
+
235
+ |Name | Type | Description | Notes|
236
+ |------------- | ------------- | ------------- | -------------|
237
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
238
+ | **folder** | [**string**] | Folder path (URL-encoded). | defaults to undefined|
239
+ | **uid** | [**number**] | Message UID. | defaults to undefined|
240
+
241
+
242
+ ### Return type
243
+
244
+ **V1FolderMessagesResource**
245
+
246
+ ### Authorization
247
+
248
+ [BearerAuth](../README.md#BearerAuth)
249
+
250
+ ### HTTP request headers
251
+
252
+ - **Content-Type**: Not defined
253
+ - **Accept**: application/json
254
+
255
+
256
+ ### HTTP response details
257
+ | Status code | Description | Response headers |
258
+ |-------------|-------------|------------------|
259
+ |**200** | Message payload. | - |
260
+ |**401** | Missing or invalid credentials. | - |
261
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
262
+ |**404** | Resource not found. | - |
263
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
264
+ |**500** | Server-side failure. | - |
265
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
266
+
267
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
268
+
269
+ # **getMessageAttachment**
270
+ > File getMessageAttachment()
271
+
272
+ Download a message attachment as `application/octet-stream`.
273
+
274
+ ### Example
275
+
276
+ ```typescript
277
+ import {
278
+ MessagesApi,
279
+ Configuration
280
+ } from 'hostinger-mail-api-sdk';
281
+
282
+ const configuration = new Configuration();
283
+ const apiInstance = new MessagesApi(configuration);
284
+
285
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
286
+ let folder: string; //Folder path (URL-encoded). (default to undefined)
287
+ let uid: number; //Message UID. (default to undefined)
288
+ let attachmentId: string; //Attachment ID (opaque, returned by GET message). (default to undefined)
289
+
290
+ const { status, data } = await apiInstance.getMessageAttachment(
291
+ mailboxResourceId,
292
+ folder,
293
+ uid,
294
+ attachmentId
295
+ );
296
+ ```
297
+
298
+ ### Parameters
299
+
300
+ |Name | Type | Description | Notes|
301
+ |------------- | ------------- | ------------- | -------------|
302
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
303
+ | **folder** | [**string**] | Folder path (URL-encoded). | defaults to undefined|
304
+ | **uid** | [**number**] | Message UID. | defaults to undefined|
305
+ | **attachmentId** | [**string**] | Attachment ID (opaque, returned by GET message). | defaults to undefined|
306
+
307
+
308
+ ### Return type
309
+
310
+ **File**
311
+
312
+ ### Authorization
313
+
314
+ [BearerAuth](../README.md#BearerAuth)
315
+
316
+ ### HTTP request headers
317
+
318
+ - **Content-Type**: Not defined
319
+ - **Accept**: application/octet-stream, application/json
320
+
321
+
322
+ ### HTTP response details
323
+ | Status code | Description | Response headers |
324
+ |-------------|-------------|------------------|
325
+ |**200** | Decoded attachment body. | - |
326
+ |**401** | Missing or invalid credentials. | - |
327
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
328
+ |**404** | Resource not found. | - |
329
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
330
+ |**500** | Server-side failure. | - |
331
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
332
+
333
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
334
+
335
+ # **getMessageSource**
336
+ > File getMessageSource()
337
+
338
+ Retrieve raw RFC822 source of a message as `message/rfc822` attachment.
339
+
340
+ ### Example
341
+
342
+ ```typescript
343
+ import {
344
+ MessagesApi,
345
+ Configuration
346
+ } from 'hostinger-mail-api-sdk';
347
+
348
+ const configuration = new Configuration();
349
+ const apiInstance = new MessagesApi(configuration);
350
+
351
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
352
+ let folder: string; //Folder path (URL-encoded). (default to undefined)
353
+ let uid: number; //Message UID. (default to undefined)
354
+
355
+ const { status, data } = await apiInstance.getMessageSource(
356
+ mailboxResourceId,
357
+ folder,
358
+ uid
359
+ );
360
+ ```
361
+
362
+ ### Parameters
363
+
364
+ |Name | Type | Description | Notes|
365
+ |------------- | ------------- | ------------- | -------------|
366
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
367
+ | **folder** | [**string**] | Folder path (URL-encoded). | defaults to undefined|
368
+ | **uid** | [**number**] | Message UID. | defaults to undefined|
369
+
370
+
371
+ ### Return type
372
+
373
+ **File**
374
+
375
+ ### Authorization
376
+
377
+ [BearerAuth](../README.md#BearerAuth)
378
+
379
+ ### HTTP request headers
380
+
381
+ - **Content-Type**: Not defined
382
+ - **Accept**: message/rfc822, application/json
383
+
384
+
385
+ ### HTTP response details
386
+ | Status code | Description | Response headers |
387
+ |-------------|-------------|------------------|
388
+ |**200** | Raw RFC822 source. | - |
389
+ |**401** | Missing or invalid credentials. | - |
390
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
391
+ |**404** | Resource not found. | - |
392
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
393
+ |**500** | Server-side failure. | - |
394
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
395
+
396
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
397
+
398
+ # **getMessageText**
399
+ > V1FolderMessagesMessageTextResource getMessageText()
400
+
401
+ Retrieve rendered text (plain + HTML) of a message. Marks message as `\\Seen`.
402
+
403
+ ### Example
404
+
405
+ ```typescript
406
+ import {
407
+ MessagesApi,
408
+ Configuration
409
+ } from 'hostinger-mail-api-sdk';
410
+
411
+ const configuration = new Configuration();
412
+ const apiInstance = new MessagesApi(configuration);
413
+
414
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
415
+ let folder: string; //Folder path (URL-encoded). (default to undefined)
416
+ let uid: number; //Message UID. (default to undefined)
417
+
418
+ const { status, data } = await apiInstance.getMessageText(
419
+ mailboxResourceId,
420
+ folder,
421
+ uid
422
+ );
423
+ ```
424
+
425
+ ### Parameters
426
+
427
+ |Name | Type | Description | Notes|
428
+ |------------- | ------------- | ------------- | -------------|
429
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
430
+ | **folder** | [**string**] | Folder path (URL-encoded). | defaults to undefined|
431
+ | **uid** | [**number**] | Message UID. | defaults to undefined|
432
+
433
+
434
+ ### Return type
435
+
436
+ **V1FolderMessagesMessageTextResource**
437
+
438
+ ### Authorization
439
+
440
+ [BearerAuth](../README.md#BearerAuth)
441
+
442
+ ### HTTP request headers
443
+
444
+ - **Content-Type**: Not defined
445
+ - **Accept**: application/json
446
+
447
+
448
+ ### HTTP response details
449
+ | Status code | Description | Response headers |
450
+ |-------------|-------------|------------------|
451
+ |**200** | Rendered text and HTML payload. | - |
452
+ |**401** | Missing or invalid credentials. | - |
453
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
454
+ |**404** | Resource not found. | - |
455
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
456
+ |**500** | Server-side failure. | - |
457
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
458
+
459
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
460
+
461
+ # **listMessages**
462
+ > V1FolderMessagesCollection listMessages()
463
+
464
+ List messages in a folder. Use POST /search for filtering. Sort fields: uid, date, size (prefix with `-` for descending). Default `-uid`.
465
+
466
+ ### Example
467
+
468
+ ```typescript
469
+ import {
470
+ MessagesApi,
471
+ Configuration
472
+ } from 'hostinger-mail-api-sdk';
473
+
474
+ const configuration = new Configuration();
475
+ const apiInstance = new MessagesApi(configuration);
476
+
477
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
478
+ let folder: string; //Folder path (URL-encoded). (default to undefined)
479
+ let page: number; //Page number (1-based). (optional) (default to 1)
480
+ let perPage: number; //Items per page (max 100). (optional) (default to 25)
481
+ let sort: string; //Sort field with optional `-` prefix for descending. Allowed: uid, date, size. (optional) (default to '-uid')
482
+
483
+ const { status, data } = await apiInstance.listMessages(
484
+ mailboxResourceId,
485
+ folder,
486
+ page,
487
+ perPage,
488
+ sort
489
+ );
490
+ ```
491
+
492
+ ### Parameters
493
+
494
+ |Name | Type | Description | Notes|
495
+ |------------- | ------------- | ------------- | -------------|
496
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
497
+ | **folder** | [**string**] | Folder path (URL-encoded). | defaults to undefined|
498
+ | **page** | [**number**] | Page number (1-based). | (optional) defaults to 1|
499
+ | **perPage** | [**number**] | Items per page (max 100). | (optional) defaults to 25|
500
+ | **sort** | [**string**] | Sort field with optional `-` prefix for descending. Allowed: uid, date, size. | (optional) defaults to '-uid'|
501
+
502
+
503
+ ### Return type
504
+
505
+ **V1FolderMessagesCollection**
506
+
507
+ ### Authorization
508
+
509
+ [BearerAuth](../README.md#BearerAuth)
510
+
511
+ ### HTTP request headers
512
+
513
+ - **Content-Type**: Not defined
514
+ - **Accept**: application/json
515
+
516
+
517
+ ### HTTP response details
518
+ | Status code | Description | Response headers |
519
+ |-------------|-------------|------------------|
520
+ |**200** | Paginated list of messages. | - |
521
+ |**401** | Missing or invalid credentials. | - |
522
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
523
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
524
+ |**500** | Server-side failure. | - |
525
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
526
+
527
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
528
+
529
+ # **moveMessage**
530
+ > moveMessage(v1FolderMessagesMoveRequest)
531
+
532
+ Move a single message to a target folder.
533
+
534
+ ### Example
535
+
536
+ ```typescript
537
+ import {
538
+ MessagesApi,
539
+ Configuration,
540
+ V1FolderMessagesMoveRequest
541
+ } from 'hostinger-mail-api-sdk';
542
+
543
+ const configuration = new Configuration();
544
+ const apiInstance = new MessagesApi(configuration);
545
+
546
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
547
+ let folder: string; //Source folder path (URL-encoded). (default to undefined)
548
+ let uid: number; //Message UID. (default to undefined)
549
+ let v1FolderMessagesMoveRequest: V1FolderMessagesMoveRequest; //
550
+
551
+ const { status, data } = await apiInstance.moveMessage(
552
+ mailboxResourceId,
553
+ folder,
554
+ uid,
555
+ v1FolderMessagesMoveRequest
556
+ );
557
+ ```
558
+
559
+ ### Parameters
560
+
561
+ |Name | Type | Description | Notes|
562
+ |------------- | ------------- | ------------- | -------------|
563
+ | **v1FolderMessagesMoveRequest** | **V1FolderMessagesMoveRequest**| | |
564
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
565
+ | **folder** | [**string**] | Source folder path (URL-encoded). | defaults to undefined|
566
+ | **uid** | [**number**] | Message UID. | defaults to undefined|
567
+
568
+
569
+ ### Return type
570
+
571
+ void (empty response body)
572
+
573
+ ### Authorization
574
+
575
+ [BearerAuth](../README.md#BearerAuth)
576
+
577
+ ### HTTP request headers
578
+
579
+ - **Content-Type**: application/json
580
+ - **Accept**: application/json
581
+
582
+
583
+ ### HTTP response details
584
+ | Status code | Description | Response headers |
585
+ |-------------|-------------|------------------|
586
+ |**204** | Message moved successfully. | - |
587
+ |**401** | Missing or invalid credentials. | - |
588
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
589
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
590
+ |**500** | Server-side failure. | - |
591
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
592
+
593
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
594
+
595
+ # **moveMessages**
596
+ > moveMessages(v1FolderMessagesMoveBulkRequest)
597
+
598
+ Move multiple messages from a source folder to a target folder.
599
+
600
+ ### Example
601
+
602
+ ```typescript
603
+ import {
604
+ MessagesApi,
605
+ Configuration,
606
+ V1FolderMessagesMoveBulkRequest
607
+ } from 'hostinger-mail-api-sdk';
608
+
609
+ const configuration = new Configuration();
610
+ const apiInstance = new MessagesApi(configuration);
611
+
612
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
613
+ let folder: string; //Source folder path (URL-encoded). (default to undefined)
614
+ let v1FolderMessagesMoveBulkRequest: V1FolderMessagesMoveBulkRequest; //
615
+
616
+ const { status, data } = await apiInstance.moveMessages(
617
+ mailboxResourceId,
618
+ folder,
619
+ v1FolderMessagesMoveBulkRequest
620
+ );
621
+ ```
622
+
623
+ ### Parameters
624
+
625
+ |Name | Type | Description | Notes|
626
+ |------------- | ------------- | ------------- | -------------|
627
+ | **v1FolderMessagesMoveBulkRequest** | **V1FolderMessagesMoveBulkRequest**| | |
628
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
629
+ | **folder** | [**string**] | Source folder path (URL-encoded). | defaults to undefined|
630
+
631
+
632
+ ### Return type
633
+
634
+ void (empty response body)
635
+
636
+ ### Authorization
637
+
638
+ [BearerAuth](../README.md#BearerAuth)
639
+
640
+ ### HTTP request headers
641
+
642
+ - **Content-Type**: application/json
643
+ - **Accept**: application/json
644
+
645
+
646
+ ### HTTP response details
647
+ | Status code | Description | Response headers |
648
+ |-------------|-------------|------------------|
649
+ |**204** | Messages moved successfully. | - |
650
+ |**401** | Missing or invalid credentials. | - |
651
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
652
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
653
+ |**500** | Server-side failure. | - |
654
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
655
+
656
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
657
+
658
+ # **patchMessage**
659
+ > V1FolderMessagesResource patchMessage(v1FolderMessagesFlagsRequest)
660
+
661
+ Add and/or remove flags on a single message. Returns the updated message.
662
+
663
+ ### Example
664
+
665
+ ```typescript
666
+ import {
667
+ MessagesApi,
668
+ Configuration,
669
+ V1FolderMessagesFlagsRequest
670
+ } from 'hostinger-mail-api-sdk';
671
+
672
+ const configuration = new Configuration();
673
+ const apiInstance = new MessagesApi(configuration);
674
+
675
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
676
+ let folder: string; //Folder path (URL-encoded). (default to undefined)
677
+ let uid: number; //Message UID. (default to undefined)
678
+ let v1FolderMessagesFlagsRequest: V1FolderMessagesFlagsRequest; //
679
+
680
+ const { status, data } = await apiInstance.patchMessage(
681
+ mailboxResourceId,
682
+ folder,
683
+ uid,
684
+ v1FolderMessagesFlagsRequest
685
+ );
686
+ ```
687
+
688
+ ### Parameters
689
+
690
+ |Name | Type | Description | Notes|
691
+ |------------- | ------------- | ------------- | -------------|
692
+ | **v1FolderMessagesFlagsRequest** | **V1FolderMessagesFlagsRequest**| | |
693
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
694
+ | **folder** | [**string**] | Folder path (URL-encoded). | defaults to undefined|
695
+ | **uid** | [**number**] | Message UID. | defaults to undefined|
696
+
697
+
698
+ ### Return type
699
+
700
+ **V1FolderMessagesResource**
701
+
702
+ ### Authorization
703
+
704
+ [BearerAuth](../README.md#BearerAuth)
705
+
706
+ ### HTTP request headers
707
+
708
+ - **Content-Type**: application/json
709
+ - **Accept**: application/json
710
+
711
+
712
+ ### HTTP response details
713
+ | Status code | Description | Response headers |
714
+ |-------------|-------------|------------------|
715
+ |**200** | Updated message. | - |
716
+ |**401** | Missing or invalid credentials. | - |
717
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
718
+ |**404** | Resource not found. | - |
719
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
720
+ |**500** | Server-side failure. | - |
721
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
722
+
723
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
724
+
725
+ # **searchMessages**
726
+ > V1FolderMessagesCollection searchMessages()
727
+
728
+ Search messages in a folder. Filters in body; pagination and sort via query (`page`, `perPage`, `sort`).
729
+
730
+ ### Example
731
+
732
+ ```typescript
733
+ import {
734
+ MessagesApi,
735
+ Configuration,
736
+ V1FolderMessagesSearchRequest
737
+ } from 'hostinger-mail-api-sdk';
738
+
739
+ const configuration = new Configuration();
740
+ const apiInstance = new MessagesApi(configuration);
741
+
742
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
743
+ let folder: string; //Folder path (URL-encoded). (default to undefined)
744
+ let page: number; // (optional) (default to 1)
745
+ let perPage: number; // (optional) (default to 25)
746
+ let sort: string; // (optional) (default to '-uid')
747
+ let v1FolderMessagesSearchRequest: V1FolderMessagesSearchRequest; // (optional)
748
+
749
+ const { status, data } = await apiInstance.searchMessages(
750
+ mailboxResourceId,
751
+ folder,
752
+ page,
753
+ perPage,
754
+ sort,
755
+ v1FolderMessagesSearchRequest
756
+ );
757
+ ```
758
+
759
+ ### Parameters
760
+
761
+ |Name | Type | Description | Notes|
762
+ |------------- | ------------- | ------------- | -------------|
763
+ | **v1FolderMessagesSearchRequest** | **V1FolderMessagesSearchRequest**| | |
764
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
765
+ | **folder** | [**string**] | Folder path (URL-encoded). | defaults to undefined|
766
+ | **page** | [**number**] | | (optional) defaults to 1|
767
+ | **perPage** | [**number**] | | (optional) defaults to 25|
768
+ | **sort** | [**string**] | | (optional) defaults to '-uid'|
769
+
770
+
771
+ ### Return type
772
+
773
+ **V1FolderMessagesCollection**
774
+
775
+ ### Authorization
776
+
777
+ [BearerAuth](../README.md#BearerAuth)
778
+
779
+ ### HTTP request headers
780
+
781
+ - **Content-Type**: application/json
782
+ - **Accept**: application/json
783
+
784
+
785
+ ### HTTP response details
786
+ | Status code | Description | Response headers |
787
+ |-------------|-------------|------------------|
788
+ |**200** | Paginated list of matching messages. | - |
789
+ |**401** | Missing or invalid credentials. | - |
790
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
791
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
792
+ |**500** | Server-side failure. | - |
793
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
794
+
795
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
796
+
797
+ # **updateMessageFlags**
798
+ > V1FolderMessagesUpdateFlagsResult updateMessageFlags(v1FolderMessagesFlagsBulkRequest)
799
+
800
+ Add and/or remove flags on multiple messages. Returns 200 when all UIDs succeed, 207 with per-UID outcome when some fail.
801
+
802
+ ### Example
803
+
804
+ ```typescript
805
+ import {
806
+ MessagesApi,
807
+ Configuration,
808
+ V1FolderMessagesFlagsBulkRequest
809
+ } from 'hostinger-mail-api-sdk';
810
+
811
+ const configuration = new Configuration();
812
+ const apiInstance = new MessagesApi(configuration);
813
+
814
+ let mailboxResourceId: string; //Resource ID of the managed mailbox the bearer token is authorized for. (default to undefined)
815
+ let folder: string; //Folder path (URL-encoded). (default to undefined)
816
+ let v1FolderMessagesFlagsBulkRequest: V1FolderMessagesFlagsBulkRequest; //
817
+
818
+ const { status, data } = await apiInstance.updateMessageFlags(
819
+ mailboxResourceId,
820
+ folder,
821
+ v1FolderMessagesFlagsBulkRequest
822
+ );
823
+ ```
824
+
825
+ ### Parameters
826
+
827
+ |Name | Type | Description | Notes|
828
+ |------------- | ------------- | ------------- | -------------|
829
+ | **v1FolderMessagesFlagsBulkRequest** | **V1FolderMessagesFlagsBulkRequest**| | |
830
+ | **mailboxResourceId** | [**string**] | Resource ID of the managed mailbox the bearer token is authorized for. | defaults to undefined|
831
+ | **folder** | [**string**] | Folder path (URL-encoded). | defaults to undefined|
832
+
833
+
834
+ ### Return type
835
+
836
+ **V1FolderMessagesUpdateFlagsResult**
837
+
838
+ ### Authorization
839
+
840
+ [BearerAuth](../README.md#BearerAuth)
841
+
842
+ ### HTTP request headers
843
+
844
+ - **Content-Type**: application/json
845
+ - **Accept**: application/json
846
+
847
+
848
+ ### HTTP response details
849
+ | Status code | Description | Response headers |
850
+ |-------------|-------------|------------------|
851
+ |**200** | All UIDs updated successfully. | - |
852
+ |**207** | Some UIDs failed; see body for per-UID outcome. | - |
853
+ |**401** | Missing or invalid credentials. | - |
854
+ |**403** | Token is not authorized to manage the requested mailbox. | - |
855
+ |**422** | Request payload failed validation. `params` maps field name to an array of error messages. | - |
856
+ |**500** | Server-side failure. | - |
857
+ |**502** | Upstream service is unavailable or returned an unexpected response. | - |
858
+
859
+ [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
860
+