Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
631 lines (631 loc) · 28.2 KB
/
Copy pathopenapi.yaml
File metadata and controls
631 lines (631 loc) · 28.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
openapi: 3.1.0
info:
title: Codeverta Relay API
version: 1.0.0-alpha
license: { name: MIT, identifier: MIT }
description: |
REST API Codeverta Relay. Autentikasi `Authorization: Bearer cv_live_...` (atau `cv_test_...`
untuk mode test yang tidak benar-benar mengirim). Super admin memakai token admin dan memilih
tenant lewat header `X-CV-Tenant`. Semua error memakai `application/problem+json` (RFC 9457).
servers:
- url: https://relay.codeverta.com/v1
security:
- bearer: []
tags:
- name: Sending
- name: Domain
- name: Template
- name: Suppression
- name: Webhook
- name: API key
- name: Mailbox
- name: Admin
paths:
/info:
get:
tags: [Sending]
summary: Pengaturan SMTP relay (host, port, username)
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
smtp:
type: object
properties:
host: { type: string }
ports: { type: array, items: { type: integer } }
username: { type: string, enum: [apikey] }
/messages:
post:
tags: [Sending]
summary: Kirim satu email
parameters:
- in: header
name: Idempotency-Key
schema: { type: string, maxLength: 255 }
description: Permintaan dengan kunci dan isi sama dalam 24 jam mengembalikan pesan yang sama.
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/SendRequest" }
example:
from: Toko ABC <no-reply@tokoabc.id>
to: [budi@example.com]
subject: "Invoice #12345"
template_id: tpl_01J...
variables: { name: Budi, total: Rp 250.000 }
stream: transactional
tags: [invoice]
metadata: { order_id: "12345" }
responses:
"202":
description: Diterima dan masuk antrean
headers:
Idempotent-Replayed: { schema: { type: string, enum: ["true"] } }
content:
application/json:
schema: { $ref: "#/components/schemas/SendResult" }
"400": { $ref: "#/components/responses/Problem" }
"401": { $ref: "#/components/responses/Problem" }
"403": { $ref: "#/components/responses/Problem" }
"422": { $ref: "#/components/responses/Problem" }
get:
tags: [Sending]
summary: Cari log pengiriman
parameters:
- { in: query, name: to, schema: { type: string } }
- { in: query, name: status, schema: { $ref: "#/components/schemas/RecipientStatus" } }
- { in: query, name: tag, schema: { type: string } }
- { in: query, name: from_date, schema: { type: string, format: date-time } }
- { in: query, name: to_date, schema: { type: string, format: date-time } }
- { in: query, name: cursor, schema: { type: string } }
- { in: query, name: limit, schema: { type: integer, minimum: 1, maximum: 100, default: 50 } }
responses:
"200":
description: Satu halaman pesan, terbaru dulu
content:
application/json:
schema:
type: object
properties:
data: { type: array, items: { $ref: "#/components/schemas/Message" } }
next_cursor: { type: string, description: Kosong jika halaman terakhir }
/messages/batch:
post:
tags: [Sending]
summary: Kirim hingga 500 email
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [messages]
properties:
messages: { type: array, maxItems: 500, items: { $ref: "#/components/schemas/SendRequest" } }
responses:
"207":
description: Hasil per pesan, urutan sama dengan permintaan
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
oneOf:
- $ref: "#/components/schemas/SendResult"
- type: object
properties: { error: { $ref: "#/components/schemas/Problem" } }
/messages/{id}:
parameters: [{ $ref: "#/components/parameters/id" }]
get:
tags: [Sending]
summary: Status dan timeline event satu pesan
responses:
"200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/Message" } } } }
"404": { $ref: "#/components/responses/Problem" }
delete:
tags: [Sending]
summary: Batalkan pesan yang belum diproses (misal terjadwal)
responses:
"200": { description: Dibatalkan, content: { application/json: { schema: { $ref: "#/components/schemas/Message" } } } }
"409": { $ref: "#/components/responses/Problem" }
/domains:
get:
tags: [Domain]
summary: Daftar domain
responses: { "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/DomainList" } } } } }
post:
tags: [Domain]
summary: Tambah domain (membuat DKIM RSA-2048 + Ed25519)
requestBody:
content:
application/json:
schema:
type: object
required: [name]
properties:
name: { type: string, example: client1.com }
type: { type: string, enum: [hosted, sending, both], default: both }
responses:
"201": { description: Dibuat, content: { application/json: { schema: { $ref: "#/components/schemas/Domain" } } } }
"409": { $ref: "#/components/responses/Problem" }
"422": { $ref: "#/components/responses/Problem" }
/domains/{id}:
parameters: [{ $ref: "#/components/parameters/id" }]
get:
tags: [Domain]
responses: { "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/Domain" } } } } }
delete:
tags: [Domain]
responses: { "204": { description: Dihapus } }
/domains/{id}/dns:
parameters: [{ $ref: "#/components/parameters/id" }]
get:
tags: [Domain]
summary: DNS record yang harus dipasang beserta hasil cek terakhir
responses: { "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/DnsRecords" } } } } }
/domains/{id}/verify:
parameters: [{ $ref: "#/components/parameters/id" }]
post:
tags: [Domain]
summary: Cek DNS sekarang
responses: { "200": { description: Hasil cek, content: { application/json: { schema: { $ref: "#/components/schemas/DnsRecords" } } } } }
/domains/{id}/dns/apply:
parameters: [{ $ref: "#/components/parameters/id" }]
post:
tags: [Domain]
summary: Pasang record DNS lewat API Cloudflare lalu verifikasi
description: SPF yang ada digabung, DMARC yang ada dibiarkan, MX ke penyedia lain dilaporkan conflict.
responses:
"200":
description: Hasil per record
content:
application/json:
schema:
type: object
properties:
zone: { type: string }
verified: { type: boolean }
results:
type: array
items:
type: object
properties:
purpose: { type: string }
type: { type: string }
name: { type: string }
action: { type: string, enum: [created, updated, unchanged, conflict, error] }
detail: { type: string }
"422": { $ref: "#/components/responses/Problem" }
/integrations/cloudflare:
get:
tags: [Domain]
summary: Status token Cloudflare (tenant, platform, atau none)
responses: { "200": { description: OK } }
put:
tags: [Domain]
summary: Simpan token Cloudflare khusus tenant (diverifikasi dulu, disimpan terenkripsi)
requestBody: { content: { application/json: { schema: { type: object, required: [api_token], properties: { api_token: { type: string } } } } } }
responses: { "200": { description: Tersimpan }, "422": { $ref: "#/components/responses/Problem" } }
delete:
tags: [Domain]
responses: { "204": { description: Dihapus } }
/domains/{id}/dkim/rotate:
parameters: [{ $ref: "#/components/parameters/id" }]
post:
tags: [Domain]
summary: Rotasi DKIM; kunci baru aktif setelah 48 jam
responses: { "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/DnsRecords" } } } } }
/templates:
get: { tags: [Template], responses: { "200": { description: OK } } }
post:
tags: [Template]
requestBody: { content: { application/json: { schema: { $ref: "#/components/schemas/TemplateInput" } } } }
responses: { "201": { description: Dibuat, content: { application/json: { schema: { $ref: "#/components/schemas/Template" } } } } }
/templates/{id}:
parameters: [{ $ref: "#/components/parameters/id" }]
get: { tags: [Template], responses: { "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/Template" } } } } } }
put:
tags: [Template]
summary: Ganti isi template (versi naik)
requestBody: { content: { application/json: { schema: { $ref: "#/components/schemas/TemplateInput" } } } }
responses: { "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/Template" } } } } }
delete: { tags: [Template], responses: { "204": { description: Dihapus } } }
/templates/{id}/render:
parameters: [{ $ref: "#/components/parameters/id" }]
post:
tags: [Template]
summary: Preview; variabel yang dipakai template wajib ada
requestBody: { content: { application/json: { schema: { type: object, properties: { variables: { type: object } } } } } }
responses:
"200":
description: OK
content: { application/json: { schema: { type: object, properties: { subject: { type: string }, html: { type: string }, text: { type: string } } } } }
"422": { $ref: "#/components/responses/Problem" }
/suppressions:
get:
tags: [Suppression]
parameters:
- { in: query, name: q, schema: { type: string }, description: Awalan email }
- { in: query, name: limit, schema: { type: integer, maximum: 1000 } }
responses: { "200": { description: OK } }
post:
tags: [Suppression]
requestBody:
content:
application/json:
schema:
type: object
required: [email]
properties:
email: { type: string, format: email }
reason: { type: string, enum: [manual, hard_bounce, complaint, unsubscribe], default: manual }
responses: { "201": { description: Ditambahkan } }
/suppressions/{email}:
delete:
tags: [Suppression]
parameters: [{ in: path, name: email, required: true, schema: { type: string } }]
responses: { "204": { description: Dihapus } }
/webhooks:
get: { tags: [Webhook], responses: { "200": { description: OK } } }
post:
tags: [Webhook]
requestBody:
content:
application/json:
schema:
type: object
required: [url]
properties:
url: { type: string, format: uri }
event_types: { type: array, items: { $ref: "#/components/schemas/EventType" }, description: Kosong berarti semua }
responses:
"201":
description: Dibuat. `secret` hanya ditampilkan sekali.
content: { application/json: { schema: { allOf: [{ $ref: "#/components/schemas/Webhook" }, { type: object, properties: { secret: { type: string } } }] } } }
/webhooks/{id}:
parameters: [{ $ref: "#/components/parameters/id" }]
get: { tags: [Webhook], responses: { "200": { description: OK } } }
patch: { tags: [Webhook], responses: { "200": { description: OK } } }
delete: { tags: [Webhook], responses: { "204": { description: Dihapus } } }
/webhooks/{id}/deliveries:
parameters: [{ $ref: "#/components/parameters/id" }]
get: { tags: [Webhook], summary: Riwayat delivery (retry hingga 24 jam, lalu failed), responses: { "200": { description: OK } } }
/webhooks/{id}/deliveries/{did}/replay:
parameters:
- { $ref: "#/components/parameters/id" }
- { in: path, name: did, required: true, schema: { type: integer } }
post: { tags: [Webhook], responses: { "202": { description: Dijadwalkan ulang } } }
/api-keys:
get: { tags: [API key], responses: { "200": { description: OK } } }
post:
tags: [API key]
requestBody:
content:
application/json:
schema:
type: object
required: [scopes]
properties:
name: { type: string }
scopes: { type: array, items: { type: string, enum: ["*", send, read_logs, manage_templates, manage_domains, manage_webhooks, manage_suppressions, manage_api_keys, manage_mailboxes] } }
stream: { type: string, enum: [transactional, broadcast] }
allowed_ips: { type: array, items: { type: string } }
test: { type: boolean }
responses: { "201": { description: Dibuat. `key` hanya ditampilkan sekali. } }
/api-keys/{id}:
parameters: [{ $ref: "#/components/parameters/id" }]
delete: { tags: [API key], responses: { "204": { description: Dicabut } } }
/mailboxes:
get:
tags: [Mailbox]
summary: Daftar mailbox (scope manage_mailboxes)
responses: { "200": { description: OK, content: { application/json: { schema: { type: object, properties: { data: { type: array, items: { $ref: "#/components/schemas/Mailbox" } } } } } } } }
post:
tags: [Mailbox]
summary: Buat mailbox beserta folder bawaan (INBOX, Sent, Drafts, Trash, Junk, Archive)
description: Domain wajib milik tenant dengan tipe hosted atau both. Mailbox boleh dibuat sebelum domain terverifikasi (persiapan migrasi), tetapi surat baru diterima setelah DNS terverifikasi.
requestBody:
content:
application/json:
schema: { $ref: "#/components/schemas/MailboxInput" }
responses:
"201": { description: Dibuat, content: { application/json: { schema: { $ref: "#/components/schemas/Mailbox" } } } }
"409": { $ref: "#/components/responses/Problem" }
"422": { $ref: "#/components/responses/Problem" }
/mailboxes/{id}:
parameters: [{ $ref: "#/components/parameters/id" }]
get: { tags: [Mailbox], responses: { "200": { description: OK, content: { application/json: { schema: { $ref: "#/components/schemas/Mailbox" } } } } } }
patch:
tags: [Mailbox]
summary: Ubah nama, password, kuota, atau status. Ganti password / nonaktifkan memutus sesi IMAP yang terbuka.
requestBody: { content: { application/json: { schema: { $ref: "#/components/schemas/MailboxInput" } } } }
responses: { "200": { description: OK } }
delete: { tags: [Mailbox], summary: Hapus mailbox beserta semua emailnya, responses: { "204": { description: Dihapus } } }
/aliases:
get: { tags: [Mailbox], responses: { "200": { description: OK } } }
post:
tags: [Mailbox]
summary: Buat alias (atau catch-all dengan *@domain) ke mailbox milik tenant
requestBody:
content:
application/json:
schema:
type: object
required: [address, destinations]
properties:
address: { type: string, example: sales@client1.com }
destinations: { type: array, maxItems: 50, items: { type: string }, example: [budi@client1.com] }
responses: { "201": { description: Dibuat }, "409": { $ref: "#/components/responses/Problem" }, "422": { $ref: "#/components/responses/Problem" } }
/aliases/{id}:
parameters: [{ $ref: "#/components/parameters/id" }]
delete: { tags: [Mailbox], responses: { "204": { description: Dihapus } } }
/sender-rules:
get:
tags: [Mailbox]
summary: Daftar izin/blokir pengirim (filter dengan ?mailbox_id=)
parameters: [{ in: query, name: mailbox_id, schema: { type: string } }]
responses: { "200": { description: OK } }
post:
tags: [Mailbox]
summary: Tambah aturan pengirim
description: Izin membuat surat yang dinilai spam tetap ke Inbox hanya jika domain From terbukti (SPF/DKIM align) dan skornya bukan ekstrem. Blokir selalu ke Junk dan juga mencocokkan envelope sender. Aturan mailbox mengalahkan aturan tenant; alamat mengalahkan domain.
requestBody:
content:
application/json:
schema:
type: object
required: [pattern, action]
properties:
pattern: { type: string, example: mitra.com, description: Alamat (a@mitra.com) atau domain (termasuk subdomain); public suffix ditolak }
action: { type: string, enum: [allow, block] }
mailbox_id: { type: string, nullable: true, description: Kosong = semua mailbox tenant }
responses: { "201": { description: Dibuat }, "409": { $ref: "#/components/responses/Problem" }, "422": { $ref: "#/components/responses/Problem" } }
/sender-rules/{id}:
parameters: [{ $ref: "#/components/parameters/id" }]
delete: { tags: [Mailbox], responses: { "204": { description: Dihapus } } }
/admin/tenants:
get: { tags: [Admin], responses: { "200": { description: OK } } }
post:
tags: [Admin]
requestBody:
content:
application/json:
schema: { type: object, required: [name], properties: { name: { type: string }, limits: { $ref: "#/components/schemas/Limits" } } }
responses: { "201": { description: Dibuat } }
/admin/settings/throttle:
get:
tags: [Admin]
summary: Pengaturan throttle + status jeda per provider
responses: { "200": { description: OK } }
put:
tags: [Admin]
requestBody:
content:
application/json:
schema:
type: object
properties:
providers:
type: object
description: "Kunci: gmail, yahoo, microsoft, other"
additionalProperties: { type: object, properties: { per_minute: { type: integer } } }
warmup_curve: { type: array, items: { type: integer }, description: "Kuota harian per provider untuk hari 0, 1, 2, ..." }
broadcast_share: { type: number, description: "Bagian kuota warmup untuk broadcast (0..1), default 0,7" }
pause_minutes: { type: integer, description: "Lama jeda provider setelah respons rate-limit, default 15" }
responses: { "200": { description: OK }, "422": { $ref: "#/components/responses/Problem" } }
/admin/settings/relay-fallback:
get:
tags: [Admin]
summary: Konfigurasi smart host (password tidak pernah dikembalikan)
responses: { "200": { description: OK } }
put:
tags: [Admin]
requestBody:
content:
application/json:
schema:
type: object
properties:
enabled: { type: boolean }
host: { type: string }
port: { type: integer }
tls: { type: string, enum: [starttls, implicit] }
username: { type: string }
password: { type: string, description: Kosong = tidak diubah }
providers: { type: array, items: { type: string }, description: Kosong = semua provider }
auto_on_listing: { type: boolean, description: Aktifkan otomatis bila IP masuk blocklist }
responses: { "200": { description: OK }, "422": { $ref: "#/components/responses/Problem" } }
/admin/ips:
get: { tags: [Admin], summary: IP pengirim + status warmup dan blocklist, responses: { "200": { description: OK } } }
post:
tags: [Admin]
requestBody: { content: { application/json: { schema: { type: object, required: [address], properties: { address: { type: string }, warmup: { type: boolean } } } } } }
responses: { "201": { description: Ditambahkan } }
/admin/ips/{address}:
patch:
tags: [Admin]
parameters: [{ in: path, name: address, required: true, schema: { type: string } }]
requestBody: { content: { application/json: { schema: { type: object, properties: { warmup: { type: boolean } } } } } }
responses: { "200": { description: OK } }
/admin/ips/{address}/check-blocklists:
post:
tags: [Admin]
parameters: [{ in: path, name: address, required: true, schema: { type: string } }]
responses: { "200": { description: Hasil cek DNSBL per zone (listed, clean, unknown) } }
/admin/tenants/{id}:
parameters: [{ $ref: "#/components/parameters/id" }]
get: { tags: [Admin], responses: { "200": { description: OK } } }
patch:
tags: [Admin]
summary: Ubah nama, status (active/paused), atau kuota
responses: { "200": { description: OK } }
components:
securitySchemes:
bearer: { type: http, scheme: bearer }
parameters:
id: { in: path, name: id, required: true, schema: { type: string } }
responses:
Problem:
description: Error (RFC 9457)
content: { application/problem+json: { schema: { $ref: "#/components/schemas/Problem" } } }
schemas:
Mailbox:
type: object
properties:
id: { type: string, example: mbx_01J... }
address: { type: string, example: contact@client1.com }
domain_id: { type: string }
name: { type: string }
quota_bytes: { type: integer, description: 0 berarti tanpa batas }
used_bytes: { type: integer }
enabled: { type: boolean }
daily_send_limit: { type: integer, description: Batas penerima per hari saat mengirim dari Outlook/HP/webmail }
send_paused: { type: boolean, description: Pengiriman dijeda (manual atau otomatis) }
send_paused_at: { type: string, format: date-time, nullable: true }
send_paused_reason: { type: string }
created_at: { type: string, format: date-time }
updated_at: { type: string, format: date-time }
MailboxInput:
type: object
properties:
address: { type: string, description: Wajib saat membuat; tidak bisa diubah }
name: { type: string }
password: { type: string, minLength: 10, writeOnly: true }
quota_mb: { type: integer, minimum: 0, maximum: 1048576, default: 2048, description: 0 berarti tanpa batas }
enabled: { type: boolean }
daily_send_limit: { type: integer, minimum: 0, maximum: 100000, default: 500 }
send_paused: { type: boolean, description: true menjeda pengiriman, false mengaktifkan lagi }
Problem:
type: object
properties:
type: { type: string }
title: { type: string }
status: { type: integer }
detail: { type: string }
errors: { type: object, additionalProperties: { type: string } }
SendRequest:
type: object
required: [from, to]
properties:
from: { type: string, description: Harus dari verified domain milik tenant }
to: { type: array, items: { type: string } }
cc: { type: array, items: { type: string } }
bcc: { type: array, items: { type: string } }
reply_to: { type: string }
subject: { type: string }
html: { type: string }
text: { type: string }
attachments:
type: array
items:
type: object
required: [filename, content]
properties:
filename: { type: string }
content: { type: string, contentEncoding: base64 }
content_type: { type: string }
headers: { type: object, additionalProperties: { type: string } }
tags: { type: array, maxItems: 10, items: { type: string } }
metadata: { type: object, additionalProperties: { type: string } }
template_id: { type: string }
variables: { type: object }
stream: { type: string, enum: [transactional, broadcast], default: transactional }
scheduled_at: { type: string, format: date-time, description: Maksimal 72 jam ke depan }
SendResult:
type: object
properties:
id: { type: string, example: msg_01J... }
status: { type: string, enum: [queued, sent, rejected, partial] }
RecipientStatus: { type: string, enum: [queued, deferred, sent, bounced, rejected, canceled] }
EventType: { type: string, enum: [queued, sent, delivered, deferred, bounced, complained, opened, clicked, unsubscribed, rejected, inbound] }
Message:
type: object
properties:
id: { type: string }
status: { type: string, description: Ringkasan dari status recipient (queued, deferred, sent, bounced, rejected, canceled, partial) }
stream: { type: string }
from: { type: string }
subject: { type: string }
tags: { type: array, items: { type: string } }
metadata: { type: object }
test: { type: boolean }
scheduled_at: { type: [string, "null"], format: date-time }
created_at: { type: string, format: date-time }
recipients:
type: array
items:
type: object
properties:
email: { type: string }
kind: { type: string, enum: [to, cc, bcc] }
status: { $ref: "#/components/schemas/RecipientStatus" }
attempts: { type: integer }
last_error: { type: [string, "null"] }
events:
type: array
items:
type: object
properties:
type: { $ref: "#/components/schemas/EventType" }
recipient: { type: string }
data: { type: object }
created_at: { type: string, format: date-time }
Domain:
type: object
properties:
id: { type: string }
name: { type: string }
type: { type: string }
verified: { type: boolean }
dns_ok: { type: [boolean, "null"], description: "Hasil cek terakhir: semua record wajib masih terpasang" }
verified_at: { type: [string, "null"], format: date-time }
last_check_at: { type: [string, "null"], format: date-time }
DomainList: { type: object, properties: { data: { type: array, items: { $ref: "#/components/schemas/Domain" } } } }
DnsRecords:
type: object
properties:
records:
type: array
items:
type: object
properties:
purpose: { type: string, enum: [dkim, spf, return_path, dmarc, mx] }
type: { type: string, enum: [TXT, CNAME, MX] }
name: { type: string }
value: { type: string }
required: { type: boolean }
ok: { type: boolean }
TemplateInput:
type: object
required: [name, subject]
properties: { name: { type: string }, subject: { type: string }, html: { type: string }, text: { type: string } }
Template:
allOf:
- $ref: "#/components/schemas/TemplateInput"
- type: object
properties: { id: { type: string }, version: { type: integer } }
Webhook:
type: object
properties:
id: { type: string }
url: { type: string }
event_types: { type: array, items: { $ref: "#/components/schemas/EventType" } }
enabled: { type: boolean }
Limits:
type: object
properties:
daily_send: { type: integer, description: 0 = tanpa batas }
max_bounce_rate: { type: number, description: "Ambang jeda otomatis hard bounce (0,05 = 5%); 0 = default" }
max_complaint_rate: { type: number, description: "Ambang jeda otomatis complaint (0,001 = 0,1%); 0 = default" }
min_volume: { type: integer, description: "Penerima minimum dalam 24 jam sebelum ambang berlaku; 0 = default 50" }
min_hard_bounces: { type: integer, description: "Jumlah hard bounce minimum sebelum jeda; 0 = default 5" }
min_complaints: { type: integer, description: "Jumlah complaint minimum sebelum jeda; 0 = default 3" }