-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
2186 lines (2174 loc) · 82.9 KB
/
openapi.yaml
File metadata and controls
2186 lines (2174 loc) · 82.9 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
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
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: SIP.TG REST API
version: '1.0'
description: |-
REST API for SIP.TG partners
# Error handling
If an error occurs, the result may contain the following fields:
| **Error field** | **Description** |
|-----------------|-----------------------------------------------------|
| `error` | Error code |
| `description` | (optional) A more detailed description of the error |
| `field` | (optional) Parameter in which there is an error |
## Common error codes
| **Error code** | **Description** |
|----------------|-------------------------------------------------|
| `unauthorized` | Authorization by token failed |
| `not_found` | Object not found |
| `wrong_value` | An invalid parameter value is specified |
| `max_accounts` | The limit of the number of objects is exceeded |
| `multiple_ids` | Prohibits a group change of the parameter value |
| `db` | Database error |
| `http_error` | General HTTP error |
| `tariff` | Subscription limitations |
| `no_user` | Telegram user is not specified |
| `unknown` | Unknown error |
## Errors in SIP account change and activation
| **Error code** | **Description** |
|-----------------------|----------------------------------------------------------------------------------------|
| `params` | Invalid connection parameters |
| `timeout` | SIP server waiting time exceeded |
| `id` | SIP account not found |
| `busy` | Another connection/disconnection operation is active |
| `session` | Failed to activate the associated Telegram session |
| `worker` | Worker is unavailable |
| `account` | Wrong type of SIP account |
| `restricted` | Option change is prohibited |
| `noauth` | SIP server returned error 401 |
| `forbidden` | SIP server returned error 403 |
| `noroute` | SIP server returned error 404 |
| `no_registrar` | (for account type `pbx-siptg`) No connection from the PBX |
| `address_unavailable` | (for account type `ip-ip`) IP address does not respond to the test request |
| `reconnecting` | (for account type `siptg-pbx` and `softphone`) SIP server is unavailable; reconnecting |
| `no_username` | (for account type `siptg-pbx` and `softphone`) SIP username is not specified |
| `no_password` | (for account type `siptg-pbx` and `softphone`) SIP password is not specified |
| `no_domain` | (for account type `siptg-pbx` and `softphone`) SIP domain and proxy are not specified |
| `no_address_port` | (for account type `ip-ip`) Endpoint address and port are not specified |
## Errors in creating a Telegram session
| **Error code** | **Description** |
|--------------------|----------------------------------------------------------------------------|
| `unregistered` | Phone number not registered in Telegram |
| `wrong_state` | The session state does not allow authorization (see the `expected` field) |
| `wrong_operation` | The session state does not allow this operation (see the `expected` field) |
| `code_invalid` | An invalid one-time code has been entered |
| `password_invalid` | An invalid 2FA password has been entered |
| `telegram_error` | Telegram error (see `code` and `message` fields) |
| `timeout` | A time for session creating is out |
## Errors in subscription activation
| **Error code** | **Description** |
|----------------------|----------------------------------------------------------|
| `insufficient` | Insufficient balance (see `cost` and `underpaid` fields) |
| `already_paid` | Invoice has already been paid |
| `incorrect_currency` | Incorrect currency |
| `activate_denied` | Activation of the subscription is not allowed |
| `no_changes` | No changes |
| `paysystem_error` | Payment system error |
| `not_processed` | Not processed |
| `no_payment_method` | No credit card (account) is linked |
## Errors with promo codes
| **Error code** | **Description** |
|----------------|------------------------------------------------------------------|
| `invalid` | Code is not valid |
| `tariff` | Code is not valid for the subscription |
| `personal` | Code is valid only on the account of its owner |
| `public` | Code is not valid on the account of its owner |
| `count_total` | Code was used the maximum number of times |
| `count_user` | Code was used the maximum number of times on your account |
| `payments` | Code can only be used for the first payment |
| `refs` | Code can be used only for the first connection with the referrer |
| `date_begin` | Code validity has not started yet |
| `date_end` | Code expired |
| `currency` | Code is not valid for the subscription currency |
## Errors with balance transfer
| **Error code** | **Description** |
|----------------------|-----------------------------------|
| `currency_missmatch` | Recipient has different balance |
| `forbidden_receive` | Forbidden to receive the balance |
| `forbidden_send` | Forbidden to send the balance |
| `insufficient` | Insufficient funds on the balance |
contact:
name: SIP.TG support
url: 'https://t.me/siptg_support'
email: support@sip.tg
paths:
/whoami:
summary: ''
get:
tags: []
summary: Info about user of token
description: Returns the information about the user of token
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
user_id:
description: Token owner's Telegram user ID
type: integer
balance:
type: string
description: User balance
credit:
type: string
description: Credit limit
credit_expire:
type: integer
description: Expiration timestamp of credit
debt:
type: string
description: Debt to prolong the credit expiration
currency:
type: string
description: Balance currency
lang:
type: string
description: Language
rewards:
type: object
description: Reward balances
properties:
'{currency}':
type: string
description: 'Rewards amount in `{currency}`'
required:
- '{currency}'
required:
- user_id
- balance
- currency
- lang
examples: {}
operationId: get-whoami
description: ''
/storages:
summary: ''
get:
tags: []
summary: List of sessions storages
description: Lists the sessions storages available to the user (private and shared)
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
type: object
description: Storage
properties:
id:
type: string
description: Storage ID
pattern: ^\d+$
name:
type: string
description: Storage name
address:
type: string
description: 'Address:port of the storage'
owner_id:
type: integer
description: Telegram ID of the storage owner
required:
- id
- name
- address
- owner_id
operationId: get-storages
description: ''
/sessions:
summary: ''
get:
tags: []
parameters:
- in: query
description: 'Search sample (username, user ID, or phone number)'
required: false
deprecated: false
allowEmptyValue: false
name: search
schema:
type: string
- in: query
description: Offset from which to display results
deprecated: false
schema:
type: integer
allowEmptyValue: false
name: offset
summary: List of Telegram sessions
description: Lists available Telegram sessions (private and shared for administration)
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- offset
- count
- count_tariff_shared
- count_tariff_allowed
- sessions
properties:
offset:
type: integer
description: Real result offset
count:
type: integer
description: Total number of results
count_tariff_shared:
type: integer
x-stoplight:
id: wl5f0inncznpu
description: Amount of sessions sharing your tariff with
count_tariff_allowed:
type: integer
x-stoplight:
id: u63g7eqqscggd
description: Allowed amount of sessions to share your tariff with
sessions:
type: array
items:
type: object
required:
- id
- user_id
- username
- phone
- storage_id
- active
- admin_tariff
- comment
properties:
id:
type: string
description: Session ID
pattern: ^\d+$
user_id:
type: integer
description: Telegram user ID
username:
type:
- string
- 'null'
description: Telegram username
phone:
type:
- string
- 'null'
description: Phone number of the account
pattern: ^\d+$
storage_id:
type: string
description: Sessions storage ID
pattern: ^\d+$
active:
type: boolean
description: Mark of active session
admin_tariff:
type: boolean
description: Share administrator's subscription with this session
comment:
type: string
x-stoplight:
id: y0mdk4vm8zqve
description: Comment for admin
operationId: get-sessions
description: ''
post:
description: Creates a new or prepares a terminated Telegram session ID for the authorization procedure. Prepared for login session is valud during 5 minutes.
summary: Prepare Telegram session for login
parameters: []
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
id:
type: integer
description: ID of a terminated session
storage_id:
type: integer
description: ID of a new sessions storage
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: The assigned ID for the new session
pattern: ^\d+$
storage_id:
type: string
description: The ID of the assigned session storage
pattern: ^\d+$
required:
- id
- storage_id
operationId: post-sessions
'/sessions/{id}/login':
summary: ''
post:
tags: []
summary: Login into Telegram session
description: |-
Controls the process of creating (authorizing) a new Telegram session.
Possible **Errors in creating a Telegram session**.
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
required:
- storage_id
- operation
properties:
storage_id:
type: integer
description: Storage ID
operation:
type: string
enum:
- phone_input
- code_login
- code_recovery_get
- code_recovery
- email_input
- code_email
- bot_token_input
- qr_code_get
- qr_code_wait
- password_input
description: |-
Operation of session creation phase:
- `phone_input` — start authorization with a phone number scheme;
- `code_login` — input a code from Telegram service account/SMS/Fragment...;
- `code_recovery_get` — request a recovery code by email;
- `code_recovery` — input a recovery code from email;
- `email_input` — an additional step to request email address to send a confirmation code to;
- `code_email` — input a confirmation code from email;
- `bot_token_input` — bot authorization;
- `qr_code_get` — authorization by using QR code;
- `qr_code_wait` — a pooling request for a new QR code or succesfull authorization (do not execute more than once every 5 seconds);
- `password_input` — input 2FA password.
phone:
type: integer
description: (for operation `phone_input`) Phone number registered in Telegram
bot_token:
type: string
description: (for operation `bot_token_input`) Bot authorization token
code:
type: integer
description: '(for operations `code_login`, `code_recovery`, `code_email`) Confirmation code (from the service account or from email)'
password:
type: string
x-stoplight:
id: 9ny7k15qo4l9q
format: password
description: (for operation `password_input`) 2FA password
email:
type: string
description: (for operation `email_input`) Email address connected with Telegram account
format: email
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
next:
type:
- string
- array
enum:
- phone_input
- code_login
- code_recovery
- email_input
- code_email
- bot_token_input
- qr_code_get
- qr_code_wait
- password_input
- code_recovery_get
description: Expected next operation
nullable: true
items:
type: string
email:
type: string
description: 2FA email address pattern
format: email
qr_code:
type: string
description: URL for QR code generation
password:
type: string
description: New 2FA password
format: password
user_id:
type: integer
description: Telegram user ID of the created session
required:
- next
operationId: post-sessions-id-login
parameters:
- schema:
type: integer
name: id
in: path
description: Session ID
required: true
'/sessions/{id}/configure':
summary: ''
post:
tags: []
summary: Configure Telegram account
description: Configure Telegram account related to the session
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
settings:
x-stoplight:
id: lkqovhp6nfw44
description: |-
Setting to be applied to the account.
`calls_off_other_sessions` — disable receiving calls by other Telegram sessions;
`calls_allow_everybody` — allow receiving calls from all Telegram users, not only from contacts;
`calls_allow_p2p` — allow peer-to-peer calls;
`groups_disallow` — disallow inviting the account to groups.
type: array
items:
x-stoplight:
id: 0xiny95h3utzc
type: string
enum:
- calls_off_other_sessions
- calls_allow_everybody
- calls_allow_p2p
- groups_disallow
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
configured:
type: boolean
x-stoplight:
id: pp5k2bipupmr4
description: Result of configuring the account
error:
type: string
x-stoplight:
id: es6ew58wqt9zm
description: Error code
settings:
type: array
x-stoplight:
id: cxljsk4lxklsm
description: Lists options which was not applied in full
items:
x-stoplight:
id: vdf4cddi4bjih
enum:
- calls_off_other_sessions
- calls_allow_everybody
- calls_allow_p2p
- groups_disallow
operationId: post-sessions-id-configure
x-stoplight:
id: c0teytpn1c2zn
parameters:
- schema:
type: integer
name: id
in: path
description: Session ID
required: true
'/sessions/{id}':
get:
tags: []
parameters: []
description: Returns full details of the specified Telegram session
operationId: get-sessions-id
summary: Info about Telegram session
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- user_id
- username
- phone
- storage_id
- active
- dtmf_in
- dtmf_out
- redial
- lines
- msg_proc
- callback
- admin_tariff
- comment
- empty_bot_user_id
- empty_bot_query
properties:
user_id:
type: integer
description: Telegram user ID
username:
description: Telegram username of the account
type:
- string
- 'null'
phone:
type:
- string
- 'null'
description: Phone number of the account
pattern: ^\d+$
storage_id:
type: string
description: Session storage ID
pattern: ^\d+$
active:
type: boolean
description: Mark of active session
dtmf_in:
type: boolean
description: Display DTMF for SIP→Telegram calls
dtmf_out:
type: boolean
description: Display DTMF for Telegram→SIP calls
redial:
type: boolean
description: Display Callback button
lines:
type: boolean
description: Display Lines button (callback through the line)
msg_proc:
type: boolean
description: 'Message processing (answering machine, call any number through PBX)'
callback:
type: boolean
description: Callback feature for calls
admin_tariff:
type: boolean
description: Share administrator's subscription with this session
comment:
type: string
x-stoplight:
id: 2t5241z80ztpv
description: Comment for admin
empty_bot_user_id:
type:
- integer
- 'null'
x-stoplight:
id: hc1vq4ayx1xsw
description: Inline bot user ID to use when no SIP accounts satisfies to call through
empty_bot_query:
type: string
x-stoplight:
id: l9p8ighid4mfk
description: Inline bot query format
post:
tags: []
summary: Update Telegram session settings
description: Makes changes to settings of the Telegram session
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
dtmf_in:
type: boolean
description: Display DTMF for SIP→Telegram calls
dtmf_out:
type: boolean
description: Display DTMF for Telegram→SIP calls
redial:
type: boolean
description: Display Callback button
lines:
type: boolean
description: Displaying Lines button (callback through the line)
msg_proc:
type: boolean
description: 'Message processing (answering machine, call any number through PBX)'
callback:
type: boolean
description: Callback feature for calls
admin_tariff:
type: boolean
description: Share administrator's subscription with this session
empty_bot_user_id:
type: integer
x-stoplight:
id: qs7v0yan9z1f4
description: Inline bot user ID to use when no SIP accounts satisfies to call through; use `0` to reset
empty_bot_query:
type: string
x-stoplight:
id: agqvvy5o9fv90
description: |-
Inline bot query format; supports variables:
`{text}` — text of the message from user;
`{userid}` — user ID.
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
updated:
type: boolean
description: Updating result
required:
- updated
operationId: post-sessions-id
parameters:
- schema:
type: integer
name: id
in: path
required: true
description: Session ID
delete:
summary: Terminate Telegram session
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
deleted:
type: boolean
description: Result of session termination and data deletion
required:
- deleted
examples: {}
description: 'Ends, deletes or revokes control access to the Telegram session'
operationId: delete-sessions-id
parameters:
- schema:
type: string
enum:
- delete
- logout
- revoke
in: query
name: operation
description: 'Type of delete session operation: `delete` — end session and delete related data; `logout` — end session with data saved; `revoke` — revoke session administration rights without ending session and deleting data'
required: true
'/sessions/{id}/resolve_user/{query}':
parameters:
- schema:
type: integer
name: id
in: path
required: true
description: Telegram session ID
- schema:
type: string
name: query
in: path
required: true
description: Text of the query (phone number or username)
get:
summary: Resolve Telegram User ID
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
user_id:
type: integer
description: Telegram User ID
required:
- user_id
operationId: get-sessions-id-resolve_user-query
description: Gets the Telegram User ID by phone number or username through the specified session
'/sessions/{id}/messages/{code}':
parameters:
- schema:
type: integer
name: id
in: path
required: true
description: Session ID
- schema:
type: string
enum:
- ERROR_ORIGINATE_DIRECT
- ERROR_ORIGINATE_DIRECT_CALLBACK_ON
- ERROR_ORIGINATE_NO_PROVIDER
- ORIGINATE_CHOOSE_LINE
- ERROR_CALLER_ID_UNKNOWN
name: code
in: path
required: true
description: ID of the message
get:
summary: Get custom messages
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
'{lang}':
type:
- string
- 'null'
- array
description: 'Text of the message in HTML markup for the language with code `{code}`'
items:
type: string
operationId: get-sessions-id-messages-code
description: Get the customized messages for auto-reply feature
post:
summary: Set custom message
operationId: post-sessions-id-messages-code
responses:
'200':
description: OK
description: Set the customized messages for auto-reply feature
requestBody:
content:
application/json:
schema:
type:
- object
- string
properties:
'{lang}':
type:
- string
- 'null'
- array
description: 'New value of message in HTML markup for the language with code `{code}`; set `null` to return default value'
items:
type: string
/sip_templates:
get:
summary: List of SIP templates
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
offset:
type: integer
description: Real results offset
count:
type: integer
description: Total number of results
sip_templates:
type: array
description: List of found SIP templates
items:
type: object
properties:
code:
type: string
description: Template code
name:
type: string
description: Display name
free:
type: boolean
description: The mark of the free template (lift the restrictions for the free plan)
formats:
type: string
description: 'List of audio codecs in priority order (see [documentation](https://www.sip.tg/en/docs/codecs))'
dtmf:
type: string
description: 'List of DTMF command methods in priority order (see [documentation](https://www.sip.tg/en/docs/dtmf))'
transport:
type: string
description: The way to connect to the SIP Server
enum:
- udp
- tcp
- tls
out_rule:
type: string
description: 'Number conversion rules (see [documentation](https://www.sip.tg/en/docs/rewrite-rules))'
required:
- code
- name
- free
- formats
- dtmf
- transport
- out_rule
required:
- offset
- count
- sip_templates
operationId: get-sip_templates
description: Lists SIP templates for Softphone mode
parameters:
- schema:
type: string
in: query
name: search
description: 'Search pattern (template code, part of the name)'
- schema:
type: integer
in: query
name: offset
description: Offset from which to output the results
/sip_accounts:
get:
summary: List of SIP accounts
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- count
- offset
- count_active
- count_allowed
properties:
count:
type: integer
description: Total number of results
offset:
type: integer
description: The actual offset of the results
count_active:
type: integer
x-stoplight:
id: 687vvyjog6ufo
description: Amount of active SIP accounts
count_allowed:
type: integer
x-stoplight:
id: ovh78jy2gfnjs
description: Amount of SIP accounts allowed to be active
sip_accounts:
type: array
description: List of found SIP accounts
items:
type: object
required:
- id
- name
- type
- state
properties:
id:
type: string
description: Account ID
pattern: ^\d+$
name:
type: string
description: Account name
type:
type: string
enum:
- softphone
- pbx-siptg
- siptg-pbx
- ip-ip
description: Account type
state:
type: string
enum:
- online
- offline
- error
- restricted
- unverified
description: |-
Account status:
`online` — connected;
`offline` — disconnected;
`error` — connection error;
`restricted` — restricted by subscription;
`unverified` — asigned softphone account must be verified (a succesfull outgoing call should be made through it)
operationId: get-sip_accounts
description: Lists the user's SIP accounts
parameters:
- schema:
type: string
enum:
- gateway
- softphone
in: query
name: mode
description: 'SIP accounts of which mode to obtain: `gateway` — gateway mode; `softphone` — softphone mode'
required: true
- schema:
type: integer
in: query
name: session_id
description: (for Gateway mode) Session ID
- schema:
type: string
in: query
name: search
description: 'Search sample (for Softphone mode; part of SIP template name, login, account name, registrar, Telegram user name; Telegram User ID or phone number)'
- schema:
type: integer
in: query
name: offset
description: Offset from which to display results
post:
summary: Create SIP account
operationId: post-sip_accounts
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
id:
type: integer
description: The ID of the created SIP account
examples: {}
description: Creates a new SIP account
parameters: []
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
type:
type: string
description: Account type
enum:
- softphone
- pbx-siptg
- siptg-pbx