This repository has been archived by the owner on Apr 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
/
spec.json
2101 lines (2101 loc) · 60.6 KB
/
spec.json
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
{
"swagger": "2.0",
"info": {
"title": "Couchbase Lite",
"description": "Documentation for the Couchbase Lite REST API. This page is generated from the Couchbase Lite Swagger spec, the exact same information is also available at [developer.couchbase.com/mobile/swagger/couchbase-lite](http://developer.couchbase.com/mobile/swagger/couchbase-lite/).\n",
"version": "1.4"
},
"host": "localhost:5984",
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": {
"access": {
"name": "access",
"in": "query",
"description": "Indicates whether to include in the response a list of what access this document grants (i.e. which users it allows to access which channels.) This option may only be used from the admin port.",
"type": "boolean",
"default": false
},
"active_only": {
"name": "active_only",
"in": "query",
"description": "Default is false. When true, the changes response doesn't include either deleted documents, or notification for documents that the user no longer has access to.",
"type": "boolean",
"default": false
},
"attachment": {
"in": "path",
"name": "attachment",
"description": "Attachment name",
"type": "string",
"required": true
},
"attachments": {
"in": "query",
"name": "attachments",
"description": "Default is false. Include attachment bodies in response.",
"type": "boolean",
"default": false
},
"atts_since": {
"name": "atts_since",
"in": "query",
"description": "Include attachments only since specified revisions. Does not include attachments for specified revisions.",
"type": "array",
"items": {
"type": "string"
},
"required": false
},
"body": {
"name": "body",
"in": "body",
"description": "The request body",
"schema": {
"type": "string",
"format": "binary"
}
},
"bulkget": {
"in": "body",
"name": "BulkGetBody",
"description": "List of documents being requested. Each array element is an object that must contain an id property giving the document ID. It may contain a rev property if a specific revision is desired. It may contain an atts_since property (as in a single-document GET) to limit which attachments are sent.",
"schema": {
"type": "object",
"properties": {
"docs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Document ID."
}
}
}
}
}
}
},
"channels": {
"in": "query",
"name": "channels",
"description": "Indicates whether to include in the response a channels property containing an array of channels this document is assigned to. (Channels not accessible by the user making the request will not be listed.)",
"type": "boolean",
"default": false
},
"channels_list": {
"in": "query",
"name": "channels",
"description": "A comma-separated list of channel names. The response will be filtered to only documents in these channels. (This parameter must be used with the sync_gateway/bychannel filter parameter; see below.)",
"type": "string",
"required": false
},
"content_type": {
"in": "header",
"name": "Content-Type",
"description": "Attachment Content-Type",
"type": "string"
},
"db": {
"name": "db",
"in": "path",
"description": "Database name",
"type": "string",
"required": true
},
"ddoc": {
"name": "ddoc",
"in": "path",
"description": "Design document name",
"type": "string",
"required": true
},
"descending": {
"name": "descending",
"in": "query",
"description": "Default is false. Return documents in descending order.",
"type": "boolean",
"required": false
},
"doc": {
"name": "doc",
"in": "path",
"description": "Document ID",
"type": "string",
"required": true
},
"doc_ids": {
"in": "query",
"name": "doc_ids",
"description": "A list of document IDs as a valid JSON array. The response will be filtered to only documents with these IDs. (This parameter must be used with the _doc_ids filter parameter; see below.)",
"type": "array",
"items": {
"type": "string"
}
},
"endkey": {
"name": "endkey",
"in": "query",
"description": "If this parameter is provided, stop returning records when the specified key is reached.",
"type": "string",
"required": false
},
"feed": {
"in": "query",
"name": "feed",
"description": "Default is 'normal'. Specifies type of change feed. Valid values are normal, continuous, longpoll, websocket.",
"type": "string",
"default": "normal"
},
"group": {
"in": "query",
"name": "group",
"description": "Group the results using the reduce function to a group or single row.",
"type": "boolean",
"default": false
},
"group_level": {
"in": "query",
"name": "group_level",
"description": "Specify the group level to be used.",
"type": "integer",
"required": false
},
"heartbeat": {
"in": "query",
"name": "heartbeat",
"description": "Default is 0. Interval in milliseconds at which an empty line (CRLF) is written to the response. This helps prevent gateways from deciding the socket is idle and closing it. Only applicable to longpoll or continuous feeds. Overrides any timeout to keep the feed alive indefinitely. Setting to 0 results in no heartbeat.",
"type": "integer",
"default": 0
},
"include_docs": {
"in": "query",
"name": "include_docs",
"description": "Default is false. Indicates whether to include the associated document with each result. If there are conflicts, only the winning revision is returned.",
"type": "boolean",
"default": false
},
"keys": {
"in": "query",
"name": "keys",
"description": "Specify a list of document IDs.",
"type": "array",
"items": {
"type": "string"
},
"required": false
},
"limit": {
"in": "query",
"name": "limit",
"description": "Limits the number of result rows to the specified value. Using a value of 0 has the same effect as the value 1.",
"type": "integer"
},
"local_doc": {
"in": "path",
"name": "local_doc",
"description": "Local document IDs begin with _local/.",
"type": "string",
"required": true
},
"new_edits": {
"name": "new_edits",
"in": "query",
"description": "Default is true. Setting this to false indicates that the request body is an already-existing revision that should be directly inserted into the database, instead of a modification to apply to the current document. (This mode is used by the replicato.) This option must be used in conjunction with the `_revisions` property in the request body.",
"type": "boolean",
"default": true
},
"open_revs": {
"name": "open_revs",
"in": "query",
"description": "Option to fetch specified revisions of the document. The value can be `all` to fetch all leaf revisions or an array of revision numbers (i.e. open_revs=[\"rev1\", \"rev2\"]). If this option is specified the response will be in multipart format. Use the `Accept: application/json` request header to get the result as a JSON object.",
"type": "array",
"items": {
"type": "string"
},
"required": false
},
"rev": {
"name": "rev",
"in": "query",
"description": "Revision identifier of the parent revision the new one should replace. **Required** for document updates.",
"type": "string",
"required": false
},
"rev_delete": {
"name": "rev",
"in": "query",
"description": "Revision identifier of the revision to delete. It must be the identifier of the latest revision in the history.",
"type": "string",
"required": true
},
"revs": {
"in": "query",
"name": "revs",
"description": "Default is false. Indicates whether to include a _revisions property for each document in the response, which contains a revision history of the document. The length of the returned revision tree can be specified with the `revs_limit` querystring parameter.",
"type": "boolean",
"default": false
},
"role": {
"in": "body",
"name": "role",
"description": "The message body is a JSON document that contains the following objects.",
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the role that will be created"
},
"admin_channels": {
"type": "array",
"description": "Array of channel names to give the role access to",
"items": {
"type": "string"
}
}
}
}
},
"sessionid": {
"name": "sessionid",
"in": "path",
"description": "Session id",
"type": "string",
"required": true
},
"startkey": {
"name": "startkey",
"in": "query",
"description": "Returns records starting with the specified key.",
"type": "string",
"required": false
},
"since": {
"in": "query",
"name": "since",
"description": "Starts the results from the change immediately after the given sequence ID. Sequence IDs should be considered opaque; they come from the last_seq property of a prior response.",
"type": "integer",
"required": false
},
"style": {
"in": "query",
"name": "style",
"description": "Default is 'main_only'. Number of revisions to return in the changes array. main_only returns the current winning revision, all_docs returns all leaf revisions including conflicts and deleted former conflicts.",
"type": "string",
"default": "main_only"
},
"timeout": {
"in": "query",
"name": "timeout",
"description": "Default is 300000. Maximum period in milliseconds to wait for a change before the response is sent, even if there are no results. Only applicable for longpoll or continuous feeds. Setting to 0 results in no timeout.",
"type": "integer",
"default": 300000
},
"update_seq": {
"in": "query",
"name": "update_seq",
"description": "Default is false. Indicates whether to include the update_seq (document sequence ID) property in the response.",
"type": "boolean",
"default": false
},
"view": {
"name": "view",
"in": "path",
"description": "View name",
"type": "string",
"required": true
},
"batch": {
"in": "query",
"name": "batch",
"description": "Stores the document in batch mode. To use, set the value to ok.",
"type": "string",
"required": false
},
"bulkdocs": {
"in": "body",
"name": "body",
"description": "The request body",
"schema": {
"properties": {
"all_or_nothing": {
"description": "Indicates whether to use all-or-nothing semantics for the database commit mode",
"type": "boolean",
"default": false
},
"docs": {
"description": "List containing new or updated documents. Each object in the array can contain the following properties _id, _rev, _deleted, and values for new and updated documents.",
"type": "array",
"items": {
"type": "object"
}
},
"new_edits": {
"description": "Indicates whether to assign new revision identifiers to new edits.",
"type": "boolean",
"default": true
}
}
}
},
"changes_body": {
"in": "body",
"name": "ChangesBody",
"description": "The request body",
"schema": {
"properties": {
"include_docs": {
"description": "Default is false. Indicates whether to include the associated document with each result. If there are conflicts, only the winning revision is returned.",
"type": "boolean",
"default": false
},
"style": {
"description": "Default is 'main_only'. Number of revisions to return in the changes array. The only possible value is all_docs and it returns all leaf revisions including conflicts and deleted former conflicts.",
"type": "string",
"default": "main_only"
},
"descending": {
"description": "Default is false. Return documents in descending order.",
"type": "boolean",
"default": false
},
"limit": {
"description": "Limits the number of result rows to the specified value. Using a value of 0 has the same effect as the value 1.",
"type": "integer"
},
"since": {
"description": "Starts the results from the change immediately after the given sequence ID. Sequence IDs should be considered opaque; they come from the last_seq property of a prior response.",
"type": "integer"
},
"filter": {
"description": "Indicates that the returned documents should be filtered. The valid values are sync_gateway/bychannel and _doc_ids.",
"type": "string"
},
"feed": {
"description": "Default is 'normal'. Specifies type of change feed. Valid values are normal, continuous, longpoll, websocket.",
"type": "string",
"default": "normal"
},
"heartbeat": {
"description": "Default is 0. Interval in milliseconds at which an empty line (CRLF) is written to the response. This helps prevent gateways from deciding the socket is idle and closing it. Only applicable to longpoll or continuous feeds. Overrides any timeout to keep the feed alive indefinitely. Setting to 0 results in no heartbeat.",
"type": "integer",
"default": 0
}
}
}
},
"conflicts": {
"in": "query",
"name": "conflicts",
"description": "Default is false. Include conflict information in the response. This parameter is ignored if the include_docs parameter is false.",
"type": "boolean",
"default": false
},
"end_key": {
"in": "query",
"name": "end_key",
"description": "Alias for the endkey parameter.",
"type": "string",
"required": false
},
"endkey_docid": {
"in": "query",
"name": "endkey_docid",
"description": "If this parameter is provided, stop returning records when the specified document identifier is reached.",
"type": "string",
"required": false
},
"end_key_doc_id": {
"in": "query",
"name": "end_key_doc_id",
"description": "Alias for the endkey_docid parameter.",
"type": "string",
"required": false
},
"filter": {
"in": "query",
"name": "filter",
"description": "Reference a filter function from a design document to selectively get updates.",
"type": "string",
"required": false
},
"inclusive_end": {
"in": "query",
"name": "inclusive_end",
"description": "Indicates whether the specified end key should be included in the result.",
"type": "boolean",
"default": true
},
"key": {
"in": "query",
"name": "key",
"description": "If this parameter is provided, return only document that match the specified key.",
"type": "string",
"required": false
},
"replication": {
"in": "body",
"name": "body",
"description": "The request message body is a JSON document that contains the following objects.",
"schema": {
"type": "object",
"properties": {
"allNew": {
"type": "boolean",
"description": "iOS/Mac only. Tells a push replicator that all the revisions being pushed are new ones that don't yet exist on the server. This improves performance by skipping the revs_diff request."
},
"attachments": {
"type": "boolean",
"description": "iOS/Mac only (experimental). Can be set to false to disable downloading attachments in a pull replication."
},
"cancel": {
"type": "boolean",
"description": "Indicates that a running replication task should be cancelled, the running task is identified by passing the original source and target values."
},
"connection_timeout": {
"type": "integer",
"description": "Specifies the timeout to use on HTTP requests"
},
"continuous": {
"type": "boolean",
"description": "Default is false. Specifies whether the replication should be in continuous mode.",
"default": false
},
"create_target": {
"type": "boolean",
"description": "Default is false. Indicates whether to create the target database.",
"default": false
},
"doc_ids": {
"type": "array",
"description": "Array of document IDs to be synchronized",
"items": {
"type": "string",
"description": "Document ID"
}
},
"filter": {
"type": "string",
"description": "Indicates that the documents should be filtered using the specified filter function name. A common value used when replicating from Sync Gateway is sync_gateway/bychannel to limit the pull replication to a set of channels."
},
"heartbeat": {
"type": "integer",
"description": "Specifies the heartbeat value to be used in the _changes feed request."
},
"pinnedCert": {
"type": "string",
"description": "iOS/Mac only. Forces an SSL connection to accept only a specific certificate (instead of any valid certificate for that hostname.) This increases security for regular server-based replication, and if you're using P2P it's the only way to make a trustworthy connection. The parameter body can be either the raw certificate data or a SHA-1 digest of it, in base64."
},
"poll": {
"type": "integer",
"description": "Makes a continuous pull replication poll the _changes feed, at the given interval in ms, instead of keeping a connection open."
},
"purgePushed": {
"type": "boolean",
"description": "iOS/Mac only. Tells a push replicator to purge every document after it successfully pushes it to the server.",
"default": false
},
"network": {
"type": "string",
"description": "Can be used to restrict the replicator to using only WiFi/Ethernet or only cellular networking. Valid values are \"WiFi\" and \"Cell\""
},
"query_params": {
"type": "object",
"description": "A set of key/value pairs to use in the querystring of the replication. For example, the channels field can be used to pull from a set of channels (in this particular case, the filter key must be set for the channels field to work as expected)."
},
"remoteUUID": {
"type": "string",
"description": "iOS/Mac only. Tells the replicator to use the given string as the identifier of the remote server, instead of the URL, when constructing the unique identifier of this replication. This is necessary if the server doesn't have a stable URL, i.e. with P2P."
},
"reset": {
"type": "boolean",
"description": "Forces the checkpoint to be reset, i.e. start over from the beginning."
},
"source": {
"type": "object",
"description": "Identifies the database to copy the revisions from. Can be a string containing a local database name or a remote database URL, or an object whose url property contains the database name or URL. Also an object can contain headers property that contain custom header values such as a cookie.",
"properties": {
"url": {
"description": "The URL of the remote database.",
"type": "string"
},
"headers": {
"description": "Headers to use in the replication requests.",
"type": "object",
"properties": {
"Cookie": {
"description": "A Sync Gateway session cookie",
"type": "string"
}
}
}
}
},
"target": {
"type": "string",
"description": "Identifies the target database to copy revisions to. Same format and interpretation as source."
},
"websocket": {
"type": "string",
"description": "iOS/Mac only. Can be set to false to disable the use of WebSockets for the _changes feed request",
"default": true
}
}
}
},
"skip": {
"in": "query",
"name": "skip",
"description": "If this parameter is provided, skip the specified number of documents before starting to return results.",
"type": "integer",
"default": 0
},
"stale": {
"in": "query",
"name": "stale",
"description": "Allow the results from a stale view to be used, without triggering a rebuild of all views within the encompassing design document. Valid values are 'ok' and 'update_after'.",
"type": "string",
"required": false
},
"start_key": {
"in": "query",
"name": "start_key",
"description": "Alias for startkey.",
"type": "string",
"required": false
},
"startkey_docid": {
"in": "query",
"name": "startkey_docid",
"description": "If this parameter is provided, return documents starting with the specified document identifier.",
"type": "string",
"required": false
}
},
"paths": {
"/{db}/{doc}/{attachment}": {
"parameters": [
{
"$ref": "#/parameters/db"
},
{
"$ref": "#/parameters/doc"
},
{
"$ref": "#/parameters/attachment"
}
],
"get": {
"tags": [
"attachment"
],
"summary": "Get attachment",
"description": "This request retrieves a file attachment associated with the document. The raw data of the associated attachment is returned (just as if you were accessing a static file). The Content-Type response header is the same content type set when the document attachment was added to the database.\n",
"parameters": [
{
"$ref": "#/parameters/rev"
}
],
"responses": {
"200": {
"description": "The message body contains the attachment, in the format specified in the Content-Type header.",
"schema": {
"type": "string",
"format": "binary"
}
},
"304": {
"description": "Not Modified, the attachment wasn't modified if ETag equals the If-None-Match header"
},
"404": {
"description": "Not Found, the specified database, document or attachment was not found."
}
}
},
"put": {
"tags": [
"attachment"
],
"summary": "Add or update document",
"description": "This request adds or updates the supplied request content as an attachment to the specified document. The attachment name must be a URL-encoded string (the file name). You must also supply either the rev query parameter or the If-Match HTTP header for validation, and the Content-Type headers (to set the attachment content type).\n\n When uploading an attachment using an existing attachment name, the corresponding stored content of the database will be updated. Because you must supply the revision information to add an attachment to the document, this serves as validation to update the existing attachment.\n\n Uploading an attachment updates the corresponding document revision. Revisions are tracked for the parent document, not individual attachments.\n",
"parameters": [
{
"$ref": "#/parameters/rev"
},
{
"$ref": "#/parameters/body"
},
{
"$ref": "#/parameters/content_type"
}
],
"responses": {
"200": {
"description": "Operation completed successfully",
"schema": {
"$ref": "#/definitions/Success"
}
},
"409": {
"description": "Conflict, the document revision wasn't specified or it's not the latest."
}
}
}
},
"/{db}/_bulk_docs": {
"parameters": [
{
"$ref": "#/parameters/db"
}
],
"post": {
"tags": [
"database"
],
"summary": "Bulk docs",
"description": "This request enables you to add, update, or delete multiple documents to a database in a single request. To add new documents, you can either specify the ID (`_id`) or let the software create an ID. To update existing documents, you must provide the document ID, revision identifier (`_rev`), and new document values. To delete existing documents you must provide the document ID, revision identifier, and the deletion flag (`_deleted`).\n\nThe JSON returned by the `_bulk_docs` operation consists of an array of JSON structures, one for each document in the original submission. The returned JSON structure should be examined to ensure that all of the documents submitted in the original request were successfully added to the database.\n",
"parameters": [
{
"$ref": "#/parameters/bulkdocs"
}
],
"responses": {
"201": {
"description": "Documents have been created or updated. The response object is an array with the status for each document submitted in the original request.",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/BulkDocsSuccess"
}
}
},
"409": {
"description": "The operation failed with a forbidden error. Probably because the document already exists in the database but a revision number wasn't specified.",
"schema": {
"$ref": "#/definitions/Forbidden"
}
}
}
}
},
"/": {
"get": {
"tags": [
"server"
],
"summary": "summary",
"description": "description",
"responses": {
"200": {
"description": "hello"
}
}
}
},
"/_active_tasks": {
"get": {
"tags": [
"server"
],
"summary": "List of running tasks",
"description": "This request retrieves a list of all tasks running on the server.",
"responses": {
"200": {
"description": "200 OK – Request completed successfully",
"schema": {
"$ref": "#/definitions/ActiveTasks"
}
}
}
}
},
"/_all_dbs": {
"get": {
"tags": [
"server"
],
"summary": "Get database names",
"description": "This request retrieves the list of databases on the server.",
"responses": {
"200": {
"description": "Request completed successfully",
"schema": {
"type": "array",
"description": "List of databases",
"items": {
"type": "string",
"description": "Database name"
}
}
}
}
}
},
"/_replicate": {
"post": {
"tags": [
"server"
],
"summary": "Starts or cancels a database replication operation",
"description": "This request starts or cancels a database replication operation.\n\nYou can cancel continuous replications by adding the cancel field to the JSON request object and setting the value to true. Note that the structure of the request must be identical to the original for the cancellation request to be honoured. For example, if you requested continuous replication, the cancellation request must also contain the continuous field.\n",
"parameters": [
{
"$ref": "#/parameters/replication"
}
],
"responses": {
"200": {
"description": "200 OK",
"schema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"description": "Indicates whether the replication operation was successful"
},
"session_id": {
"type": "string",
"description": "Session identifier"
}
}
}
},
"404": {
"description": "The replication with the specified parameters does not exist. If you're trying to cancel a running replication but encounter this response it means that the parameters do not match the ones in the request that started the replication. Or that such a replication is not running. Use the /_active_tasks endpoint to retrieve the list of replications in progress.\n"
}
}
}
},
"/_session": {
"get": {
"tags": [
"server"
],
"summary": "Retrieve session information",
"description": "This request retrieves session information. Even though Couchbase Lite doesn’t support user logins, it implements a generic response to the _session API for compatibility with apps that might call it.",
"responses": {
"200": {
"description": "200 OK"
}
}
}
},
"/_uuids": {
"get": {
"tags": [
"server"
],
"summary": "List of database identifiers",
"description": "This request retrieves a list of the database identifiers.",
"responses": {
"200": {
"description": "List of UUIDs",
"schema": {
"type": "object",
"properties": {
"uuids": {
"type": "string"
}
}
}
}
}
}
},
"/{db}/": {
"parameters": [
{
"$ref": "#/parameters/db"
}
],
"get": {
"tags": [
"database"
],
"summary": "Database info",
"description": "This request retrieves information about the database.\n",
"responses": {
"200": {
"description": "Request completed successfully.",
"schema": {
"type": "object",
"properties": {
"db_name": {
"type": "string",
"description": "Name of the database"
},
"db_uuid": {
"type": "integer",
"description": "Database identifier"
},
"disk_format_version": {
"type": "integer",
"description": "Database schema version"
},
"disk_size": {
"type": "integer",
"description": "Total amount of data stored on the disk (in bytes)"
},
"instance_start_time": {
"type": "string",
"description": "Date and time the database was opened (in microseconds since 1 January 1970)"
},
"update_seq": {
"type": "string",
"description": "Number of updates to the database"
}
}
}
},
"401": {
"description": "Unauthorized. Login required."
},
"404": {
"description": "Not Found. Requested database not found."
}
}
},
"put": {
"tags": [
"database"
],
"summary": "Create database",
"description": "This request creates a database.",
"responses": {
"201": {
"description": "The database was created successfully."
}
}
},
"post": {
"tags": [
"document"
],
"operationId": "post",
"summary": "Create document",
"description": "This request creates a new document in the specified database. You can either specify the document ID by including the _id in the request message body (the value must be a string), or let the software generate an ID.\n",
"parameters": [
{
"in": "body",
"name": "body",
"description": "The document body",
"schema": {
"type": "object"
}
}
],
"responses": {
"201": {
"description": "The document was written successfully",
"schema": {
"$ref": "#/definitions/Success"
}
}
}
},
"delete": {
"tags": [
"database"
],
"summary": "Delete database",
"description": "Delete database",
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/Success"
}
}
}
}
},
"/{db}/_all_docs": {
"parameters": [
{
"$ref": "#/parameters/db"
}
],
"get": {
"tags": [
"database"
],
"summary": "All docs",
"description": "This request returns a built-in view of all the documents in the database.\n",
"parameters": [
{
"$ref": "#/parameters/conflicts"
},
{
"$ref": "#/parameters/descending"
},
{
"$ref": "#/parameters/endkey"
},
{
"$ref": "#/parameters/end_key"
},
{
"$ref": "#/parameters/endkey_docid"
},
{
"$ref": "#/parameters/end_key_doc_id"
},
{
"$ref": "#/parameters/include_docs"
},
{
"$ref": "#/parameters/inclusive_end"
},
{
"$ref": "#/parameters/key"
},
{
"$ref": "#/parameters/keys"
},
{
"$ref": "#/parameters/limit"
},
{
"$ref": "#/parameters/skip"
},
{
"$ref": "#/parameters/stale"
},
{
"$ref": "#/parameters/startkey"
},
{
"$ref": "#/parameters/start_key"
},
{
"$ref": "#/parameters/startkey_docid"
},
{
"$ref": "#/parameters/update_seq"
}
],
"responses": {
"200": {
"description": "Request completed successfully",
"schema": {
"type": "object",
"properties": {
"offset": {
"type": "string",
"description": "Starting index of the returned rows."
},
"rows": {
"type": "array",
"description": "Array of row objects.",