-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
798 lines (796 loc) · 23 KB
/
openapi.yaml
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
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
openapi: 3.0.2
info:
title: Voluble API
version: "1.0"
description: >
This is the OpenAPI specification for the Voluble messaging service API.
Current API status:![OpenAPI Validity
Status](http://validator.swagger.io/validator?url=https://raw.githubusercontent.com/calmcl1/voluble/master/openapi.yaml)
contact:
email: mail@callum-mclean.co.uk
name: Cal McLean
servers:
- url: "https://voluble-poc.herokuapp.com/v1"
externalDocs:
description: Find out more about the Voluble architecture
url: "https://voluble.gitbook.io/docs/"
tags:
- name: Contacts
description: All operations regarding Contact objects
- name: Messages
description: All operations regarding Message objects
- name: Services
description: All operations regarding Service/plugin objects
- name: Servicechains
description: All operations regarding Servicechain objects
- name: Organizations
description: All operations regarding Organization objects
components:
responses:
"400":
description: Data supplied is invalid
"404":
description: No object found with the specified ID
"410":
description: Object with specified ID has already been deleted
"500":
description: Internal server error
parameters:
org-id:
in: path
name: org-id
required: true
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
allowEmptyValue: false
schema:
type: string
nullable: false
format: uuid
pattern: >-
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}
description: The Organization that owns this resource
schemas:
Contact:
type: object
properties:
id:
type: string
description: UUID for this Contact within Voluble
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
readOnly: true
nullable: false
format: uuid
pattern: >-
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}
title:
type: string
description: The title of the Contact (Mr/Mrs, etc.)
example: Mr
nullable: false
first_name:
type: string
description: The first name of the Contact
example: John
nullable: false
surname:
type: string
description: The surname of the Contact
example: Cleese
nullable: false
email_address:
type: string
description: >-
The email address for the contact, that will be passed to Auth0 for
authentication
example: myname@emailprovider.com
nullable: false
phone_number:
type: string
description: >-
The E164-formatted phone number for the Contact that will be used
for fallback SMS messaging
example: "+442071838750"
nullable: false
OrganizationId:
type: string
description: >-
The UUID of the Organization within Voluble that this Contact
belongs to
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
nullable: false
ServicechainId:
type: string
description: >-
The UUID of the default servicechain that will be used to send
messages to the Contact
nullable: false
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
Message:
type: object
properties:
id:
type: string
description: The UUID of the Message within Voluble
readOnly: true
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
nullable: false
body:
type: string
description: The text content of the Message that is transmitted
example: Hi! Voluble has delivered this message to you!
nullable: true
ServicechainID:
type: string
description: >-
The UUID of the of the Servicechain within Voluble to be used to
send the message
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
nullable: false
contact:
type: string
nullable: false
description: >-
The UUID of the Contact related to this message (i.e. sender or
recipient) within Voluble
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
is_reply_to:
type: string
nullable: true
description: >-
The UUID of the Message that this Message is a reply to. NULL if
this is message was not a reply to a previous message
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
user:
type: string
nullable: true
description: >-
The UUID of the User that send the Message, if this is an outbound Message.
Otherwise, null.
readOnly: true
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
direction:
type: string
enum:
- INBOUND
- OUTBOUND
description: >-
Describes which direction the message was moving (i.e. who sent the
message): `OUTBOUND` if the message was sent from Voluble to a
Contact; `INBOUND` if the message was sent by a Contact to Voluble.
nullable: false
readOnly: true
sent_time:
type: number
nullable: false
description: The UNIX timestamp of when the message was sent.
example: 1568548864
readOnly: true
message_state:
type: string
description: >-
Describes the current state of the message - `SENT`, `FAILED`,
`DELIVERED`, etc.
nullable: false
readOnly: true
enum:
- MSG_PENDING
- MSG_SENDING
- MSG_DELIVERED_SERVICE
- MSG_DELIVERED_USER
- MSG_READ
- MSG_REPLIED
- MSG_FAILED
- MSG_ARRIVED
Organization:
type: object
properties:
id:
type: string
nullable: false
readOnly: true
description: The UUID of the Organization within Voluble
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
name:
type: string
description: The human-friendly name of the Organization
nullable: false
example: MyCorp
phone_number:
type: string
description: >-
The E164-formatted phone number where all SMSs from Voluble on
behalf of the Organization will originate
nullable: false
example: "+442071838750"
Service:
type: object
properties:
id:
type: string
nullable: false
readOnly: true
description: The UUID of the Service within Voluble
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
name:
type: string
nullable: false
description: The human-readable name of the Service that can send Messages
example: My Awesome Messaging Service
directory_name:
type: string
nullable: false
description: >-
The name of the subdirectory below the global Voluble plugin
directory where the plugins' `plugin.js` is located.
example: awesome-msg-svc
ServiceInServicechain:
type: object
properties:
id:
type: string
nullable: false
readOnly: true
description: The UUID of the ServiceInServicechain within Voluble
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
service:
type: string
nullable: false
description: >-
The UUID of the Service with Voluble to be used at this priority in
the Servicechain
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
priority:
type: integer
nullable: false
example: 0
Servicechain:
type: object
properties:
id:
type: string
nullable: false
readOnly: true
description: The UUID of the Servicechain within Voluble
example: c616d114-4f68-4dba-b976-cd5ae0aa359d
services:
type: array
items:
$ref: "#/components/schemas/ServiceInServicechain"
maxItems: 10
name:
type: string
nullable: false
description: The human-readable name of the Servicechain
example: Online-only SC
User:
type: object
properties:
id:
type: string
nullable: false
readOnly: true
description:
The Auth0-generated ID of the corresponding user in Auth0 for
authentication management.
example: auth0|c616d114-4f68-4dba-b976-cd5ae0aa359d
securitySchemes:
jwt:
type: http
scheme: bearer
bearerFormat: JWT
description: "A JWT bearer token generated by Auth0, representing the User."
paths:
/orgs/{org-id}/users:
parameters:
- $ref: "#/components/parameters/org-id"
get:
tags:
- Users
description: >-
Returns a list of the Users available in the Organization, starting at `offset`.
security:
- jwt: []
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/User"
"500":
$ref: "#/components/responses/500"
/orgs/{org-id}/contacts:
parameters:
- $ref: "#/components/parameters/org-id"
get:
tags:
- Contacts
summary: >-
Returns a list of the first 100 Contacts available to the User in the
Organization
description: >-
Returns a list of the first 100 Contacts available to the User in the
Organization, starting at `offset`.
security:
- jwt: []
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Contact"
maxItems: 100
"500":
$ref: "#/components/responses/500"
post:
tags:
- Contacts
summary: Allows the creation of a new Contact
security:
- jwt: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Contact"
responses:
"201":
description: "OK: User created"
content:
application/json:
schema:
$ref: "#/components/schemas/Contact"
links:
GetContactById:
operationId: getContact
parameters:
contact_id: "$response.body#/id"
"400":
$ref: "#/components/responses/400"
"500":
$ref: "#/components/responses/500"
/orgs/{org-id}/contacts/{contact_id}:
parameters:
- $ref: "#/components/parameters/org-id"
- name: contact_id
in: path
required: true
description: The ID of the Contact to manipulate
schema:
type: string
get:
tags:
- Contacts
operationId: getContact
summary: Retrieves a particular Contact
security:
- jwt: []
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Contact"
"404":
$ref: "#/components/responses/404"
"500":
$ref: "#/components/responses/500"
put:
tags:
- Contacts
operationId: modifyContact
summary: Modifies a specific contact
security:
- jwt: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Contact"
responses:
"200":
description: Contact modified successfully
content:
application/json:
schema:
$ref: "#/components/schemas/Contact"
links:
GetContactById:
operationId: getContact
parameters:
contact_id: "$response.body#/id"
"400":
$ref: "#/components/responses/400"
"404":
$ref: "#/components/responses/404"
"500":
$ref: "#/components/responses/500"
delete:
tags:
- Contacts
operationId: deleteContact
summary: Deletes a particular contact from Voluble
security:
- jwt: []
responses:
"200":
description: Contact deleted successfully
"400":
$ref: "#/components/responses/400"
"404":
$ref: "#/components/responses/404"
"410":
$ref: "#/components/responses/410"
"500":
$ref: "#/components/responses/500"
/orgs/{org-id}/messages:
parameters:
- $ref: "#/components/parameters/org-id"
get:
tags:
- Messages
description: >-
Returns a list of the first 100 Messages available to the User, starting
at `offset`
summary: Returns a list of the first 100 Messages available to the User
security:
- jwt: []
parameters:
- name: offset
in: query
required: false
schema:
type: integer
default: 0
minimum: 0
format: int64
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Message"
maxItems: 100
"500":
$ref: "#/components/responses/500"
post:
tags:
- Messages
summary: Creates and sends a new Message
security:
- jwt: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Message"
responses:
"201":
description: >-
Message attempt successfully created; the created Message will be
returned
content:
application/json:
schema:
$ref: "#/components/schemas/Message"
links:
GetMessageById:
operationId: getMessage
parameters:
contact_id: "$response.body#/id"
"400":
$ref: "#/components/responses/400"
"500":
$ref: "#/components/responses/500"
/orgs/{org-id}/messages/{message_id}:
parameters:
- $ref: "#/components/parameters/org-id"
- name: message_id
description: The UUID of the Message within Voluble to manipulate
required: true
in: path
schema:
type: string
get:
tags:
- Messages
operationId: getMessage
summary: Retrieves a specific Message
security:
- jwt: []
responses:
"200":
description: Message retrieved successfully
content:
application/json:
schema:
$ref: "#/components/schemas/Message"
"404":
$ref: "#/components/responses/404"
"500":
$ref: "#/components/responses/500"
/services:
get:
tags:
- Services
summary: >-
Returns a list of all of the Services available to the User in the
Organization
description: >-
Returns a list of all of the Services available to the User in the
Organization
security:
- jwt: []
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Service"
maxItems: 100
"500":
$ref: "#/components/responses/500"
/services/{service_id}:
parameters:
- name: service_id
description: The UUID of the Service within Voluble to manipulate
required: true
in: path
schema:
type: string
get:
tags:
- Services
summary: Retrieves a specified Service
security:
- jwt: []
responses:
"200":
description: Retrieved service OK
content:
application/json:
schema:
$ref: "#/components/schemas/Service"
"404":
$ref: "#/components/responses/404"
"500":
$ref: "#/components/responses/500"
/orgs/{org-id}/servicechains:
parameters:
- $ref: "#/components/parameters/org-id"
get:
tags:
- Servicechains
summary: >-
Returns a list of all of the Servicechains available to the User in the
Organization
description: >-
Returns a list of all of the Servicechains available to the User in the
Organization
security:
- jwt: []
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Servicechain"
maxItems: 100
"500":
$ref: "#/components/responses/500"
post:
tags:
- Servicechains
summary: Creates a new Servicechain
security:
- jwt: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Servicechain"
responses:
"201":
description: Servicechain created successfully
content:
application/json:
schema:
$ref: "#/components/schemas/Servicechain"
"400":
$ref: "#/components/responses/400"
"500":
$ref: "#/components/responses/500"
/orgs/{org-id}/servicechains/{servicechain_id}:
parameters:
- $ref: "#/components/parameters/org-id"
- name: servicechain_id
description: The UUID of the Servicechain within Voluble to manipulate
required: true
in: path
schema:
type: string
get:
tags:
- Servicechains
security:
- jwt: []
summary: Retrieves the Servicechain with the specified ID
responses:
"200":
description: Servicechain retrieved successfully
content:
application/json:
schema:
$ref: "#/components/schemas/Servicechain"
"404":
$ref: "#/components/responses/404"
"500":
$ref: "#/components/responses/500"
put:
tags:
- Servicechains
security:
- jwt: []
summary: Modifies the Servicechain with the specified ID
requestBody:
required: true
description: The new data to replace the specified parameters with
content:
application/json:
schema:
$ref: "#/components/schemas/Servicechain"
responses:
"200":
description: Servicechain modified successfully
content:
application/json:
schema:
$ref: "#/components/schemas/Servicechain"
"400":
$ref: "#/components/responses/400"
"404":
$ref: "#/components/responses/404"
"500":
$ref: "#/components/responses/500"
delete:
tags:
- Servicechains
security:
- jwt: []
summary: Removes the Servicechain with the specified ID
responses:
"200":
description: Servicechain deleted successfully
"400":
$ref: "#/components/responses/400"
"404":
$ref: "#/components/responses/404"
"410":
$ref: "#/components/responses/410"
"500":
$ref: "#/components/responses/500"
/orgs:
get:
tags:
- Organizations
summary: Returns a list of all of the Organizations available
description: Returns a list of all of the Organizations available
security:
- jwt: []
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Organization"
maxItems: 100
"500":
$ref: "#/components/responses/500"
post:
tags:
- Organizations
summary: Creates a new Organizations
security:
- jwt: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Organization"
responses:
"201":
description: Organization created successfully
content:
application/json:
schema:
$ref: "#/components/schemas/Organization"
"400":
$ref: "#/components/responses/400"
"500":
$ref: "#/components/responses/500"
/orgs/{org-id}:
parameters:
- $ref: "#/components/parameters/org-id"
get:
tags:
- Organizations
security:
- jwt: []
summary: Retrieves the Organization with the specified ID
responses:
"200":
description: Organization retrieved successfully
content:
application/json:
schema:
$ref: "#/components/schemas/Organization"
"404":
$ref: "#/components/responses/404"
"500":
$ref: "#/components/responses/500"
put:
tags:
- Organizations
security:
- jwt: []
summary: Modifies the Organization with the specified ID
requestBody:
required: true
description: The new data to replace the specified parameters with
content:
application/json:
schema:
$ref: "#/components/schemas/Organization"
responses:
"200":
description: Organization modified successfully
content:
application/json:
schema:
$ref: "#/components/schemas/Organization"
"400":
$ref: "#/components/responses/400"
"404":
$ref: "#/components/responses/404"
"500":
$ref: "#/components/responses/500"
delete:
tags:
- Organizations
security:
- jwt: []
summary: Removes the Organization with the specified ID
responses:
"200":
description: Organization deleted successfully
"400":
$ref: "#/components/responses/400"
"404":
$ref: "#/components/responses/404"
"410":
$ref: "#/components/responses/410"
"500":
$ref: "#/components/responses/500"