{ "info": { "_postman_id": "f76db65d-3524-47c6-9833-44ce487b0aa4", "name": "Sync Gateway 3.0 Admin API", "description": "Documentation for the Sync Gateway Admin REST API.\n", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": " config", "item": [ { "name": "Get Server Configuration", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{clusteradmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_config?include_runtime={{include_runtime}}", "host": [ "{{adminUrl}}" ], "path": [ "_config" ], "query": [ { "key": "include_runtime", "value": "{{include_runtime}}" } ] }, "description": "Returns the Sync Gateway configuration of the running instance. This is a good method to check if a particular key was set correctly on the config file.\n" }, "response": [ { "name": "Sync Gateway configuration of the running instance.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_config", "host": [ "{{adminUrl}}" ], "path": [ "_config" ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Update bootstrap logging options without needing a restart", "request": { "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"log_file_path\": \"\",\n \"redaction_level\": \"none\",\n \"console\": {\n \"enabled\": \"\",\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\",\n \"log_level\": \"info\",\n \"log_keys\": \"[\\\"HTTP\\\"]\",\n \"color_enabled\": \"false\",\n \"file_output\": \"\"\n },\n \"error\": {\n \"enabled\": \"\",\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"warn\": {\n \"enabled\": \"\",\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"info\": {\n \"enabled\": true,\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"debug\": {\n \"enabled\": false,\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"trace\": {\n \"enabled\": null,\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"stats\": {\n \"enabled\": null,\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n }\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_config", "host": [ "{{adminUrl}}" ], "path": [ "_config" ] }, "description": "Update bootstrap logging options without needing a restart\n" }, "response": [ { "name": "Returned updated Bootstrap logging settings", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\n \"log_file_path\": \"\",\n \"redaction_level\": \"none\",\n \"console\": {\n \"enabled\": \"\",\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\",\n \"log_level\": \"info\",\n \"log_keys\": \"[\\\"HTTP\\\"]\",\n \"color_enabled\": \"false\",\n \"file_output\": \"\"\n },\n \"error\": {\n \"enabled\": \"\",\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"warn\": {\n \"enabled\": \"\",\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"info\": {\n \"enabled\": true,\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"debug\": {\n \"enabled\": false,\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"trace\": {\n \"enabled\": null,\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"stats\": {\n \"enabled\": null,\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n }\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_config", "host": [ "{{adminUrl}}" ], "path": [ "_config" ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"bootstrap\": {\n \"group_id\": \"default\",\n \"config_update_frequency\": \"10s\",\n \"server\": \"none\",\n \"username\": \"none\",\n \"password\": \"none\",\n \"ca_cert_path\": \"occaecat consequat nostrud culpa\",\n \"server_tls_skip_verify\": true,\n \"x509_cert_path\": \"officia id ipsum exercitation consectetur\",\n \"x509_key_path\": \"adipisicing ut\",\n \"use_tls_server\": true\n },\n \"api\": {\n \"admin_interface\": \"127.0.0.1:4985\",\n \"admin_interface_authentication\": true,\n \"metrics_interface\": \"127.0.0.1{{4986}}\",\n \"metrics_interface_authentication\": true,\n \"enable_advanced_auth_dp\": true,\n \"profile_interface\": \"non ex\",\n \"public_interface\": \"{{4984}}\",\n \"compress_responses\": \"true\",\n \"cors\": {\n \"headers\": [\n \"magna sint\",\n \"c\"\n ],\n \"login_origin\": [\n \"ipsum irure Ut\",\n \"in ipsum aliquip et\"\n ],\n \"max_age\": 79983577\n },\n \"hide_product_version\": false,\n \"https\": {\n \"tls_minimum_version\": \"tlsv1.2\",\n \"tls_cert_path\": \"deserunt quis cupidatat\",\n \"tls_key_path\": \"sint ullamco irure\"\n },\n \"idle_timeout\": 90,\n \"max_connections\": 0,\n \"pretty\": false,\n \"read_header_timeout\": 5,\n \"server_read_timeout\": 99064894,\n \"server_write_timeout\": 314938\n },\n \"logging\": {\n \"log_file_path\": \"\",\n \"redaction_level\": \"none\",\n \"console\": {\n \"enabled\": \"\",\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\",\n \"log_level\": \"info\",\n \"log_keys\": \"[\\\"HTTP\\\"]\",\n \"color_enabled\": \"false\",\n \"file_output\": \"\"\n },\n \"error\": {\n \"enabled\": \"\",\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"warn\": {\n \"enabled\": \"\",\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"info\": {\n \"enabled\": true,\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"debug\": {\n \"enabled\": false,\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"trace\": {\n \"enabled\": null,\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n },\n \"stats\": {\n \"enabled\": null,\n \"rotation\": {\n \"max_size\": 100,\n \"max_age\": \"\",\n \"localtime\": \"false\",\n \"rotated_logs_size_limit\": 1024\n },\n \"collation_buffer_size\": \"\"\n }\n }\n}" } ] } ] }, { "name": " logging", "item": [ { "name": "Get Logging Tags", "request": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_logging", "host": [ "{{adminUrl}}" ], "path": [ "_logging" ] }, "description": "Get logging tags of running instance.\n" }, "response": [ { "name": "The response is a set of key-value pairs. The key is a log tag and the value is a boolean to indicate whether this tag is enabled.\n", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_logging", "host": [ "{{adminUrl}}" ], "path": [ "_logging" ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"Access\": true,\n \"Attach\": true,\n \"Auth\": false,\n \"Bucket\": true,\n \"Cache\": true,\n \"Changes\": false,\n \"CRUD\": false,\n \"DCP\": true,\n \"Events\": true,\n \"Feed\": false,\n \"HTTP\": true\n}" } ] } ] }, { "name": " sgcollect info", "item": [ { "name": "Gets the status of sgcollect_info", "request": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_sgcollect_info", "host": [ "{{adminUrl}}" ], "path": [ "_sgcollect_info" ] }, "description": "Will return information about whether sgcollect_info is currently running or not.\n" }, "response": [ { "name": "The operation was successful", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_sgcollect_info", "host": [ "{{adminUrl}}" ], "path": [ "_sgcollect_info" ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"status\": \"labore nulla\"\n}" } ] }, { "name": "Trigger sgcollect_info", "request": { "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"redact_level\": \"none\",\n \"redact_salt\": \"\",\n \"output_dir\": \"configured `LogFilePath` location (e.g. `/home/sync_gateway/logs`)\",\n \"upload\": false,\n \"upload_host\": \"https://uploads.couchbase.com\",\n \"customer\": \"\",\n \"ticket\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_sgcollect_info", "host": [ "{{adminUrl}}" ], "path": [ "_sgcollect_info" ] }, "description": "Starting in Sync Gateway 2.1, sgcollect_info can be triggered using ths endpoint.\n" }, "response": [ { "name": "The request was successful.", "originalRequest": { "method": "POST", "header": [], "url": { "raw": "{{adminUrl}}/_sgcollect_info", "host": [ "{{adminUrl}}" ], "path": [ "_sgcollect_info" ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Stops any currently running sgcollect_info", "request": { "method": "DELETE", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"redact_level\": \"none\",\n \"redact_salt\": \"\",\n \"output_dir\": \"configured `LogFilePath` location (e.g. `/home/sync_gateway/logs`)\",\n \"upload\": false,\n \"upload_host\": \"https://uploads.couchbase.com\",\n \"customer\": \"\",\n \"ticket\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_sgcollect_info", "host": [ "{{adminUrl}}" ], "path": [ "_sgcollect_info" ] }, "description": "sgcollect_info can be cancelled using ths endpoint.\n" }, "response": [ { "name": "The request was successful.", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/_sgcollect_info", "host": [ "{{adminUrl}}" ], "path": [ "_sgcollect_info" ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] } ] }, { "name": "{db}", "item": [ { "name": " local/{local doc}", "item": [ { "name": "Get local doc", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_local/{{local_doc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_local", "{{local_doc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "local_doc", "value": "", "description": "(Required) Local document IDs begin with _local/." } ] }, "description": "This request retrieves a local document. Local document IDs begin with _local/. Local documents are not replicated or indexed, don't support attachments, and don't save revision histories. In practice they are almost only used by Couchbase Lite's replicator, as a place to store replication checkpoint data.\n" }, "response": [ { "name": "The message body contains the following objects in a JSON document.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_local/{{local_doc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_local", "{{local_doc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "local_doc", "value": "", "description": "(Required) Local document IDs begin with _local/." } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{}" } ] }, { "name": "Create or update a local document", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "PUT", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_local/{{local_doc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_local", "{{local_doc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "local_doc", "value": "", "description": "(Required) Local document IDs begin with _local/." } ] }, "description": "This request creates or updates a local document. Local document IDs begin with _local/. Local documents are not replicated or indexed, don't support attachments, and don't save revision histories. In practice they are almost only used by the client's replicator, as a place to store replication checkpoint data.\n" }, "response": [ { "name": "Created", "originalRequest": { "method": "PUT", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_local/{{local_doc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_local", "{{local_doc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "local_doc", "value": "", "description": "(Required) Local document IDs begin with _local/." } ] } }, "status": "Created", "code": 201, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{}" } ] }, { "name": "Delete a local document", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_local/{{local_doc}}?rev={{rev}}&batch={{batch}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_local", "{{local_doc}}" ], "query": [ { "key": "rev", "value": "{{rev}}" }, { "key": "batch", "value": "{{batch}}" } ] }, "description": "This request deletes a local document. Local document IDs begin with _local/. Local documents are not replicated or indexed, don't support attachments, and don't save revision histories. In practice they are almost only used by Couchbase Lite's replicator, as a place to store replication checkpoint data.\n" }, "response": [ { "name": "Document successfully removed", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_local/{{local_doc}}?rev=&batch=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_local", "{{local_doc}}" ], "query": [ { "key": "rev", "value": "" }, { "key": "batch", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "local_doc", "value": "", "description": "(Required) Local document IDs begin with _local/." } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{}" } ] } ] }, { "name": " changes", "item": [ { "name": "Changes", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_changes?limit={{limit}}&style={{style}}&active_only={{active_only}}&include_docs={{include_docs}}&filter={{filter}}&channels={{channels}}&doc_ids={{doc_ids}}&feed={{feed}}&since={{since}}&heartbeat={{heartbeat}}&timeout={{timeout}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_changes" ], "query": [ { "key": "limit", "value": "{{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." }, { "key": "style", "value": "{{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." }, { "key": "active_only", "value": "{{active_only}}", "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." }, { "key": "include_docs", "value": "{{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." }, { "key": "filter", "value": "{{filter}}", "description": "Indicates that the reported documents should be filtered. The valid values are sync_gateway/bychannel and _doc_ids." }, { "key": "channels", "value": "{{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.)" }, { "key": "doc_ids", "value": "{{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 `filter=_doc_ids` and `feed=normal` parameters." }, { "key": "feed", "value": "{{feed}}", "description": "Default is 'normal'. Specifies type of change feed. Valid values are normal, continuous, longpoll, websocket." }, { "key": "since", "value": "{{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." }, { "key": "heartbeat", "value": "{{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." }, { "key": "timeout", "value": "{{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." } ] }, "description": "This request retrieves a sorted list of changes made to documents in the database, in time order of application. Each document appears at most once, ordered by its most recent change, regardless of how many times it's been changed.\nThis request can be used to listen for update and modifications to the database for post processing or synchronization. A continuously connected changes feed is a reasonable approach for generating a real-time log for most applications.\n" }, "response": [ { "name": "Request completed successfully", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_changes?limit=&style=main_only&active_only=false&include_docs=false&filter=&channels=&doc_ids=,&feed=normal&since=&heartbeat=0&timeout=300000", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_changes" ], "query": [ { "key": "limit", "value": "" }, { "key": "style", "value": "main_only" }, { "key": "active_only", "value": "false" }, { "key": "include_docs", "value": "false" }, { "key": "filter", "value": "" }, { "key": "channels", "value": "" }, { "key": "doc_ids", "value": "," }, { "key": "feed", "value": "normal" }, { "key": "since", "value": "" }, { "key": "heartbeat", "value": "0" }, { "key": "timeout", "value": "300000" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"last_seq\": {},\n \"results\": [\n {\n \"changes\": [\n {\n \"rev\": \"eiusmod irure\"\n },\n {\n \"rev\": \"nostrud do laborum dolore\"\n }\n ],\n \"id\": \"Lorem\",\n \"seq\": -25976890\n },\n {\n \"changes\": [\n {\n \"rev\": \"aliquip\"\n },\n {\n \"rev\": \"irure dolor ut do\"\n }\n ],\n \"id\": \"voluptate\",\n \"seq\": -48994961\n }\n ]\n}" } ] }, { "name": "Changes", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"limit\": \"\",\n \"style\": \"main_only\",\n \"active_only\": false,\n \"include_docs\": false,\n \"filter\": \"\",\n \"channels\": \"\",\n \"doc_ids\": [\n \"\",\n \"\"\n ],\n \"feed\": \"normal\",\n \"since\": \"\",\n \"heartbeat\": 0,\n \"timeout\": 300000\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_changes", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_changes" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "Same as the GET /_changes request except the parameters are in the JSON body.\n" }, "response": [ { "name": "Request completed successfully", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"limit\": \"\",\n \"style\": \"main_only\",\n \"active_only\": false,\n \"include_docs\": false,\n \"filter\": \"\",\n \"channels\": \"\",\n \"doc_ids\": [\n \"\",\n \"\"\n ],\n \"feed\": \"normal\",\n \"since\": \"\",\n \"heartbeat\": 0,\n \"timeout\": 300000\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_changes", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_changes" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"last_seq\": {},\n \"results\": [\n {\n \"changes\": [\n {\n \"rev\": \"id\"\n },\n {\n \"rev\": \"dolor sit dolore elit\"\n }\n ],\n \"id\": \"incididunt occaecat\",\n \"seq\": 17678721\n },\n {\n \"changes\": [\n {\n \"rev\": \"irure labore\"\n },\n {\n \"rev\": \"officia ad aute\"\n }\n ],\n \"id\": \"exercitation Ut in\",\n \"seq\": 80422041\n }\n ]\n}" } ] }, { "name": "Used by the replicator", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "\"\"", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_revs_diff", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_revs_diff" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "Given a set of document/revision IDs, returns the subset of those that do not correspond to revisions stored in the database." }, "response": [ { "name": "The request was successful", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "\"\"", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_revs_diff", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_revs_diff" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{}" } ] } ] }, { "name": " config", "item": [ { "name": "Get Database Configuration", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_config?include_javascript={{include_javascript}}&include_runtime={{include_runtime}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config" ], "query": [ { "key": "include_javascript", "value": "{{include_javascript}}" }, { "key": "include_runtime", "value": "{{include_runtime}}" } ] }, "description": "Returns the Sync Gateway configuration of the database specified in the URL. This is a good method to check if a particular key was set correctly on the config file.\n" }, "response": [ { "name": "Sync Gateway configuration of the running instance.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_config", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Update Database Configuration", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"bucket\": \"the database name\",\n \"name\": \"\",\n \"sync\": \"`function(doc, oldDoc) {channel(doc.channels);}`\\n\",\n \"guest\": {\n \"disabled\": true\n },\n \"revs_limit\": \"see Default and Minimum Values table in Description\",\n \"import_docs\": \"false\",\n \"import_partitions\": 16,\n \"import_filter\": \"No filter\",\n \"import_backup_old_rev\": \"\",\n \"event_handlers\": {\n \"document_changed\": [\n {\n \"filter\": \"\",\n \"handler\": \"\",\n \"options\": \"\",\n \"timeout\": 60,\n \"url\": \"\"\n },\n {\n \"filter\": \"\",\n \"handler\": \"\",\n \"options\": \"\",\n \"timeout\": 60,\n \"url\": \"\"\n }\n ],\n \"db_state_changed\": [\n {\n \"filter\": \"\",\n \"handler\": \"\",\n \"options\": \"\",\n \"timeout\": 60,\n \"url\": \"\"\n },\n {\n \"filter\": \"\",\n \"handler\": \"\",\n \"options\": \"\",\n \"timeout\": 60,\n \"url\": \"\"\n }\n ],\n \"max_processes\": 500,\n \"wait_for_process\": 100\n },\n \"allow_empty_password\": \"false\",\n \"cache\": {\n \"rev_cache\": {\n \"size\": 5000,\n \"shard_count\": 8\n },\n \"channel_cache\": {\n \"compact_high_watermark_pct\": 80,\n \"compact_low_watermark_pct\": 60,\n \"enable_star_channel\": \"true\",\n \"expiry_seconds\": 60,\n \"max_length\": 500,\n \"max_num_pending\": 10000,\n \"max_number\": 50000,\n \"max_wait_pending\": 5000,\n \"max_wait_skipped\": 3600000,\n \"min_length\": 50,\n \"query_limit\": 5000\n }\n },\n \"offline\": false,\n \"unsupported\": {\n \"api_endpoints\": {\n \"enable_couchbase_bucket_flush\": \"\"\n },\n \"oidc_tls_skip_verify\": \"false\",\n \"oidc_test_provider\": {\n \"enabled\": \"\"\n },\n \"remote_config_tls_skip_verify\": \"false\",\n \"sgr_tls_skip_verify\": \"false\",\n \"user_views\": \"none\",\n \"warning_thresholds\": {\n \"access_and_role_grants_per_doc\": \"\",\n \"channels_per_doc\": \"\",\n \"channels_per_user\": \"\",\n \"channel_name_size\": \"\",\n \"xattr_size_bytes\": \"\"\n },\n \"disable_clean_skipped_query\": \"\"\n },\n \"oidc\": {\n \"default_provider\": \"\",\n \"providers\": {\n \"this_provider\": {\n \"issuer\": \"\",\n \"register\": \"\",\n \"client_id\": \"\",\n \"validation_key\": \"\",\n \"callback_url\": \"\",\n \"disable_session\": \"\",\n \"scope\": \"\",\n \"include_access\": \"\",\n \"user_prefix\": \"\",\n \"discovery_url\": \"\",\n \"disable_cfg_validation\": \"false\",\n \"disable_callback_state\": \"false\",\n \"username_claim\": \"optional\",\n \"allow_unsigned_provider_tokens\": \"false\"\n }\n }\n },\n \"old_rev_expiry_seconds\": \"\",\n \"view_query_timeout_secs\": 75,\n \"local_doc_expiry_secs\": 7776000,\n \"enable_xattrs\": true,\n \"session_cookie_secure\": \"true\",\n \"session_cookie_name\": \"SyncGatewaySession\",\n \"session_cookie_http_only\": \"false\",\n \"allow_conflicts\": \"true\",\n \"num_index_replicas\": 1,\n \"use_views\": \"false\",\n \"send_www_authenticate_header\": \"true\",\n \"bucket_op_timeout_ms\": 2500,\n \"delta_sync\": {\n \"enabled\": false,\n \"rev_max_age_seconds\": 86400\n },\n \"compact_interval_days\": \"\",\n \"isgr_enabled\": \"true\",\n \"isgr_websocket_heartbeat_secs\": 300,\n \"serve_insecure_attachment_types\": \"false\",\n \"query_pagination_limit\": \"\",\n \"slow_query_warning_threshold\": 500,\n \"user_xattr_key\": \"none\",\n \"client_partition_window_secs\": 2592000\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_config", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "Use this endpoint to update the configuration of an existing Sync Gatewat database.\n\nProvide the database name in the URL path.\nProvide the required database configuration settings as a JSON object in the request body.\nYou only need to provide those settings you wish to change.\n\nBy default the updated database is brought online immediately, **unless** you include `\"offline\": true` in the configuration.\n\n`See: {rest-api-admin--xref}` for further information on this.\n" }, "response": [ { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "PUT", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_config", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "200 - OK - Operation successful", "originalRequest": { "method": "PUT", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_config", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Update import_filter function", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/javascript" } ], "body": { "mode": "raw", "raw": "function (doc) {return true;}" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/import_filter", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "import_filter" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "Use this convenience endpoint to add or update the `import_filter` Javascript function for an existing Sync Gateway database.\n\nSee the 'Model' below for more info\n\n" }, "response": [ { "name": "OK", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "\"function(doc) {\\n if (doc.type != 'mobile') {\\n return false\\n }\\n return true\\n}\\n\\n\"" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/import_filter", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "import_filter" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "\"function(doc) {\\n if (doc.type != 'mobile') {\\n return false\\n }\\n return true\\n}\\n\\n\"" }, { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "\"function(doc) {\\n if (doc.type != 'mobile') {\\n return false\\n }\\n return true\\n}\\n\\n\"" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/import_filter", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "import_filter" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Update a Sync Function", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/javascript" } ], "body": { "mode": "raw", "raw": "function(doc, oldDoc) {if (doc.channels) { channel(doc.channels);}}" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/sync", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "sync" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "Use this convenience endpoint to add or update the `Sync` function for an existing Sync Gateway database\n\nSee the 'Model' below for more info\n\n" }, "response": [ { "name": "OK", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "\"function(doc, oldDoc) {\\n channel(doc.channels);\\n}\\n\\n\"" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/sync", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "sync" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "\"function(doc, oldDoc) {\\n channel(doc.channels);\\n}\\n\\n\"" }, { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "\"function(doc, oldDoc) {\\n channel(doc.channels);\\n}\\n\\n\"" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/sync", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "sync" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Get import_filter function", "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [ { "key": "Content-Type", "value": "application/javascript" } ], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/import_filter", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "import_filter" ], "variable": [ { "description": "(Required) Database name", "key": "db", "value": "" } ] }, "description": "Use this convenience endpoint to get the `import_filter` Javascript function for an existing Sync Gateway database.\n\nSee the 'Model' below for more info" }, "response": [ { "name": "OK", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "\"function(doc) {\\n if (doc.type != 'mobile') {\\n return false\\n }\\n return true\\n}\\n\\n\"" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/import_filter", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "import_filter" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "\"function(doc) {\\n if (doc.type != 'mobile') {\\n return false\\n }\\n return true\\n}\\n\\n\"" }, { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "\"function(doc) {\\n if (doc.type != 'mobile') {\\n return false\\n }\\n return true\\n}\\n\\n\"" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/import_filter", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "import_filter" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Get Sync Function", "protocolProfileBehavior": { "disableBodyPruning": true }, "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [ { "key": "Content-Type", "value": "application/javascript" } ], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/sync", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "sync" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "Use this convenience endpoint to get the `Sync` function for an existing Sync Gateway database\n\nSee the 'Model' below for more info" }, "response": [ { "name": "Get Sync Function-success", "originalRequest": { "method": "GET", "header": [ { "key": "Content-Type", "value": "application/javascript" } ], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/sync", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "sync" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "script", "header": [ { "key": "Content-Length", "value": "0" }, { "key": "Content-Type", "value": "application/javascript; charset=UTF-8" }, { "key": "Etag", "value": "7-d2c93d755adade3415f157ecc7607f03" }, { "key": "Server", "value": "Couchbase Sync Gateway/3.0.0 EE" }, { "key": "Date", "value": "Mon, 22 Nov 2021 00:13:29 GMT" } ], "cookie": [], "body": null }, { "name": "OK", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "\"function(doc, oldDoc) {\\n channel(doc.channels);\\n}\\n\\n\"" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/sync", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "sync" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "\"function(doc, oldDoc) {\\n channel(doc.channels);\\n}\\n\\n\"" }, { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "\"function(doc, oldDoc) {\\n channel(doc.channels);\\n}\\n\\n\"" }, "url": { "raw": "{{adminUrl}}/{{db}}/_config/sync", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_config", "sync" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] } ] }, { "name": "{doc}", "item": [ { "name": "{attachment}", "item": [ { "name": "Get attachment", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}/{{attachment}}?rev={{rev}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}", "{{attachment}}" ], "query": [ { "key": "rev", "value": "{{rev}}", "description": "Revision identifier of the parent revision the new one should replace. (Not used when creating a new document.)" } ] }, "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\nTo remove an attachment from a document, simply update the `_attachments` dictionary of the document in the PUT \"/{db}/{id}\" request. From then on, the attachment will not be replicated but will still reside in the Couchbase Server bucket (see open ticket [1648](https://github.com/couchbase/sync_gateway/issues/1648).\n" }, "response": [ { "name": "The message body contains the attachment, in the format specified in the Content-Type header.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}/{{attachment}}?rev=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}", "{{attachment}}" ], "query": [ { "key": "rev", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "doc", "value": "", "description": "(Required) Document ID" }, { "key": "attachment", "value": "", "description": "(Required) Attachment name. This value must be URL encoded. For example, if the attachment name is `blob_/avatar`, the path component passed to the URL should be `blob_%2Favatar` (tested with [URLEncoder](https://www.urlencoder.org/))." } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "\"quis aute ea dolore\"" }, { "name": "Not Modified, the attachment wasn't modified if ETag equals the If-None-Match header", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}/{{attachment}}?rev=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}", "{{attachment}}" ], "query": [ { "key": "rev", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "doc", "value": "", "description": "(Required) Document ID" }, { "key": "attachment", "value": "", "description": "(Required) Attachment name. This value must be URL encoded. For example, if the attachment name is `blob_/avatar`, the path component passed to the URL should be `blob_%2Favatar` (tested with [URLEncoder](https://www.urlencoder.org/))." } ] } }, "status": "Not Modified", "code": 304, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "Not Found, the specified database, document or attachment was not found.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}/{{attachment}}?rev=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}", "{{attachment}}" ], "query": [ { "key": "rev", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "doc", "value": "", "description": "(Required) Document ID" }, { "key": "attachment", "value": "", "description": "(Required) Attachment name. This value must be URL encoded. For example, if the attachment name is `blob_/avatar`, the path component passed to the URL should be `blob_%2Favatar` (tested with [URLEncoder](https://www.urlencoder.org/))." } ] } }, "status": "Not Found", "code": 404, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Add or update attachment", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "file", "file": {} }, "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}/{{attachment}}?rev={{rev}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}", "{{attachment}}" ], "query": [ { "key": "rev", "value": "{{rev}}", "description": "Revision identifier of the parent revision the new one should replace. (Not used when creating a new document.)" } ] }, "description": "This request adds or updates the supplied request content as an attachment to the specified document, the maximum content size of an attachment is 20MB. 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\n To remove an attachment from a document, simply update the `_attachments` dictionary of the document in the PUT \"{db}/{id}\" request. From then on, the attachment will not be replicated but will still reside in the Couchbase Server bucket (see open ticket [1648](https://github.com/couchbase/sync_gateway/issues/1648).\n" }, "response": [ { "name": "Operation completed successfully", "originalRequest": { "method": "PUT", "header": [ { "description": "Attachment Content-Type", "key": "Content-Type", "value": "quis aute ea dolore" } ], "body": { "mode": "file", "file": {}, "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}/{{attachment}}?rev=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}", "{{attachment}}" ], "query": [ { "key": "rev", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "doc", "value": "", "description": "(Required) Document ID" }, { "key": "attachment", "value": "", "description": "(Required) Attachment name. This value must be URL encoded. For example, if the attachment name is `blob_/avatar`, the path component passed to the URL should be `blob_%2Favatar` (tested with [URLEncoder](https://www.urlencoder.org/))." } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{}" }, { "name": "Conflict, the document revision wasn't specified or it's not the latest.", "originalRequest": { "method": "PUT", "header": [ { "description": "Attachment Content-Type", "key": "Content-Type", "value": "quis aute ea dolore" } ], "body": { "mode": "file", "file": {}, "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}/{{attachment}}?rev=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}", "{{attachment}}" ], "query": [ { "key": "rev", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "doc", "value": "", "description": "(Required) Document ID" }, { "key": "attachment", "value": "", "description": "(Required) Attachment name. This value must be URL encoded. For example, if the attachment name is `blob_/avatar`, the path component passed to the URL should be `blob_%2Favatar` (tested with [URLEncoder](https://www.urlencoder.org/))." } ] } }, "status": "Conflict", "code": 409, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] } ] }, { "name": "Get document", "event": [ { "listen": "test", "script": { "exec": [ "" ], "type": "text/javascript" } } ], "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}?rev={{rev}}&attachments={{include_attachments}}&atts_since={{atts_since}}&open_revs={{open_revs}}&revs={{include_revs}}&show_exp={{show_exp}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}" ], "query": [ { "key": "rev", "value": "{{rev}}", "description": "Revision identifier of the revision to get. By default, Sync Gateway returns the current revision. This parameter is generally only needed for conflict resolution. For example where the app might need to retrieve a conflicting leaf revision that isn't the current revision." }, { "key": "attachments", "value": "{{include_attachments}}", "description": "Default is false. Include attachment bodies in response." }, { "key": "atts_since", "value": "{{atts_since}}", "description": "Include attachments only since specified revisions. Does not include attachments for specified revisions." }, { "key": "open_revs", "value": "{{open_revs}}", "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\"]). Only [leaf revision](glossary.html) bodies that haven't been pruned are guaranteed to be returned.\n\nIf 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.\n" }, { "key": "revs", "value": "{{include_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." }, { "key": "show_exp", "value": "{{show_exp}}", "description": "Whether to show the _exp property in the response." } ] }, "description": "This request retrieves a document from a database." }, "response": [ { "name": "The message body contains the following objects in a JSON document.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}?rev=&attachments=false&atts_since=,&open_revs=,&revs=false&show_exp=false", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}" ], "query": [ { "key": "rev", "value": "" }, { "key": "attachments", "value": "false" }, { "key": "atts_since", "value": "," }, { "key": "open_revs", "value": "," }, { "key": "revs", "value": "false" }, { "key": "show_exp", "value": "false" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "doc", "value": "", "description": "(Required) Document ID" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{}" } ] }, { "name": "Create or update document", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"_id\": \"\",\n \"_rev\": \"\",\n \"_exp\": \"\",\n \"_revisions\": {\n \"start\": \"\",\n \"ids\": [\n \"\",\n \"\"\n ]\n },\n \"_attachments\": {\n \"attachment_name\": {\n \"content_type\": \"\"\n }\n }\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}?new_edits={{new_edits}}&rev={{rev}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}" ], "query": [ { "key": "new_edits", "value": "{{new_edits}}", "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." }, { "key": "rev", "value": "{{rev}}", "description": "(Required) Revision identifier of the revision to update. It must be the last revision in the history." } ] }, "description": "This request creates a new document or creates a new revision of an existing document. It enables you to specify the identifier for a new document rather than letting the software create an identifier. If you want to create a new document and let the software create an identifier, use the POST /db request.\nIf the document specified by doc does not exist, a new document is created and assigned the identifier specified in doc. If the document already exists, the document is updated with the JSON document in the message body and given a new revision. The maximum size allowed for a document is 20MB.\n\nSince Sync Gateway 1.3, an expiry property (`_exp`) can also be specified to purge the document after a given time. If **convergence** is enabled (introduced in Sync Gateway 1.5), the behavior of the expiry feature changes in the following way: when the expiry value is reached, instead of getting purged, the **active** revision of the document is tombstoned. If there is another non-tombstoned revision for this document (i.e a conflict) it will become the active revision. The tombstoned revision will be purged when the server's metadata purge interval is reached.\n" }, "response": [ { "name": "The response is a JSON document that contains the following objects", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\n \"_id\": \"\",\n \"_rev\": \"\",\n \"_exp\": \"\",\n \"_revisions\": {\n \"start\": \"\",\n \"ids\": [\n \"\",\n \"\"\n ]\n },\n \"_attachments\": {\n \"attachment_name\": {\n \"content_type\": \"\"\n }\n }\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}?new_edits=true&rev=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}" ], "query": [ { "key": "new_edits", "value": "true" }, { "key": "rev", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "doc", "value": "", "description": "(Required) Document ID" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{}" } ] }, { "name": "Delete document", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}?rev={{rev}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}" ], "query": [ { "key": "rev", "value": "{{rev}}", "description": "(Required) Revision identifier of the revision to delete. It must be the identifier of the latest revision in the history." } ] }, "description": "This request deletes a document from the database. When a document is deleted, the revision number is updated so the database can track the deletion in synchronized copies.\n" }, "response": [ { "name": "Document successfully removed", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/{{doc}}?rev=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "{{doc}}" ], "query": [ { "key": "rev", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "doc", "value": "", "description": "(Required) Document ID" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{}" } ] }, { "name": "Create document", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "\"\"", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "This request creates a new document in the specified database.\nYou 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\nThe maximum size allowed for a document is 20MB.\n" }, "response": [ { "name": "The document was written successfully", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "\"\"", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Created", "code": 201, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{}" } ] }, { "name": "Purge document", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"{{doc}}\": [\"*\"]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_purge", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_purge" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "The purge command provides a way to remove a document from the bucket itself. The operation removes all the revisions (active and tombstones) for the specified document(s). A common usage of this endpoint is to remove tombstone documents that are no longer needed, thus recovering storage space and reducing data replicated to clients. Other clients are not notified when a revision has been purged; so in order to purge a revision from the system it must be done from all databases (on Couchbase Lite and Sync Gateway).\n\nWhen **convergence** is enabled (introduced in Sync Gateway 1.5), this endpoint removes the document and its associated extended attributes.\n" }, "response": [ { "name": "OK – The purge operation was successful", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"a_doc_id\": [\n \"\",\n \"\"\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_purge", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_purge" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"a_doc_id\": [\n \"culpa aliquip eu esse ut\",\n \"dolore exercitation\"\n ]\n}" } ] }, { "name": "Document with metadata", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_raw/{{doc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_raw", "{{doc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "doc", "value": "", "description": "(Required) Document ID" } ] }, "description": "Returns the document with the metadata.\n\nNote: The direct use of this endpoint is unsupported. The sync metadata is maintained internally by Sync Gateway and its structure can change. It should not be used to drive business logic of applications since the response to the `/{db}/_raw/{id}` endpoint can change at any time.\n" }, "response": [ { "name": "hello", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_raw/{{doc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_raw", "{{doc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "doc", "value": "", "description": "(Required) Document ID" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"_sync\": {\n \"rev\": \"aliquip adipisicing ex\",\n \"sequence\": 75818860,\n \"recent_sequences\": [\n -30598196,\n 15368080\n ],\n \"parents\": [\n 52513111,\n 3727187\n ],\n \"history\": {\n \"revs\": [\n \"occaecat aliquip sint ullamco\",\n \"ad ullamco aliqua\"\n ],\n \"parents\": [\n -10736822,\n 30450714\n ],\n \"channels\": [\n \"et dol\",\n \"nisi mollit consectetur pariatur\"\n ],\n \"time_saved\": \"ullamco pariatur Duis nostrud dolor\"\n }\n }\n}" } ] } ] }, { "name": " design/{ddoc}", "item": [ { "name": "Get Views of a design document", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_design/{{ddoc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_design", "{{ddoc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "ddoc", "value": "", "description": "(Required) Design document name" } ] }, "description": "Query a design document.\n" }, "response": [ { "name": "Views for design document", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_design/{{ddoc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_design", "{{ddoc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "ddoc", "value": "", "description": "(Required) Design document name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"my_view_name\": {\n \"_rev\": \"consequat\",\n \"views\": {\n \"my_view_name\": {\n \"map\": \"nulla quis\",\n \"reduce\": \"veniam ex\"\n }\n }\n }\n}" } ] }, { "name": "Update views of a design document", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"_rev\": \"\",\n \"views\": {\n \"my_view_name\": {\n \"map\": \"\",\n \"reduce\": \"\"\n }\n }\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_design/{{ddoc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_design", "{{ddoc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "ddoc", "value": "", "description": "(Required) Design document name" } ] } }, "response": [ { "name": "Successful operation", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\n \"_rev\": \"\",\n \"views\": {\n \"my_view_name\": {\n \"map\": \"\",\n \"reduce\": \"\"\n }\n }\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_design/{{ddoc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_design", "{{ddoc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "ddoc", "value": "", "description": "(Required) Design document name" } ] } }, "status": "Created", "code": 201, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{}" } ] }, { "name": "Delete design document", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_design/{{ddoc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_design", "{{ddoc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "ddoc", "value": "", "description": "(Required) Design document name" } ] }, "description": "Delete a design document.\n" }, "response": [ { "name": "Unexpected error", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_design/{{ddoc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_design", "{{ddoc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "ddoc", "value": "", "description": "(Required) Design document name" } ] } }, "status": "Internal Server Error", "code": 500, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"code\": -6108775,\n \"message\": \"cupidatat in nulla\",\n \"fields\": \"non id ad\"\n}" }, { "name": "The status", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_design/{{ddoc}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_design", "{{ddoc}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "ddoc", "value": "", "description": "(Required) Design document name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{}" } ] }, { "name": "Query a view", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_design/{{ddoc}}/_view/{{view}}?conflicts={{conflicts}}&descending={{descending}}&endkey={{endkey}}&end_key={{end_key}}&endkey_docid={{endkey_docid}}&end_key_doc_id={{end_key_doc_id}}&include_docs={{include_docs}}&inclusive_end={{inclusive_end}}&group={{group}}&group_level={{group_level}}&key={{key}}&limit={{limit}}&skip={{skip}}&stale={{stale}}&startkey={{startkey}}&start_key={{start_key}}&startkey_docid={{startkey_docid}}&update_seq={{update_seq}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_design", "{{ddoc}}", "_view", "{{view}}" ], "query": [ { "key": "conflicts", "value": "{{conflicts}}", "description": "Include conflict information in the response. This parameter is ignored if the include_docs parameter is false." }, { "key": "descending", "value": "{{descending}}", "description": "Return documents in descending order." }, { "key": "endkey", "value": "{{endkey}}", "description": "If this parameter is provided, stop returning records when the specified key is reached." }, { "key": "end_key", "value": "{{end_key}}", "description": "Alias for the endkey parameter." }, { "key": "endkey_docid", "value": "{{endkey_docid}}", "description": "If this parameter is provided, stop returning records when the specified document identifier is reached." }, { "key": "end_key_doc_id", "value": "{{end_key_doc_id}}", "description": "Alias for the endkey_docid parameter." }, { "key": "include_docs", "value": "{{include_docs}}", "description": "Only works when using Couchbase Server 3.0 and earlier. Indicates whether to include the full content of the documents in the response." }, { "key": "inclusive_end", "value": "{{inclusive_end}}", "description": "Indicates whether the specified end key should be included in the result." }, { "key": "group", "value": "{{group}}", "description": "Group the results using the reduce function to a group or single row." }, { "key": "group_level", "value": "{{group_level}}", "description": "Specify the group level to be used." }, { "key": "key", "value": "{{key}}", "description": "If this parameter is provided, return only document that match the specified key." }, { "key": "limit", "value": "{{limit}}", "description": "If this parameter is provided, return only the specified number of documents." }, { "key": "skip", "value": "{{skip}}", "description": "If this parameter is provided, skip the specified number of documents before starting to return results." }, { "key": "stale", "value": "{{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." }, { "key": "startkey", "value": "{{startkey}}", "description": "If this parameter is provided, return documents starting with the specified key." }, { "key": "start_key", "value": "{{start_key}}", "description": "Alias for startkey param." }, { "key": "startkey_docid", "value": "{{startkey_docid}}", "description": "If this parameter is provided, return documents starting with the specified document identifier." }, { "key": "update_seq", "value": "{{update_seq}}", "description": "Indicates whether to include the update_seq property in the response." } ] }, "description": "Query a view on a design document.\n" }, "response": [ { "name": "Query results", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_design/{{ddoc}}/_view/{{view}}?conflicts=&descending=&endkey=&end_key=&endkey_docid=&end_key_doc_id=&include_docs=&inclusive_end=&group=&group_level=&key=&limit=&skip=&stale=&startkey=&start_key=&startkey_docid=&update_seq=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_design", "{{ddoc}}", "_view", "{{view}}" ], "query": [ { "key": "conflicts", "value": "" }, { "key": "descending", "value": "" }, { "key": "endkey", "value": "" }, { "key": "end_key", "value": "" }, { "key": "endkey_docid", "value": "" }, { "key": "end_key_doc_id", "value": "" }, { "key": "include_docs", "value": "" }, { "key": "inclusive_end", "value": "" }, { "key": "group", "value": "" }, { "key": "group_level", "value": "" }, { "key": "key", "value": "" }, { "key": "limit", "value": "" }, { "key": "skip", "value": "" }, { "key": "stale", "value": "" }, { "key": "startkey", "value": "" }, { "key": "start_key", "value": "" }, { "key": "startkey_docid", "value": "" }, { "key": "update_seq", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "ddoc", "value": "", "description": "(Required) Design document name" }, { "key": "view", "value": "", "description": "(Required) View name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"offset\": \"quis in id\",\n \"rows\": [\n {\n \"id\": \"adipisicing nulla elit amet\",\n \"key\": {},\n \"value\": {},\n \"doc\": {}\n },\n {\n \"id\": \"commodo esse deserunt nulla\",\n \"key\": {},\n \"value\": {},\n \"doc\": {}\n }\n ],\n \"total_rows\": 74628762\n}" } ] }, { "name": "Remove obsolete design documents", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [], "url": { "raw": "{{adminUrl}}/_post_upgrade?preview={{preview}}", "host": [ "{{adminUrl}}" ], "path": [ "_post_upgrade" ], "query": [ { "key": "preview", "value": "{{preview}}", "description": "Lists the design documents to be removed if the request is sent without this paramter." } ] }, "description": "Starting in Sync Gateway 2.0, design documents used internally by Sync Gateway will include a version number in their name.

\n\nThis version is incremented at each change, but the previous version of the design documents are retained, as they may be required by other nodes.

\n\nUse this `_post_upgrade` endpoint to remove any obsolete design documents when you are sure they are no longer needed.

\n\n*TIP:* Use the `preview=true` query string option to check which design documents will be removed.

\n\nTypical use cases for this end point include:
\n\n- After upgrading Sync Gateway -- see ([upgrade guide](upgrade.html#upgrade)).\n\n- After moving from *non-import-docs* to *import-docs* methods. That is, from `import-docs=False` to `import-docs=True`\n" }, "response": [ { "name": "The request was successful.", "originalRequest": { "method": "POST", "header": [], "url": { "raw": "{{adminUrl}}/_post_upgrade?preview=false", "host": [ "{{adminUrl}}" ], "path": [ "_post_upgrade" ], "query": [ { "key": "preview", "value": "false" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] } ] }, { "name": "docs", "item": [ { "name": "Get All docs", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_all_docs?access={{access}}&channels={{include_channels}}&include_docs={{include_docs}}&revs={{include_revs}}&update_seq={{update_seq}}&limit={{limit}}&keys={{keys}}&startkey={{startkey}}&endkey={{endkey}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_all_docs" ], "query": [ { "key": "access", "value": "{{access}}", "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." }, { "key": "channels", "value": "{{include_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.)" }, { "key": "include_docs", "value": "{{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." }, { "key": "revs", "value": "{{include_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." }, { "key": "update_seq", "value": "{{update_seq}}", "description": "Default is false. Indicates whether to include the update_seq (document sequence ID) property in the response." }, { "key": "limit", "value": "{{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." }, { "key": "keys", "value": "{{keys}}", "description": "Specify a list of document IDs.\nNote that this is an array field, so to retrieve docs with Ids of \"keyid1\" and \"keyid4\", for example, use a request in this format --\n\n```curl -X GET \\ 'http://localhost:4985/test_db/_all_docs?keys=[%22keyid1%22,%22keyid4%22]' \\ -H 'Accept: application/json'```\n" }, { "key": "startkey", "value": "{{startkey}}", "description": "Returns records starting with the specified key." }, { "key": "endkey", "value": "{{endkey}}", "description": "If this parameter is provided, stop returning records when the specified key is reached." } ] }, "description": "This request returns a built-in view of all the documents in the database.\n" }, "response": [ { "name": "Query results", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_all_docs?access=false&channels=false&include_docs=false&revs=false&update_seq=false&limit=&keys=,&startkey=&endkey=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_all_docs" ], "query": [ { "key": "access", "value": "false" }, { "key": "channels", "value": "false" }, { "key": "include_docs", "value": "false" }, { "key": "revs", "value": "false" }, { "key": "update_seq", "value": "false" }, { "key": "limit", "value": "" }, { "key": "keys", "value": "," }, { "key": "startkey", "value": "" }, { "key": "endkey", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"offset\": \"labore officia est\",\n \"rows\": [\n {\n \"id\": \"nulla magna\",\n \"key\": {},\n \"value\": {},\n \"doc\": {}\n },\n {\n \"id\": \"eiusmod magna consectetur\",\n \"key\": {},\n \"value\": {},\n \"doc\": {}\n }\n ],\n \"total_rows\": -40709129\n}" } ] }, { "name": "Get All docs", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"keys\": [\n \"\",\n \"\"\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_all_docs?access={{access}}&channels={{include_channels}}&include_docs={{include_docs}}&revs={{include_revs}}&update_seq={{update_seq}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_all_docs" ], "query": [ { "key": "access", "value": "{{access}}", "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." }, { "key": "channels", "value": "{{include_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.)" }, { "key": "include_docs", "value": "{{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." }, { "key": "revs", "value": "{{include_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." }, { "key": "update_seq", "value": "{{update_seq}}", "description": "Default is false. Indicates whether to include the update_seq (document sequence ID) property in the response." } ] }, "description": "This request retrieves specified documents from the database.\n" }, "response": [ { "name": "Query results", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"keys\": [\n \"\",\n \"\"\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_all_docs?access=false&channels=false&include_docs=false&revs=false&update_seq=false", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_all_docs" ], "query": [ { "key": "access", "value": "false" }, { "key": "channels", "value": "false" }, { "key": "include_docs", "value": "false" }, { "key": "revs", "value": "false" }, { "key": "update_seq", "value": "false" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"offset\": \"labore officia est\",\n \"rows\": [\n {\n \"id\": \"nulla magna\",\n \"key\": {},\n \"value\": {},\n \"doc\": {}\n },\n {\n \"id\": \"eiusmod magna consectetur\",\n \"key\": {},\n \"value\": {},\n \"doc\": {}\n }\n ],\n \"total_rows\": -40709129\n}" } ] }, { "name": "Create Bulk docs", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"docs\": [\n {\n \"_id\": \"\",\n \"_rev\": \"\",\n \"_exp\": \"\",\n \"_revisions\": {\n \"start\": \"\",\n \"ids\": [\n \"\",\n \"\"\n ]\n },\n \"_attachments\": {\n \"attachment_name\": {\n \"content_type\": \"\"\n }\n }\n },\n {\n \"_id\": \"\",\n \"_rev\": \"\",\n \"_exp\": \"\",\n \"_revisions\": {\n \"start\": \"\",\n \"ids\": [\n \"\",\n \"\"\n ]\n },\n \"_attachments\": {\n \"attachment_name\": {\n \"content_type\": \"\"\n }\n }\n }\n ],\n \"new_edits\": true\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_bulk_docs", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_bulk_docs" ], "variable": [ { "description": "(Required) Database name", "key": "db", "value": "" } ] }, "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" }, "response": [ { "name": "Documents have been created or updated. The response object is an array with the status for each document submitted in the original request.", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"docs\": [\n {\n \"_id\": \"\",\n \"_rev\": \"\",\n \"_exp\": \"\",\n \"_revisions\": {\n \"start\": \"\",\n \"ids\": [\n \"\",\n \"\"\n ]\n },\n \"_attachments\": {\n \"attachment_name\": {\n \"content_type\": \"\"\n }\n }\n },\n {\n \"_id\": \"\",\n \"_rev\": \"\",\n \"_exp\": \"\",\n \"_revisions\": {\n \"start\": \"\",\n \"ids\": [\n \"\",\n \"\"\n ]\n },\n \"_attachments\": {\n \"attachment_name\": {\n \"content_type\": \"\"\n }\n }\n }\n ],\n \"new_edits\": true\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_bulk_docs", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_bulk_docs" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Created", "code": 201, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "[\n {\n \"id\": \"Ut ex in adipisicing exercitation\",\n \"rev\": \"non culpa et Lorem\"\n },\n {\n \"id\": \"ex cillum amet ad\",\n \"rev\": \"in adipisicing Lorem\"\n }\n]" }, { "name": "The operation failed with a forbidden error. Probably because the document already exists in the database but a revision number wasn't specified.", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"docs\": [\n {\n \"_id\": \"\",\n \"_rev\": \"\",\n \"_exp\": \"\",\n \"_revisions\": {\n \"start\": \"\",\n \"ids\": [\n \"\",\n \"\"\n ]\n },\n \"_attachments\": {\n \"attachment_name\": {\n \"content_type\": \"\"\n }\n }\n },\n {\n \"_id\": \"\",\n \"_rev\": \"\",\n \"_exp\": \"\",\n \"_revisions\": {\n \"start\": \"\",\n \"ids\": [\n \"\",\n \"\"\n ]\n },\n \"_attachments\": {\n \"attachment_name\": {\n \"content_type\": \"\"\n }\n }\n }\n ],\n \"new_edits\": true\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_bulk_docs", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_bulk_docs" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Conflict", "code": 409, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"error\": \"conflict\",\n \"id\": \"enim ullamco id aute proident\",\n \"reason\": \"qui reprehenderit\",\n \"status\": 409\n}" } ] }, { "name": "GET Bulk Docs", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"docs\": [\n {\n \"id\": \"\"\n },\n {\n \"id\": \"\"\n }\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_bulk_get?revs={{include_revs}}&revs_limit={{revs_limit}}&attachments={{include_attachments}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_bulk_get" ], "query": [ { "key": "revs", "value": "{{include_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." }, { "key": "revs_limit", "value": "{{revs_limit}}", "description": "The number of revisions to include in the response from the document history. This parameter is only honoured if the `revs=true` querystring parameter is also sent in the request. If `revs=true` is specified and `revs_limit` isn't, the full revision history is returned." }, { "key": "attachments", "value": "{{include_attachments}}", "description": "Default is false. Include attachment bodies in response." } ] }, "description": "This request returns any number of documents, as individual bodies in a MIME multipart response.\nEach enclosed body contains one requested document. The bodies appear in the same order as in the request, but can also be identified by their X-Doc-ID and X-Rev-ID headers.\nA body for a document with no attachments will have content type application/json and contain the document itself.\nA body for a document that has attachments will be written as a nested multipart/related body. Its first part will be the document's JSON, and the subsequent parts will be the attachments (each identified by a Content-Disposition header giving its attachment name.)\n" }, "response": [ { "name": "Request completed successfully", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"docs\": [\n {\n \"id\": \"\"\n },\n {\n \"id\": \"\"\n }\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_bulk_get?revs=false&revs_limit=&attachments=false", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_bulk_get" ], "query": [ { "key": "revs", "value": "false" }, { "key": "revs_limit", "value": "" }, { "key": "attachments", "value": "false" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "multipart/mixed (document found)" } ], "cookie": [], "body": "--1cba224ff2aa106566e3ab65de9c861c24558ba368f8cd7f6fcde53b88f4\nContent-Type: application/json\n\n{\"_id\":\"doc123\",\"_rev\":\"1-c543d6514c609f65180f94af247aaffe\",\"hello\":\"world!\"}\n--1cba224ff2aa106566e3ab65de9c861c24558ba368f8cd7f6fcde53b88f4\n" }, { "name": "Request failed with a forbidden error. This usually happens because the user requesting that document doesn't have access to it. Access to documents is granted to users through channels.", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"docs\": [\n {\n \"id\": \"\"\n },\n {\n \"id\": \"\"\n }\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_bulk_get?revs=false&revs_limit=&attachments=false", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_bulk_get" ], "query": [ { "key": "revs", "value": "false" }, { "key": "revs_limit", "value": "" }, { "key": "attachments", "value": "false" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Moved Permanently", "code": 301, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "multipart/mixed" } ], "cookie": [], "body": "" } ] } ] }, { "name": " replication", "item": [ { "name": "{replication ID}", "item": [ { "name": "Retrieve a replication definition", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replication/{{replicationID}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replication", "{{replicationID}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "replicationID", "value": "", "description": "(Required) The {replicationID} parameter identifies the target replication.\n\n" } ] }, "description": "Returns requested (**replicationID**) replication definition\n" }, "response": [ { "name": "Successful response - returns requested replication definition in the body as JSON", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replication/{{replicationID}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replication", "{{replicationID}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "replicationID", "value": "", "description": "(Required) The {replicationID} parameter identifies the target replication.\n\n" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"this_rep\": {\n \"adhoc\": false,\n \"batch_size\": 200,\n \"conflict_resolution_type\": \"default\",\n \"continuous\": false,\n \"custom_conflict_resolver\": \"none\",\n \"direction\": \"nostrud\",\n \"enable_delta_sync\": false,\n \"filter\": \"exercitation qui veniam ea\",\n \"max_backoff_time\": 5,\n \"password\": \"Mandatory\",\n \"perf_tuning_params\": [\n \"est reprehenderit\",\n \"consequat sit ex anim Duis\"\n ],\n \"purge_on_removal\": false,\n \"query_params\": [\n \"dolor consequat\",\n \"exercitation officia\"\n ],\n \"remote\": \"ipsum ea sed\",\n \"replication_id\": \"aliqua in\",\n \"initial_state\": \"Running\",\n \"username\": \"Mandatory\"\n }\n}" } ] }, { "name": "Upsert a replication definition", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"adhoc\": false,\n \"batch_size\": 200,\n \"cancel\": false,\n \"conflict_resolution_type\": \"default\",\n \"continuous\": false,\n \"custom_conflict_resolver\": \"none\",\n \"direction\": \"\",\n \"enable_delta_sync\": false,\n \"filter\": \"\",\n \"max_backoff_time\": 5,\n \"password\": \"mandatory\",\n \"perf_tuning_params\": [\n \"\",\n \"\"\n ],\n \"purge_on_removal\": false,\n \"query_params\": [\n \"\",\n \"\"\n ],\n \"remote\": \"\",\n \"replication_id\": \"\",\n \"initial_state\": \"Running\",\n \"username\": \"Mandatory\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_replication/{{replicationID}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replication", "{{replicationID}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Name of the local database" }, { "key": "replicationID", "value": "", "description": "(Required)

If supplied, the replicationID parameter must be a valid replication id.

\n

If it is not supplied for a new replication*, then a random UUID is generated.

\n\n" } ] }, "description": "The **_replication** endpoint is used to manage both *ad hoc* and *persistent* replication operations.\n\nUsing a PUT request you can update (or insert, if it doesn't exist) a set of replication details.\n\n
**To cancel a replication**\nYou can cancel continuous replications by adding the cancel field to the JSON request object and setting the value to true.\n\nNote that the structure of the request must be identical to the original for the cancellation request to be honoured.\n\nFor example, if you requested continuous replication, the cancellation request must also contain the continuous field.\n" }, "response": [ { "name": "Replication successfully updated", "originalRequest": { "method": "PUT", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replication/{{replicationID}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replication", "{{replicationID}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Name of the local database" }, { "key": "replicationID", "value": "", "description": "(Required)

If supplied, the replicationID parameter must be a valid replication id.

\n

If it is not supplied for a new replication*, then a random UUID is generated.

\n\n" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"ok\": false,\n \"session_id\": \"ipsum ad aute\"\n}" }, { "name": "Replication successfully inserted", "originalRequest": { "method": "PUT", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replication/{{replicationID}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replication", "{{replicationID}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Name of the local database" }, { "key": "replicationID", "value": "", "description": "(Required)

If supplied, the replicationID parameter must be a valid replication id.

\n

If it is not supplied for a new replication*, then a random UUID is generated.

\n\n" } ] } }, "status": "Created", "code": 201, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"ok\": false,\n \"session_id\": \"ipsum ad aute\"\n}" } ] }, { "name": "Cancel and delete replication", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replication/{{replicationID}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replication", "{{replicationID}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Name of the local database" }, { "key": "replicationID", "value": "", "description": "(Required) The {replicationID} parameter identifies the target replication.\n\n" } ] }, "description": "Deletes a specific (**replicationID**) replication\n- Removes persisted replication definition\n- Removes all checkpoints associated with the replication\n- Deletes all replication status information associated with the replication\n" }, "response": [ { "name": "Replication successfully deleted", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replication/{{replicationID}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replication", "{{replicationID}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Name of the local database" }, { "key": "replicationID", "value": "", "description": "(Required) The {replicationID} parameter identifies the target replication.\n\n" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] } ] }, { "name": "Create a new replication definition", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"adhoc\": false,\n \"batch_size\": 200,\n \"cancel\": false,\n \"conflict_resolution_type\": \"default\",\n \"continuous\": false,\n \"custom_conflict_resolver\": \"none\",\n \"direction\": \"\",\n \"enable_delta_sync\": false,\n \"filter\": \"\",\n \"max_backoff_time\": 5,\n \"password\": \"mandatory\",\n \"perf_tuning_params\": [\n \"\",\n \"\"\n ],\n \"purge_on_removal\": false,\n \"query_params\": [\n \"\",\n \"\"\n ],\n \"remote\": \"\",\n \"replication_id\": \"\",\n \"initial_state\": \"Running\",\n \"username\": \"Mandatory\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_replication/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replication", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "The **_replication** endpoint is used to manage both *ad hoc* and *persistent* replication operations.\n\nUsing a POST request you can insert a new set of replication details.\n\n
**To Cancel a Replication**\nYou can cancel continuous replications by adding the cancel field to the JSON request object and setting the value to true.\nNote that the structure of the request must be identical to the original for the cancellation request to be honoured.\nFor example, if you requested continuous replication, the cancellation request must also contain the continuous field.\n" }, "response": [ { "name": "Replication successfully inserted", "originalRequest": { "method": "POST", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replication/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replication", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Created", "code": 201, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"ok\": false,\n \"session_id\": \"ipsum ad aute\"\n}" }, { "name": "Replication successfully updated", "originalRequest": { "method": "POST", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replication/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replication", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"ok\": false,\n \"session_id\": \"ipsum ad aute\"\n}" } ] }, { "name": "Retrieve all replication definitions", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replication/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replication", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "Returns an array object containing all replication definitions\n" }, "response": [ { "name": "Successful response - returns an array of replication definitions in the body as JSON", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replication/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replication", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "[\n {\n \"this_rep\": {\n \"adhoc\": false,\n \"batch_size\": 200,\n \"conflict_resolution_type\": \"default\",\n \"continuous\": false,\n \"custom_conflict_resolver\": \"none\",\n \"direction\": \"in Excepteur enim qui\",\n \"enable_delta_sync\": false,\n \"filter\": \"ea\",\n \"max_backoff_time\": 5,\n \"password\": \"Mandatory\",\n \"perf_tuning_params\": [\n \"sint\",\n \"ullamco in ipsum occaecat\"\n ],\n \"purge_on_removal\": false,\n \"query_params\": [\n \"deserunt sint pariatur occae\",\n \"m\"\n ],\n \"remote\": \"mini\",\n \"replication_id\": \"laboris consequat incididunt fugiat\",\n \"initial_state\": \"Running\",\n \"username\": \"Mandatory\"\n }\n },\n {\n \"this_rep\": {\n \"adhoc\": false,\n \"batch_size\": 200,\n \"conflict_resolution_type\": \"default\",\n \"continuous\": false,\n \"custom_conflict_resolver\": \"none\",\n \"direction\": \"cillum ex eu aute in\",\n \"enable_delta_sync\": false,\n \"filter\": \"ni\",\n \"max_backoff_time\": 5,\n \"password\": \"Mandatory\",\n \"perf_tuning_params\": [\n \"ex fugiat\",\n \"in Duis aliqua\"\n ],\n \"purge_on_removal\": false,\n \"query_params\": [\n \"anim\",\n \"in adipis\"\n ],\n \"remote\": \"est nostrud Lor\",\n \"replication_id\": \"qui est ullamco\",\n \"initial_state\": \"Running\",\n \"username\": \"Mandatory\"\n }\n }\n]" } ] } ] }, { "name": " replication Status", "item": [ { "name": "Returns information on specified replication", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replicationStatus/{{replicationID}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replicationStatus", "{{replicationID}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "replicationID", "value": "", "description": "(Required) The {replicationID} parameter identifies the target replication.\n\n" } ] }, "description": "Returns the status of the requested (**replicationID**) replication\n" }, "response": [ { "name": "Information about specified replication.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replicationStatus/{{replicationID}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replicationStatus", "{{replicationID}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "replicationID", "value": "", "description": "(Required) The {replicationID} parameter identifies the target replication.\n\n" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"replication_id\": \"est ut\",\n \"docs_read\": -5117415,\n \"docs_written\": 29503924,\n \"docs_purged\": 81865721,\n \"doc_write_failures\": -33270325,\n \"doc_write_conflict\": -22712438,\n \"status\": \"labore\",\n \"rejected_by_remote\": 69064462,\n \"rejected_by_local\": 54479667,\n \"last_seq_pull\": \"sint sit esse\",\n \"last_seq_push\": \"dolor labore et in\",\n \"error_message\": \"laboris sit nulla\",\n \"delta_sent\": -95621969,\n \"delta_recv\": 10237237,\n \"delta_requested\": -40518124,\n \"config\": {}\n}" } ] }, { "name": "Modify replication status", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "PUT", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replicationStatus/{{replicationID}}?action={{action}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replicationStatus", "{{replicationID}}" ], "query": [ { "key": "action", "value": "{{action}}", "description": "start, stop or reset" } ] }, "description": "Use this endpoint to change the status of the specified (**replicationID**) replication using the value of the `action` parameter.\n\nThe `action` parameter specifies the status to be set - valid values are\n\n - `start` -- starts a stopped replication\n\n - `stop` -- stops an active replication\n\n - `reset` -- resets a stopped replication (resets checkpoint to zero). For bidirectional replication, both push and pull checkpoints are reset to zero.\n\n For example\n\n ```\n http://localhost:4985/fred/_replicationStatus/{replicationID}?action=start\n ```\n" }, "response": [ { "name": "The required status is successfully set", "originalRequest": { "method": "PUT", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replicationStatus/{{replicationID}}?action=none", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replicationStatus", "{{replicationID}}" ], "query": [ { "key": "action", "value": "none" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"replication_id\": \"est ut\",\n \"docs_read\": -5117415,\n \"docs_written\": 29503924,\n \"docs_purged\": 81865721,\n \"doc_write_failures\": -33270325,\n \"doc_write_conflict\": -22712438,\n \"status\": \"labore\",\n \"rejected_by_remote\": 69064462,\n \"rejected_by_local\": 54479667,\n \"last_seq_pull\": \"sint sit esse\",\n \"last_seq_push\": \"dolor labore et in\",\n \"error_message\": \"laboris sit nulla\",\n \"delta_sent\": -95621969,\n \"delta_recv\": 10237237,\n \"delta_requested\": -40518124,\n \"config\": {}\n}" } ] }, { "name": "Returns replication status data for replications matching the criteria", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replicationStatus?activeOnly={{active_only}} &localOnly={{local_only}}&includeError={{include_error}} &includeConfig={{include_config}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replicationStatus" ], "query": [ { "key": "activeOnly", "value": "{{active_only}} ", "description": "When *true*, only active replications (state=starting, running, stopping) are returned\n" }, { "key": "localOnly", "value": "{{local_only}}", "description": "When *true* returns only replications run (or running) the local node since startup.\n\nBy default the response includes replications run or running across all nodes since node start-up.\n" }, { "key": "includeError", "value": "{{include_error}} ", "description": "When false, omits replications stopped due to error (state=error)\n\nBy default the response includes replications in `error` state.\n" }, { "key": "includeConfig", "value": "{{include_config}}", "description": "When *true* the replication definition is included in the response.\n" } ] }, "description": "**About**\n\nReturns replication status data for all replications matching the criteria specified in the {querystring} parameter.\n\n**Options**\n\nThe `{queryString}` parameter supports the following filter parameters - see *Parameter* section for more details\n\n - `activeOnly`\n - `localOnly`\n - `includeConfig`\n - `includeError`\n\n**Behavior**\n\nThe selection is made from all replications across *all* nodes.\n\nBy default the response includes status data for replications in any state (starting, running, stopped or error) from across all nodes.\n\n
Example
\n\n ```\n http://localhost:4985/{db}/_replicationStatus?activeOnly=false&localOnly=false&includeError=true\n\n ```\n" }, "response": [ { "name": "Returns information about the active replications", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_replicationStatus?activeOnly=false&localOnly=false&includeError=true&includeConfig=false", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_replicationStatus" ], "query": [ { "key": "activeOnly", "value": "false" }, { "key": "localOnly", "value": "false" }, { "key": "includeError", "value": "true" }, { "key": "includeConfig", "value": "false" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "[\n {\n \"replication_id\": \"in voluptate\",\n \"docs_read\": -24710626,\n \"docs_written\": -91307793,\n \"docs_purged\": -57566208,\n \"doc_write_failures\": 74254995,\n \"doc_write_conflict\": 55135772,\n \"status\": \"amet nulla nostrud dolore\",\n \"rejected_by_remote\": 91531726,\n \"rejected_by_local\": 80958709,\n \"last_seq_pull\": \"\",\n \"last_seq_push\": \"ipsum et qui enim\",\n \"error_message\": \"pariatur ad Lorem\",\n \"delta_sent\": 54553047,\n \"delta_recv\": -92606099,\n \"delta_requested\": -53525774,\n \"config\": {}\n },\n {\n \"replication_id\": \"sed nisi labore\",\n \"docs_read\": -18292327,\n \"docs_written\": -65122990,\n \"docs_purged\": 33854024,\n \"doc_write_failures\": -90535063,\n \"doc_write_conflict\": -80781244,\n \"status\": \"sit Lorem\",\n \"rejected_by_remote\": 26312291,\n \"rejected_by_local\": 3980110,\n \"last_seq_pull\": \"ulla\",\n \"last_seq_push\": \"magna aliq\",\n \"error_message\": \"dolor irure\",\n \"delta_sent\": 21490989,\n \"delta_recv\": 19473773,\n \"delta_requested\": 56590051,\n \"config\": {}\n }\n]" } ] } ] }, { "name": " session", "item": [ { "name": "{sessionid}", "item": [ { "name": "Retrieves information about a session", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_session/{{sessionid}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_session", "{{sessionid}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "sessionid", "value": "", "description": "(Required) Session id" } ] }, "description": "This request retrieves information about a session.\n" }, "response": [ { "name": "200 OK – Request completed successfully.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_session/{{sessionid}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_session", "{{sessionid}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "sessionid", "value": "", "description": "(Required) Session id" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"ok\": false,\n \"userCtx\": {}\n}" } ] }, { "name": "Deletes a single session", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_session/{{sessionid}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_session", "{{sessionid}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "sessionid", "value": "", "description": "(Required) Session id" } ] }, "description": "This request deletes a single session.\n" }, "response": [ { "name": "200 OK – Request completed successfully. If the session is successfully deleted, the response has an empty message body. If the session is not deleted, the message body contains error information.", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_session/{{sessionid}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_session", "{{sessionid}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "sessionid", "value": "", "description": "(Required) Session id" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] } ] }, { "name": "Creates a new session", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"ttl\": 86400\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_session", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_session" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "If the credentials provided in the request body are valid, the session is created with an idle session timeout of 24 hours. An idle session timeout in the context of Sync Gateway is defined as the following: if 10% or more of the current expiration time has elapsed when a subsequent request with that session id is processed, the session's expiry time is automatically updated to 24 hours from that time.\n" }, "response": [ { "name": "Session successfully created.", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"ttl\": 180\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_session", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_session" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"cookie_name\": \"irure commodo ea sed id\",\n \"expires\": \"dolor labore ame\",\n \"session_id\": \"dolor nulla Ut pariatur\"\n}" } ] } ] }, { "name": " user/{name}/ session", "item": [ { "name": "Deletes all user sessions", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_user/{{name}}/_session", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_user", "{{name}}", "_session" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "name", "value": "", "description": "(Required) User's name, may contain contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a user any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a user name in a URL path it must be escaped again using percent encoding e.g. if a user is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same user name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] }, "description": "This request delete the session for the specified user." }, "response": [ { "name": "User session deleted.", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_user/{{name}}/_session", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_user", "{{name}}", "_session" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "name", "value": "", "description": "(Required) User's name, may contain contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a user any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a user name in a URL path it must be escaped again using percent encoding e.g. if a user is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same user name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Deletes a specific user session", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_user/{{name}}/_session/{{sessionid}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_user", "{{name}}", "_session", "{{sessionid}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "name", "value": "", "description": "(Required) User's name, may contain contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a user any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a user name in a URL path it must be escaped again using percent encoding e.g. if a user is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same user name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" }, { "key": "sessionid", "value": "", "description": "(Required) Session id" } ] }, "description": "This request delete the specified session for the specified user." }, "response": [ { "name": "User session deleted.", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_user/{{name}}/_session/{{sessionid}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_user", "{{name}}", "_session", "{{sessionid}}" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" }, { "key": "name", "value": "", "description": "(Required) User's name, may contain contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a user any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a user name in a URL path it must be escaped again using percent encoding e.g. if a user is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same user name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" }, { "key": "sessionid", "value": "", "description": "(Required) Session id" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] } ] }, { "name": "database management", "item": [ { "name": "Get DB Info", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "This request retrieves information about the database.\n" }, "response": [ { "name": "Not Found. Requested database not found.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Not Found", "code": 404, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "Request completed successfully.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"db_name\": \"Lorem am\",\n \"db_uuid\": -69205563,\n \"disk_format_version\": 38073470,\n \"disk_size\": -353020,\n \"instance_start_time\": \"irure ut\",\n \"state\": \"eiusmod amet non velit\",\n \"update_seq\": \"exercitation non dolore consectetur\"\n}" }, { "name": "Unauthorized. Login required.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Create a Sync Gateway Database", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{clusteradmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"bucket\": \"travel-sample\",\n \"name\":\"travel-sample\",\n \"guest\": {\n \"disabled\": true\n },\n \"import_docs\": true,\n \"num_index_replicas\": 0,\n \"enable_shared_bucket_access\":true\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "Use this method to create a new Sync Gateway database.\n\nThe database name is taken from the URL path.\nPass the required database configuration settings as a JSON object in the request body.\n\n```\n{\n \"name\": \"todo_db\"\n \"bucket\": \"todo_app\"\n}\n```\n\nBy default the created database is brought online immediately, **unless** you include `\"offline\": true` in the configuration.\n" }, "response": [ { "name": "201 - OK - Create Operation successful", "originalRequest": { "method": "PUT", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Created", "code": 201, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "PUT", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Delete database", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "Delete database" }, "response": [ { "name": "Success", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{}" } ] }, { "name": "Compact the database", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_compact", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_compact" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "Use the ```/{db}/_compact``` endpoint to trigger the compaction process, which purges the JSON bodies of non-leaf revisions. This process is also run periodically by the system.\n\nNote -- Leaf revisions are not purged during compaction.\n\nCompaction does not remove JSON bodies of leaf nodes (conflicting branches). So it is also important to resolve conflicts in your application in order to re-claim disk space.\n\n**Pre-1.5 behavior differed from the above, as follows:**\n\n1.3-1.4 -- the parent revision is marked with a 5 minute expiry time, thus calling the `/{db}/_compact` endpoint is not necessary.\n\n1.2 -- obsolete revision bodies have to be cleaned up by calling the `/{db}/_compact` endpoint.\n" }, "response": [ { "name": "Request completed successfully.", "originalRequest": { "method": "POST", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_compact", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_compact" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"revs\": -58719943\n}" } ] }, { "name": "Bring a database online.", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"delay\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_online", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_online" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "When a database is online, Sync Gateway serves both Public and Admin REST API requests for the database. This request brings the specified database online, either immediately or after a specified delay.\n\nBringing a database online:\n\n- Closes the datbases connection to the backing Couchbase Server bucket.\n- Reloads the database configuration, and connects to the backing Cocuhbase Server bucket.\n- Re-establishes access to the database from the Public REST API.\n- Accepts all Admin API requests.\n\nYou can bring an offline database online after a specific delay. Uses for this include:\n\n- Making a database available for Couchbase Mobile clients at a specific time.\n- Making databases on several Sync Gateway instances available at the same time.\n\nFor more information about taking a database offline and bringing it back online, see [this guide](../database-offline.html).\n" }, "response": [ { "name": "Service Unavailable – Database resync is in progress.", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"delay\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_online", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_online" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Service Unavailable", "code": 503, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "OK – online request accepted.", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"delay\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_online", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_online" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "This request takes the specified database offline.", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_offline", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_offline" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "An offline database is not accessible through Sync Gateway's Public REST API. However, some commands can be given to Sync Gateway through the Admin REST API.\n\nTaking a database offline will:\n\n- Cleanly closes all active `_changes` feeds for this database.\n- Rejects all access to the database through the Public REST API (503 Service Unavailable).\n- Rejects most Admin API requests (503 Service Unavailable). A specific, short list of Admin REST API requests remain available (`GET /{db}`, `PUT /{db}/_config`, `POST /{db}/_resync`).\n- Stops webhook event handlers.\n- Does not take the backing Couchbase Server bucket offline. The bucket remains available and Sync Gateway keeps its connection to the bucket.\n\nWhen a database is offline, you can load properties for the database, without stopping and re-starting the Sync Gateway instance. The new properties are applied when the database is brought online.\n\nTaking a database offline that is in the progress of coming online will take the database offline after it comes online.\n\nFor more information about taking a database offline and bringing it back online, see [this guide](../database-offline.html).\n" }, "response": [ { "name": "Database brought online", "originalRequest": { "method": "POST", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_offline", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_offline" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Reprocess all documents by the database in the sync function.", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_resync", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_resync" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] }, "description": "This request causes all documents to be reprocessed by the database sync function. The _resync operation should be called if the sync function for a database has been modified in such a way that the channel or access mappings for any existing document would change as a result.\n\nWhen the sync function is invoked by _resync, the requireUser() and requireRole() calls will always return 'true'.\n\nA _resync operation on a database that is not in the offline state will be rejected (503 Service Unavailable).\n\nA _resync operation will block until all documents in the database have been processed.\n" }, "response": [ { "name": "OK – The _resync operation has completed", "originalRequest": { "method": "POST", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_resync", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_resync" ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"changes\": 60800624\n}" } ] } ] }, { "name": "OIDC", "item": [ { "name": "OpenID Connect Authentication.", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc?offline={{offline}} &provider={{provider}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc" ], "query": [ { "key": "offline", "value": "{{offline}} ", "description": "When true, requests a refresh token from the OP. Sets access_type=offline and prompt=consent on the redirect to the OP. Secure clients should set offline=true and persist the returned refresh token to secure storage." }, { "key": "provider", "value": "{{provider}}", "description": "OpenId Connect provider to be used for authentication, from the list of providers defined in the Sync Gateway Config. If not specified, will attempt to authenticate using the default provider." } ] }, "description": "Called by clients to initiate the OIDC Authorization Code flow.\n" }, "response": [ { "name": "Bad request. Reason is returned as \"OpenID Connect not configured for database default\". If a provider was specified in the request, that provider was not defined in the Sync Gateway config. If no provider was specified, OpenID Connect is not configure", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc?offline=&provider=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc" ], "query": [ { "key": "offline", "value": "" }, { "key": "provider", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Bad Request", "code": 400, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "Redirect to the requested OpenID Connect provider for authentication. Redirect link is returned in the Location header.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc?offline=&provider=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc" ], "query": [ { "key": "offline", "value": "" }, { "key": "provider", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Found", "code": 302, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "Server Error. Sync Gateway is unable to connect and validate the OpenID Connect provider requested.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc?offline=&provider=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc" ], "query": [ { "key": "offline", "value": "" }, { "key": "provider", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Internal Server Error", "code": 500, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "OpenID Connect Authentication callback.", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc_callback?code={{code}} &provider={{provider}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc_callback" ], "query": [ { "key": "code", "value": "{{code}} ", "description": "(Required) OpenID Connect Authorization code." }, { "key": "provider", "value": "{{provider}}", "description": "OpenId Connect provider to be used for authentication, from the list of providers defined in the Sync Gateway Config. If not specified, will attempt to authenticate using the default provider." } ] }, "description": "Sync Gateway callback URL that clients are redirected to by the OpenID Connect provider.\n" }, "response": [ { "name": "Bad request.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc_callback?code=&provider=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc_callback" ], "query": [ { "key": "code", "value": "" }, { "key": "provider", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Bad Request", "code": 400, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "Successful OpenID Connect authentication.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc_callback?code=&provider=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc_callback" ], "query": [ { "key": "code", "value": "" }, { "key": "provider", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"id_token\": \"n\",\n \"refresh_token\": \"sed cillum sit commodo\",\n \"session_id\": \"esse qui mollit ea proident\",\n \"name\": \"tempor minim dolore reprehenderit\",\n \"access_token\": \"laborum eiusmod ut et aute\",\n \"token_type\": \"Excepteur laborum do non\",\n \"expires_in\": -80387419.66846095\n}" }, { "name": "Authentication failed. Reason returned in the response body.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc_callback?code=&provider=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc_callback" ], "query": [ { "key": "code", "value": "" }, { "key": "provider", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "OpenID Connect Authentication.", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc_challenge?offline={{offline}}&provider={{provider}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc_challenge" ], "query": [ { "key": "offline", "value": "{{offline}}", "description": "When true, requests a refresh token from the OP. Sets access_type=offline and prompt=consent on the redirect to the OP. Secure clients should set offline=true and persist the returned refresh token to secure storage." }, { "key": "provider", "value": "{{provider}}", "description": "OpenId Connect provider to be used for authentication, from the list of providers defined in the Sync Gateway Config. If not specified, will attempt to authenticate using the default provider." } ] }, "description": "Called by clients to initiate the OIDC Authorization Code flow.\n" }, "response": [ { "name": "Server Error. Sync Gateway is unable to connect and validate the OpenID Connect provider requested.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc_challenge?offline=&provider=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc_challenge" ], "query": [ { "key": "offline", "value": "" }, { "key": "provider", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Internal Server Error", "code": 500, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "Bad request. Reason is returned as \"OpenID Connect not configured for database default\". If a provider was specified in the request, that provider was not defined in the Sync Gateway config. If no provider was specified, OpenID Connect is not configure", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc_challenge?offline=&provider=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc_challenge" ], "query": [ { "key": "offline", "value": "" }, { "key": "provider", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Bad Request", "code": 400, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "Redirect to the requested OpenID Connect provider for authentication. Redirect link is returned in the Location header.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc_challenge?offline=&provider=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc_challenge" ], "query": [ { "key": "offline", "value": "" }, { "key": "provider", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Found", "code": 302, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "OpenID Connect refresh.", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc_refresh?refresh_token={{refresh_token}}&provider={{provider}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc_refresh" ], "query": [ { "key": "refresh_token", "value": "{{refresh_token}}", "description": "(Required) OpenID Connect refresh token." }, { "key": "provider", "value": "{{provider}}", "description": "OpenId Connect provider to be used for authentication, from the list of providers defined in the Sync Gateway Config. If not specified, will attempt to authenticate using the default provider." } ] }, "description": "Used to obtain a new OpenID Connect ID token based on the provided refresh token.\n" }, "response": [ { "name": "Authentication failed. Unable to refresh token.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc_refresh?refresh_token=&provider=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc_refresh" ], "query": [ { "key": "refresh_token", "value": "" }, { "key": "provider", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "Bad request.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc_refresh?refresh_token=&provider=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc_refresh" ], "query": [ { "key": "refresh_token", "value": "" }, { "key": "provider", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "Bad Request", "code": 400, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "Successful OpenID Connect authentication.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_oidc_refresh?refresh_token=&provider=", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_oidc_refresh" ], "query": [ { "key": "refresh_token", "value": "" }, { "key": "provider", "value": "" } ], "variable": [ { "key": "db", "value": "", "description": "(Required) Database name" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"id_token\": \"consequat in dolor\",\n \"session_id\": \"culpa \",\n \"name\": \"commodo ut\",\n \"access_token\": \"proi\",\n \"token_type\": \"ea consectetur cupidatat\",\n \"expires_in\": 88664398.7507613\n}" } ] } ] } ] }, { "name": " role", "item": [ { "name": "{name}", "item": [ { "name": "Get role", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_role/{{username}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_role", "{{username}}" ] }, "description": "Request a specific role by name." }, "response": [ { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_role/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_role", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) Role name, may contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a role any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a role name in a URL path it must be escaped again using percent encoding e.g. if a role is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same role name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "The response contains information about this role.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_role/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_role", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) Role name, may contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a role any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a role name in a URL path it must be escaped again using percent encoding e.g. if a role is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same role name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"name\": \"anim mollit\",\n \"admin_channels\": [\n \"ipsum culpa sed ut sint\",\n \"esse non magna sint\"\n ],\n \"all_channels\": [\n \"voluptate est \",\n \"deserunt Excepteur\"\n ]\n}" } ] }, { "name": "Upsert a Role", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_role/{{username}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_role", "{{username}}" ] }, "description": "Use this convenience endpoint to upsert a Sync Gateway role\n" }, "response": [ { "name": "201 - OK - Create Operation successful", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_role/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_role", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) Role name, may contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a role any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a role name in a URL path it must be escaped again using percent encoding e.g. if a role is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same role name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "Created", "code": 201, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_role/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_role", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) Role name, may contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a role any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a role name in a URL path it must be escaped again using percent encoding e.g. if a role is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same role name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "200 - OK - Operation successful", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_role/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_role", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) Role name, may contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a role any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a role name in a URL path it must be escaped again using percent encoding e.g. if a role is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same role name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Deletes the role", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/_role/{{username}}", "host": [ "{{adminUrl}}" ], "path": [ "_role", "{{username}}" ] }, "description": "This request deletes the role with the specified name" }, "response": [ { "name": "200 OK – The role was successfully deleted", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/_role/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_role", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) Role name, may contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a role any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a role name in a URL path it must be escaped again using percent encoding e.g. if a role is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same role name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] } ] }, { "name": "Get roles", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_role", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_role" ] }, "description": "This request returns all the roles in the specified database." }, "response": [ { "name": "200 OK – Returns the list of roles as an array of strings", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_role", "host": [ "{{adminUrl}}" ], "path": [ "_role" ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "[\n \"non\",\n \"eli\"\n]" }, { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_role", "host": [ "{{adminUrl}}" ], "path": [ "_role" ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Role", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_role", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_role" ] }, "description": "This request creates a new role" }, "response": [ { "name": "201 - OK - Create Operation successful", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_role", "host": [ "{{adminUrl}}" ], "path": [ "_role" ] } }, "status": "Created", "code": 201, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "409 - Conflict – For example, an object with this name already exists", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_role", "host": [ "{{adminUrl}}" ], "path": [ "_role" ] } }, "status": "Conflict", "code": 409, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ]\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_role", "host": [ "{{adminUrl}}" ], "path": [ "_role" ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] } ] }, { "name": " user", "item": [ { "name": "{name}", "item": [ { "name": "Retrieve a User", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_user/{{username}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_user", "{{username}}" ] }, "description": "This request returns information about the specified user." }, "response": [ { "name": "200 OK – Returns information about the specified user", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_user/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_user", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) User's name, may contain contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a user any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a user name in a URL path it must be escaped again using percent encoding e.g. if a user is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same user name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"name\": \"\",\n \"password\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ],\n \"admin_roles\": [\n \"\",\n \"\"\n ],\n \"all_channels\": [\n \"labore proident adipisicing\",\n \"dolore\"\n ],\n \"email\": \"\",\n \"disabled\": \"\",\n \"roles\": [\n \"deserunt id eiusmod\",\n \"Excepteur\"\n ]\n}" }, { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_user/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_user", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) User's name, may contain contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a user any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a user name in a URL path it must be escaped again using percent encoding e.g. if a user is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same user name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Upsert a User", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "PUT", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"password\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ],\n \"admin_roles\": [\n \"\",\n \"\"\n ],\n \"email\": \"\",\n \"disabled\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_user/{{username}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_user", "{{username}}" ] }, "description": "Use this method to create or update a user\n" }, "response": [ { "name": "200 - OK - Operation successful", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"password\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ],\n \"admin_roles\": [\n \"\",\n \"\"\n ],\n \"email\": \"\",\n \"disabled\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_user/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_user", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) User's name, may contain contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a user any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a user name in a URL path it must be escaped again using percent encoding e.g. if a user is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same user name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "201 - OK - Create Operation successful", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"password\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ],\n \"admin_roles\": [\n \"\",\n \"\"\n ],\n \"email\": \"\",\n \"disabled\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_user/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_user", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) User's name, may contain contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a user any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a user name in a URL path it must be escaped again using percent encoding e.g. if a user is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same user name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "Created", "code": 201, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"password\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ],\n \"admin_roles\": [\n \"\",\n \"\"\n ],\n \"email\": \"\",\n \"disabled\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_user/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_user", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) User's name, may contain contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a user any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a user name in a URL path it must be escaped again using percent encoding e.g. if a user is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same user name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] }, { "name": "Delete a User", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_user/{{username}}", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_user", "{{username}}" ] }, "description": "This request deletes the user with the specified name" }, "response": [ { "name": "200 - OK - Operation successful", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/_user/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_user", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) User's name, may contain contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a user any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a user name in a URL path it must be escaped again using percent encoding e.g. if a user is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same user name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "DELETE", "header": [], "url": { "raw": "{{adminUrl}}/_user/{{name}}", "host": [ "{{adminUrl}}" ], "path": [ "_user", "{{name}}" ], "variable": [ { "key": "name", "value": "", "description": "(Required) User's name, may contain contain any combination of the characters `[a-z A-Z 0-9 - + . @ %]`, when creating a user any other characters must be percent encoded, see: [https://en.wikipedia.org/wiki/Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding).\n\nWhen passing a user name in a URL path it must be escaped again using percent encoding e.g. if a user is created with the name \"0|59\", the '|' character must first be percent-encoded resulting in \"0%7C59\". When using the same user name in a URL path it must be percent-encoded a second time resulting in \"0%257C59\"\n" } ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] } ] }, { "name": "Retrieves all users", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/{{db}}/_user/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_user", "" ] }, "description": "This request returns all users" }, "response": [ { "name": "404 - Not Found - Object missing or misreferenced", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_user/", "host": [ "{{adminUrl}}" ], "path": [ "_user", "" ] } }, "status": "Not Found", "code": 404, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "The message body contains the list of users in a JSON array. Each element of the array is a string representing the name of a user in the specified database.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_user/", "host": [ "{{adminUrl}}" ], "path": [ "_user", "" ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "[\n \"ea incididunt\",\n \"dolor irure cupidatat\"\n]" } ] }, { "name": "Create a new user", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{dbadmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "POST", "header": [ { "key": "Content-Type", "value": "application/json" } ], "body": { "mode": "raw", "raw": "{\n \"name\": \"{{username}}\",\n \"password\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ],\n \"admin_roles\": [\n \"\",\n \"\"\n ],\n \"email\": \"\",\n \"disabled\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/{{db}}/_user/", "host": [ "{{adminUrl}}" ], "path": [ "{{db}}", "_user", "" ] }, "description": "This request creates a new user" }, "response": [ { "name": "201 - OK - Create Operation successful", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"password\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ],\n \"admin_roles\": [\n \"\",\n \"\"\n ],\n \"email\": \"\",\n \"disabled\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_user/", "host": [ "{{adminUrl}}" ], "path": [ "_user", "" ] } }, "status": "Created", "code": 201, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "409 - Conflict – For example, an object with this name already exists", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"password\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ],\n \"admin_roles\": [\n \"\",\n \"\"\n ],\n \"email\": \"\",\n \"disabled\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_user/", "host": [ "{{adminUrl}}" ], "path": [ "_user", "" ] } }, "status": "Conflict", "code": 409, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" }, { "name": "401 - Unauthorized - Error validating credentials", "originalRequest": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\n \"name\": \"\",\n \"password\": \"\",\n \"admin_channels\": [\n \"\",\n \"\"\n ],\n \"admin_roles\": [\n \"\",\n \"\"\n ],\n \"email\": \"\",\n \"disabled\": \"\"\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{adminUrl}}/_user/", "host": [ "{{adminUrl}}" ], "path": [ "_user", "" ] } }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "text", "header": [ { "key": "Content-Type", "value": "text/plain" } ], "cookie": [], "body": "" } ] } ] }, { "name": "Get Server Metadata", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{clusteradmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/", "host": [ "{{adminUrl}}" ], "path": [ "" ] }, "description": "Returns meta-information about the server.\n" }, "response": [ { "name": "Meta-information about the server.", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/", "host": [ "{{adminUrl}}" ], "path": [ "" ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"couchdb\": \"sit ea veniam Ut\",\n \"vendor/name\": \"ullamco cupidatat nulla\",\n \"vendor/version\": \"incididunt sunt in aliquip\",\n \"version\": \"non anim ut qui\"\n}" } ] }, { "name": "Get Runtime Stats", "request": { "auth": { "type": "basic", "basic": [ { "key": "username", "value": "{{clusteradmin}}", "type": "string" }, { "key": "password", "value": "password", "type": "string" } ] }, "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_expvar", "host": [ "{{adminUrl}}" ], "path": [ "_expvar" ] }, "description": "The ```Expvar```method returns a number of runtime variables that you can view for debugging or performance monitoring purposes.\n\nThis method can also be accessed using Sync Gateway's [Metrics REST API](./rest-api-metrics.html)\n\n**See** : [Sync Gateway Statistics Schema](./../stats-monitoring.html) for more details on the metrics collected and reported by Sync Gateway.\n" }, "response": [ { "name": "OK - indicates success", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "{{adminUrl}}/_expvar", "host": [ "{{adminUrl}}" ], "path": [ "_expvar" ] } }, "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" } ], "cookie": [], "body": "{\n \"cmdline\": {},\n \"memstats\": {},\n \"cb\": {},\n \"mc\": {},\n \"syncGateway_changeCache\": {\n \"maxPending\": {},\n \"lag-tap-0000ms\": {},\n \"lag-queue-0000ms\": {},\n \"lag-total-0000ms\": {},\n \"outOfOrder\": {},\n \"view_queries\": {}\n },\n \"syncGateway_db\": {\n \"channelChangesFeeds\": {},\n \"channelLogAdds\": {},\n \"channelLogAppends\": {},\n \"channelLogCacheHits\": {},\n \"channelLogRewrites\": {},\n \"channelLogRewriteCollisions\": {},\n \"document_gets\": {},\n \"revisionCache_adds\": {},\n \"revisionCache_hits\": {},\n \"revisionCache_misses\": {},\n \"revs_added\": {},\n \"sequence_gets\": {},\n \"sequence_reserves\": {}\n },\n \"syncgateway\": {\n \"global\": {\n \"resource_utilization\": {\n \"admin_net_bytes_recv\": -68637527,\n \"admin_net_bytes_sent\": -80182765,\n \"error_count\": 53467486,\n \"go_memstats_heapalloc\": -71914362,\n \"go_memstats_heapidle\": -85550033,\n \"go_memstats_heapinuse\": 38321757,\n \"go_memstats_heapreleased\": 91247611,\n \"go_memstats_pausetotalns\": -99835989,\n \"go_memstats_stackinuse\": 16753116,\n \"go_memstats_stacksys\": 90562207,\n \"go_memstats_sys\": -36751301,\n \"goroutines_high_watermark\": 55017049,\n \"num_goroutines\": 50552630,\n \"process_cpu_percent_utilization\": -54334398,\n \"process_memory_resident\": 87026936,\n \"pub_net_bytes_recv\": 73618329,\n \"pub_net_bytes_sent\": 49379717,\n \"system_memory_total\": -64734001,\n \"warn_count\": 67495037\n }\n },\n \"per_db\": [\n {\n \"cache\": {},\n \"database\": {},\n \"security\": {}\n },\n {\n \"cache\": {},\n \"database\": {},\n \"security\": {}\n }\n ],\n \"per_replication\": [\n {\n \"$replication_id\": {\n \"sgr_active\": true,\n \"sgr_docs_checked_sent\": 71743662,\n \"sgr_num_attachments_transferred\": -10239809,\n \"sgr_num_attachment_bytes_transferred\": -44122556,\n \"sgr_num_docs_failed_to_push\": -91779411,\n \"sgr_num_docs_pushed\": -66397698\n }\n },\n {\n \"$replication_id\": {\n \"sgr_active\": false,\n \"sgr_docs_checked_sent\": -60826981,\n \"sgr_num_attachments_transferred\": 8169236,\n \"sgr_num_attachment_bytes_transferred\": 67050258,\n \"sgr_num_docs_failed_to_push\": -71218384,\n \"sgr_num_docs_pushed\": 70314701\n }\n }\n ]\n }\n}" } ] } ], "variable": [ { "key": "adminUrl", "value": "http://localhost:4985", "type": "string" }, { "key": "replicationID", "value": "", "type": "any", "description": "(Required) The {replicationID} parameter identifies the target replication.\n\n" } ] }