| level | integer [ 1 .. 3 ] Deprecated query Parameters | logLevel | string Enum: "none" "error" "warn" "info" "debug" "trace" The is what to set the console log level too.
+ | | level | integer [ 1 .. 3 ] Deprecated Deprecated: use log level instead.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Deprecated: use log level instead.
This sets the console log level depending on the value provide. 1 sets to info, 2 sets to warn, and 3 sets to error.'
- |
Request Body schema: application/jsonThe map of log keys to use for console logging.
- | property name* additional property | boolean The log key and whether it is enabled or not.
- |
Responses{protocol}://{hostname}:4985/_logging Request samples Content typeapplication/json {"HTTP": true, "CRUD": false, "Changes": true } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Update console logging settings Deprecated Request Body schema: application/jsonThe map of log keys to use for console logging.
+ | property name* additional property | boolean The log key and whether it is enabled or not.
+ |
Responses{protocol}://{hostname}:4985/_logging Request samples Content typeapplication/json {"HTTP": true, "CRUD": false, "Changes": true } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Update console logging settings Deprecated Deprecated in favour of PUT /_config
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Deprecated in favour of PUT /_config
This is for enabling the log keys provided and optionally changing the console log level.
Required Sync Gateway RBAC roles:
- query Parameters| logLevel | string Enum: "none" "error" "warn" "info" "debug" "trace" The is what to set the console log level too.
- | | level | integer [ 1 .. 3 ] Deprecated query Parameters | logLevel | string Enum: "none" "error" "warn" "info" "debug" "trace" The is what to set the console log level too.
+ | | level | integer [ 1 .. 3 ] Deprecated Deprecated: use log level instead.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Deprecated: use log level instead.
This sets the console log level depending on the value provide. 1 sets to info, 2 sets to warn, and 3 sets to error.'
- |
Request Body schema: application/jsonThe console log keys to upsert.
- | property name* additional property | boolean The log key and whether it is enabled or not.
- |
Responses{protocol}://{hostname}:4985/_logging Request samples Content typeapplication/json {"HTTP": true, "CRUD": false, "Changes": true } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Get server configuration Request Body schema: application/jsonThe console log keys to upsert.
+ | property name* additional property | boolean The log key and whether it is enabled or not.
+ |
Responses{protocol}://{hostname}:4985/_logging Request samples Content typeapplication/json {"HTTP": true, "CRUD": false, "Changes": true } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Get server configuration This will return the configuration that the Sync Gateway node was initially started up with, or the currently config if include_runtime is set.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This will return the configuration that the Sync Gateway node was initially started up with, or the currently config if include_runtime is set.
Required Sync Gateway RBAC roles:
- query Parameters| redact | boolean Deprecated Default: "true" No longer supported field.
- | | include_runtime | boolean Default: false Whether to include the values set after starting (at runtime), default values, and all loaded databases.
- |
Responses{protocol}://{hostname}:4985/_config Response samples Content typeapplication/json {"bootstrap": {"group_id": "default", "config_update_frequency": "10s", "server": "string", "username": "string", "password": "string", "ca_cert_path": "string", "server_tls_skip_verify": false, "x509_cert_path": "string", "x509_key_path": "string", "use_tls_server": true }, "api": {"public_interface": ":4984", "admin_interface": "127.0.0.1:4985", "metrics_interface": "127.0.0.1:4986", "profile_interface": "string", "admin_interface_authentication": true, "metrics_interface_authentication": true, "enable_advanced_auth_dp": true, "server_read_timeout": "string", "server_write_timeout": "string", "read_header_timeout": "5s", "idle_timeout": "90s", "pretty": true, "max_connections": 0, "compress_responses": true, "hide_product_version": true, "https": {"tls_minimum_version": "tlsv1.2", "tls_cert_path": "string", "tls_key_path": "string" }, }, "logging": {"log_file_path": "string", "redaction_level": "none", }, "replicator": {"max_heartbeat": "string", "blip_compression": 9, "max_concurrent_replications": 0, "max_concurrent_changes_batches": 2, "max_concurrent_revs": 5 }, "unsupported": {"use_xattr_config": false, "stats_log_frequency": "1m", "use_stdlib_json": false, "allow_dbconfig_env_vars": true, "diagnostic_interface": "" }, "database_credentials": {}, "bucket_credentials": {}, "max_file_descriptors": 5000, "couchbase_keepalive_interval": 0, "heap_profile_collection_threshold": "max memory", "heap_profile_disable_collection": false }Set runtime configuration query Parameters | redact | boolean Deprecated Default: "true" No longer supported field.
+ | | include_runtime | boolean Default: false Whether to include the values set after starting (at runtime), default values, and all loaded databases.
+ |
Responses{protocol}://{hostname}:4985/_config Response samples Content typeapplication/json {"bootstrap": {"group_id": "default", "config_update_frequency": "10s", "server": "string", "username": "string", "password": "string", "ca_cert_path": "string", "server_tls_skip_verify": false, "x509_cert_path": "string", "x509_key_path": "string", "use_tls_server": true }, "api": {"public_interface": ":4984", "admin_interface": "127.0.0.1:4985", "metrics_interface": "127.0.0.1:4986", "profile_interface": "string", "admin_interface_authentication": true, "metrics_interface_authentication": true, "enable_advanced_auth_dp": true, "server_read_timeout": "string", "server_write_timeout": "string", "read_header_timeout": "5s", "idle_timeout": "90s", "pretty": true, "max_connections": 0, "compress_responses": true, "hide_product_version": true, "https": {"tls_minimum_version": "tlsv1.2", "tls_cert_path": "string", "tls_key_path": "string" }, }, "logging": {"log_file_path": "string", "redaction_level": "none", }, "replicator": {"max_heartbeat": "string", "blip_compression": 9, "max_concurrent_replications": 0, "max_concurrent_changes_batches": 2, "max_concurrent_revs": 5 }, "unsupported": {"use_xattr_config": false, "stats_log_frequency": "1m", "use_stdlib_json": false, "allow_dbconfig_env_vars": true, "diagnostic_interface": "" }, "database_credentials": {}, "bucket_credentials": {}, "max_file_descriptors": 5000, "couchbase_keepalive_interval": 0, "heap_profile_collection_threshold": "max memory", "heap_profile_disable_collection": false }Set runtime configuration This endpoint is used to dynamically set runtime options, like logging without needing a restart.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This endpoint is used to dynamically set runtime options, like logging without needing a restart.
These options are not persisted, and will not survive a restart of Sync Gateway.
The endpoint only accepts a limited number of options that can be changed at runtime. See request body schema for allowable options.
Required Sync Gateway RBAC roles:
- Request Body schema: application/json | | | max_concurrent_replications | integer Default: 0 Maximum number of concurrent replication connections allowed. If set to 0 this limit will be ignored.
- |
Responses{protocol}://{hostname}:4985/_config Request samples Content typeapplication/json Response samples Content typeapplication/json {"error": "string", "reason": "string" }Get the server status Request Body schema: application/json | | | max_concurrent_replications | integer Default: 0 Maximum number of concurrent replication connections allowed. If set to 0 this limit will be ignored.
+ |
Responses{protocol}://{hostname}:4985/_config Request samples Content typeapplication/json Response samples Content typeapplication/json {"error": "string", "reason": "string" }Get the server status This will retrieve the status of each database and the overall server status.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This will retrieve the status of each database and the overall server status.
Required Sync Gateway RBAC roles:
- Responses{protocol}://{hostname}:4985/_status Response samples Content typeapplication/json {"databases": {"property1": {"seq": 0, "server_uuid": "string", "state": "Online", "replication_status": [{"replication_id": "string", "config": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ] }, "status": "stopped", "error_message": "string", "docs_read": 0, "docs_checked_pull": 0, "docs_purged": 0, "rejected_by_local": 0, "last_seq_pull": "string", "deltas_recv": 0, "deltas_requested": 0, "docs_written": 0, "docs_checked_push": 0, "docs_write_failures": 0, "docs_write_conflicts": 0, "rejected_by_remote": 0, "last_seq_push": "string", "deltas_sent": 0 } ], "cluster": {"replication": {"replication_id": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ], "assigned_node": "string", "target_state": "running" } }, "nodes": {"node_uuid": {"uuid": "string", "host": "string" } } } }, "property2": {"seq": 0, "server_uuid": "string", "state": "Online", "replication_status": [{"replication_id": "string", "config": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ] }, "status": "stopped", "error_message": "string", "docs_read": 0, "docs_checked_pull": 0, "docs_purged": 0, "rejected_by_local": 0, "last_seq_pull": "string", "deltas_recv": 0, "deltas_requested": 0, "docs_written": 0, "docs_checked_push": 0, "docs_write_failures": 0, "docs_write_conflicts": 0, "rejected_by_remote": 0, "last_seq_push": "string", "deltas_sent": 0 } ], "cluster": {"replication": {"replication_id": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ], "assigned_node": "string", "target_state": "running" } }, "nodes": {"node_uuid": {"uuid": "string", "host": "string" } } } } }, "version": "string" }Get the status of the Sync Gateway Collect Info Responses {protocol}://{hostname}:4985/_status Response samples Content typeapplication/json {"databases": {"property1": {"seq": 0, "server_uuid": "string", "state": "Online", "replication_status": [{"replication_id": "string", "config": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ] }, "status": "stopped", "error_message": "string", "docs_read": 0, "docs_checked_pull": 0, "docs_purged": 0, "rejected_by_local": 0, "last_seq_pull": "string", "deltas_recv": 0, "deltas_requested": 0, "docs_written": 0, "docs_checked_push": 0, "docs_write_failures": 0, "docs_write_conflicts": 0, "rejected_by_remote": 0, "last_seq_push": "string", "deltas_sent": 0 } ], "cluster": {"replication": {"replication_id": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ], "assigned_node": "string", "target_state": "running" } }, "nodes": {"node_uuid": {"uuid": "string", "host": "string" } } } }, "property2": {"seq": 0, "server_uuid": "string", "state": "Online", "replication_status": [{"replication_id": "string", "config": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ] }, "status": "stopped", "error_message": "string", "docs_read": 0, "docs_checked_pull": 0, "docs_purged": 0, "rejected_by_local": 0, "last_seq_pull": "string", "deltas_recv": 0, "deltas_requested": 0, "docs_written": 0, "docs_checked_push": 0, "docs_write_failures": 0, "docs_write_conflicts": 0, "rejected_by_remote": 0, "last_seq_push": "string", "deltas_sent": 0 } ], "cluster": {"replication": {"replication_id": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ], "assigned_node": "string", "target_state": "running" } }, "nodes": {"node_uuid": {"uuid": "string", "host": "string" } } } } }, "version": "string" }Get the status of the Sync Gateway Collect Info This will return the status of whether Sync Gateway Collect Info (sgcollect_info) is currently running or not.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This will return the status of whether Sync Gateway Collect Info (sgcollect_info) is currently running or not.
Required Sync Gateway RBAC roles:
- Responses{protocol}://{hostname}:4985/_sgcollect_info Response samples Content typeapplication/json Start Sync Gateway Collect Info Responses {protocol}://{hostname}:4985/_sgcollect_info Response samples Content typeapplication/json Start Sync Gateway Collect Info This endpoint is used to start a Sync Gateway Collect Info (sgcollect_info) job so that Sync Gateway diagnostic data can be outputted to a file.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This endpoint is used to start a Sync Gateway Collect Info (sgcollect_info) job so that Sync Gateway diagnostic data can be outputted to a file.
Required Sync Gateway RBAC roles:
- Request Body schema: application/json| redact_level | string Default: "partial" Enum: "partial" "none" The redaction level to use for redacting the collected logs.
- | | redact_salt | string The salt to use for the log redactions.
- | | output_dir | string Default: "The configured path set in the startup config `logging.log_file_path`" Request Body schema: application/json| redact_level | string Default: "partial" Enum: "partial" "none" The redaction level to use for redacting the collected logs.
+ | | redact_salt | string The salt to use for the log redactions.
+ | | output_dir | string Default: "The configured path set in the startup config `logging.log_file_path`" The directory to output the collected logs zip file at.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The directory to output the collected logs zip file at.
This overrides the configured default output directory configured in the startup config logging.log_file_path.
- | | upload | boolean | upload | boolean If set, upload the logs to Couchbase Support.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> If set, upload the logs to Couchbase Support.
A customer name must be set if this is set.
- | | | upload_host | string Default: "https://uploads.couchbase.com" The host to send the logs too.
- | | upload_proxy | string The proxy to use while uploading the logs.
- | | customer | string The customer name to use when uploading the logs.
- | | ticket | string [ 1 .. 7 ] characters The Zendesk ticket number to use when uploading logs.
- |
Responses{protocol}://{hostname}:4985/_sgcollect_info Request samples Content typeapplication/json {"redact_level": "partial", "redact_salt": "string", "output_dir": "The configured path set in the startup config `logging.log_file_path`", "upload": true, "upload_proxy": "string", "customer": "string", "ticket": "string" } Response samples Content typeapplication/json Cancel the Sync Gateway Collect Info job | upload_host | string Default: "https://uploads.couchbase.com" The host to send the logs too.
+ | | | upload_proxy | string The proxy to use while uploading the logs.
+ | | customer | string The customer name to use when uploading the logs.
+ | | ticket | string [ 1 .. 7 ] characters The Zendesk ticket number to use when uploading logs.
+ |
Responses{protocol}://{hostname}:4985/_sgcollect_info Request samples Content typeapplication/json {"redact_level": "partial", "redact_salt": "string", "output_dir": "The configured path set in the startup config `logging.log_file_path`", "upload": true, "upload_proxy": "string", "customer": "string", "ticket": "string" } Response samples Content typeapplication/json Cancel the Sync Gateway Collect Info job This endpoint is used to cancel a current Sync Gateway Collect Info (sgcollect_info) job that is running.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This endpoint is used to cancel a current Sync Gateway Collect Info (sgcollect_info) job that is running.
Required Sync Gateway RBAC roles:
- Responses{protocol}://{hostname}:4985/_sgcollect_info Response samples Content typeapplication/json Run the post upgrade process on all databases Responses {protocol}://{hostname}:4985/_sgcollect_info Response samples Content typeapplication/json Run the post upgrade process on all databases The post upgrade process involves removing obsolete design documents and indexes when they are no longer needed.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> The post upgrade process involves removing obsolete design documents and indexes when they are no longer needed.
Required Sync Gateway RBAC roles:
- query Parameters| preview | string Default: "false" If set, a dry-run will be done to return what would be removed.
- |
{protocol}://{hostname}:4985/_post_upgrade Response samples Content typeapplication/json {"post_upgrade_results": {"db1": {"removed_design_docs": [], }, "db2": {"removed_design_docs": [], } }, "preview": true }Get server information Returns information about the Sync Gateway node.
- Responses{protocol}://{hostname}:4985/ Response samples Content typeapplication/json Check if server online Check if the server is online by checking the status code of response.
- {protocol}://{hostname}:4985/ Check if API is available Returns OK status if API is available.
- {protocol}://{hostname}:4985/_ping Check if API is available Returns OK status if API is available.
- {protocol}://{hostname}:4985/_ping query Parameters | preview | string Default: "false" If set, a dry-run will be done to return what would be removed.
+ |
{protocol}://{hostname}:4985/_post_upgrade Response samples Content typeapplication/json {"post_upgrade_results": {"db1": {"removed_design_docs": [], }, "db2": {"removed_design_docs": [], } }, "preview": true }Get server information Returns information about the Sync Gateway node.
+ Responses{protocol}://{hostname}:4985/ Response samples Content typeapplication/json Check if server online Check if the server is online by checking the status code of response.
+ {protocol}://{hostname}:4985/ Check if API is available Returns OK status if API is available.
+ {protocol}://{hostname}:4985/_ping Check if API is available Returns OK status if API is available.
+ {protocol}://{hostname}:4985/_ping Create and manage Sync Gateway databases
- Get resync status Get resync status This will retrieve the status of last resync operation (whether it is running or not) in the Sync Gateway cluster.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This will retrieve the status of last resync operation (whether it is running or not) in the Sync Gateway cluster.
Required Sync Gateway RBAC roles:
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Responses{protocol}://{hostname}:4985/{db}/_resync Response samples Content typeapplication/json {"status": "running", "start_time": "string", "last_error": "string", "docs_changed": 0, "docs_processed": 0, "collections_processing": {"scopeName": {"collection1": null, "collection2": null } } }Start or stop Resync path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
Responses{protocol}://{hostname}:4985/{db}/_resync Response samples Content typeapplication/json {"status": "running", "start_time": "string", "last_error": "string", "docs_changed": 0, "docs_processed": 0, "collections_processing": {"scopeName": {"collection1": null, "collection2": null } } }Start or stop Resync This can be used to start or stop a resync operation. A resync operation will cause all documents in the keyspace to be reprocessed through the sync function.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This can be used to start or stop a resync operation. A resync operation will cause all documents in the keyspace to be reprocessed through the sync function.
Generally, a resync operation might be wanted when the sync function has been modified in such a way that the channel or access mappings for any existing documents would change as a result.
A resync operation cannot be run if the database is online. The database can be taken offline by calling the POST /{db}/_offline endpoint.
In a multi-node cluster, the resync operation must be run on only a single node. Therefore, users should bring other nodes offline before initiating this action. Undefined system behaviour will happen if running resync on more than 1 node.
@@ -967,25 +967,25 @@
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
query Parameters| action | string Default: "start" Enum: "start" "stop" This is whether to start a new resync job or stop an existing one.
- | | regenerate_sequences | boolean Use this only when requested to do so by the Couchbase support team This request will regenerate the sequence numbers for each document processed. If scopes parameter is specified, the principal sequence documents will not have their sequences updated.
- | | reset | boolean Default: false This forces a fresh resync run instead of trying to resume the previous resync operation
- |
Request Body schema: application/json | object This controls for which collections resync will run
- | | regenerate_sequences | boolean Default: false This can be used as an alternative to query param regenerate_sequences. If either query param or this is set to true, then the request will regenerate the sequence numbers for each document processed.
- |
Responses{protocol}://{hostname}:4985/{db}/_resync Request samples Content typeapplication/json Response samples Content typeapplication/json {"status": "running", "start_time": "string", "last_error": "string", "docs_changed": 0, "docs_processed": 0, "collections_processing": {"scopeName": {"collection1": null, "collection2": null } } }Bring the database online path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
query Parameters| action | string Default: "start" Enum: "start" "stop" This is whether to start a new resync job or stop an existing one.
+ | | regenerate_sequences | boolean Use this only when requested to do so by the Couchbase support team This request will regenerate the sequence numbers for each document processed. If scopes parameter is specified, the principal sequence documents will not have their sequences updated.
+ | | reset | boolean Default: false This forces a fresh resync run instead of trying to resume the previous resync operation
+ |
Request Body schema: application/json | object This controls for which collections resync will run
+ | | regenerate_sequences | boolean Default: false This can be used as an alternative to query param regenerate_sequences. If either query param or this is set to true, then the request will regenerate the sequence numbers for each document processed.
+ |
Responses{protocol}://{hostname}:4985/{db}/_resync Request samples Content typeapplication/json Response samples Content typeapplication/json {"status": "running", "start_time": "string", "last_error": "string", "docs_changed": 0, "docs_processed": 0, "collections_processing": {"scopeName": {"collection1": null, "collection2": null } } }Bring the database online This will bring the database online so the Public and full Admin REST API requests can be served.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This will bring the database online so the Public and full Admin REST API requests can be served.
Bringing a database online will:
- Close the database connection to the backing Couchbase Server bucket.
@@ -1017,21 +1017,21 @@
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Request Body schema: application/jsonAdd an optional delay to wait before bringing the database online
- | delay | integer Default: 0 The amount of seconds to delay bringing the database online.
- |
Responses{protocol}://{hostname}:4985/{db}/_online Request samples Content typeapplication/json Response samples Content typeapplication/json Take the database offline path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
Request Body schema: application/jsonAdd an optional delay to wait before bringing the database online
+ | delay | integer Default: 0 The amount of seconds to delay bringing the database online.
+ |
Responses{protocol}://{hostname}:4985/{db}/_online Request samples Content typeapplication/json Response samples Content typeapplication/json Take the database offline This will take the database offline meaning actions can be taken without disrupting current operations ungracefully or having the restart the Sync Gateway instance.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This will take the database offline meaning actions can be taken without disrupting current operations ungracefully or having the restart the Sync Gateway instance.
This will not take the backing Couchbase Server bucket offline.
Taking a database offline that is in the progress of coming online will take the database offline after it comes online.
Taking the database offline will:
@@ -1059,31 +1059,31 @@
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Responses{protocol}://{hostname}:4985/{db}/_offline Response samples Content typeapplication/json Get a list of all the databases path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
Responses{protocol}://{hostname}:4985/{db}/_offline Response samples Content typeapplication/json Get a list of all the databases This retrieves all the databases that are in the current Sync Gateway node. If verbose, returns bucket and state information for each database, otherwise returns names only.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This retrieves all the databases that are in the current Sync Gateway node. If verbose, returns bucket and state information for each database, otherwise returns names only.
Required Sync Gateway RBAC roles:
- Responses{protocol}://{hostname}:4985/_all_dbs Response samples Content typeapplication/json Manage a compact operation Responses{protocol}://{hostname}:4985/_all_dbs Response samples Content typeapplication/json Manage a compact operation This allows a new compact operation to be done on the database, or to stop an existing running compact operation.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This allows a new compact operation to be done on the database, or to stop an existing running compact operation.
The type of compaction that is done depends on what the type query parameter is set to. The 2 options will:
tombstone - purge the JSON bodies of non-leaf revisions. This is known as database compaction. Database compaction is done periodically automatically by the system. JSON bodies of leaf nodes (conflicting branches) are not removed therefore it is important to resolve conflicts in order to re-claim disk space.
@@ -1105,127 +1105,127 @@
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
query Parameters| type | string Default: "tombstone" Enum: "attachment" "tombstone" path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
query Parameters| type | string Default: "tombstone" Enum: "attachment" "tombstone" This is the type of compaction to use. The type must be either:
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> This is the type of compaction to use. The type must be either:
attachment for cleaning up legacy (pre-3.0) attachments
tombstone for purging the JSON bodies of non-leaf revisions.'
- | | action | string Default: "start" Enum: "start" "stop" Defines whether the a compact operation is being started or stopped.
- | | reset | boolean | action | string Default: "start" Enum: "start" "stop" Defines whether the a compact operation is being started or stopped.
+ | | | reset | boolean Attachment compaction only
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Attachment compaction only
This forces a fresh compact start instead of trying to resume the previous failed compact operation.
- | | dry_run | boolean | dry_run | boolean Attachment compaction only
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Attachment compaction only
This will run through all 3 stages of attachment compact but will not purge any attachments. This can be used to check how many attachments will be purged.'
- | |
Responses{protocol}://{hostname}:4985/{db}/_compact Response samples Content typeapplication/json {"error": "string", "reason": "string" }Get the status of the most recent compact operation Responses {protocol}://{hostname}:4985/{db}/_compact Response samples Content typeapplication/json {"error": "string", "reason": "string" }Get the status of the most recent compact operation This will retrieve the current status of the most recent compact operation.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This will retrieve the current status of the most recent compact operation.
Required Sync Gateway RBAC roles:
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
query Parameters| type | string Default: "tombstone" Enum: "attachment" "tombstone" path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
query Parameters| type | string Default: "tombstone" Enum: "attachment" "tombstone" This is the type of compaction to use. The type must be either:
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> This is the type of compaction to use. The type must be either:
attachment for cleaning up legacy (pre-3.0) attachments
tombstone for purging the JSON bodies of non-leaf revisions.'
- |
Responses{protocol}://{hostname}:4985/{db}/_compact Response samples Content typeapplication/json {"status": "string", "start_time": "string", "last_error": "string", "docs_purged": "string", "marked_attachments": "string", "purged_attachments": "string", "compact_id": "string", "phase": "string", "dry_run": "mark" }Get database information Responses {protocol}://{hostname}:4985/{db}/_compact Response samples Content typeapplication/json {"status": "string", "start_time": "string", "last_error": "string", "docs_purged": "string", "marked_attachments": "string", "purged_attachments": "string", "compact_id": "string", "phase": "string", "dry_run": "mark" }Get database information Retrieve information about the database.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Retrieve information about the database.
Required Sync Gateway RBAC roles:
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Responses{protocol}://{hostname}:4985/{db}/ Response samples Content typeapplication/json {"db_name": "db", "update_seq": 123456, "committed_update_seq": 123456, "instance_start_time": 1644600082279583, "compact_running": true, "purge_seq": 0, "disk_format_version": 0, "state": "Online", "server_uuid": "995618a6a6cc9ac79731bd13240e19b5", "init_in_progress": true }Remove a database path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
Responses{protocol}://{hostname}:4985/{db}/ Response samples Content typeapplication/json {"db_name": "db", "update_seq": 123456, "committed_update_seq": 123456, "instance_start_time": 1644600082279583, "compact_running": true, "purge_seq": 0, "disk_format_version": 0, "state": "Online", "server_uuid": "995618a6a6cc9ac79731bd13240e19b5", "init_in_progress": true }Remove a database Removes a database from the Sync Gateway cluster
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Removes a database from the Sync Gateway cluster
Note: If running in legacy mode, this will only delete the database from the current node.
Required Sync Gateway RBAC roles:
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Responses{protocol}://{hostname}:4985/{db}/ Response samples Content typeapplication/json Check if database exists path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
Responses{protocol}://{hostname}:4985/{db}/ Response samples Content typeapplication/json Check if database exists Check if a database exists by using the response status code.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Check if a database exists by using the response status code.
Required Sync Gateway RBAC roles:
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Responses{protocol}://{hostname}:4985/{db}/ Response samples Content typeapplication/json Create a new Sync Gateway database path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
Responses{protocol}://{hostname}:4985/{db}/ Response samples Content typeapplication/json Create a new Sync Gateway database This is to create a new database for Sync Gateway.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This is to create a new database for Sync Gateway.
The new database name will be the name specified in the URL, not what is specified in the request body database configuration.
If the bucket is not provided in the database configuration, Sync Gateway will attempt to find and use the database name as the bucket.
By default, the new database will be brought online immediately. This can be avoided by including "offline": true in the configuration in the request body.
@@ -1241,843 +1241,843 @@
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
query Parameters| disable_oidc_validation | boolean Default: false If set, will not attempt to validate the configured OpenID Connect providers are reachable.
- |
Request Body schema: application/jsonThe configuration to use for the new database
- | server | string This is the Couchbase Server address or addresses that the database connect to.
- | | pool | string Deprecated Default: "default" This field is unsupported and ignored.
- | | bucket | string Default: "The database name" The Couchbase Server backing bucket for the database.
- | | username | string The username for authenticating to the server.
- | | password | string The password for authenticating to the server.
- | | certpath | string The cert path (public key) for X.509 bucket auth.
- | | keypath | string The key path (private key) for X.509 bucket auth
- | | cacertpath | string The root CA cert path for X.509 bucket authentication.
- | | kv_tls_port | integer Default: 11207 The Memcached TLS port.
- | | max_concurrent_query_ops | integer Default: 1000 The maximum amount of query operations that can be running at any one point.
- | | object <= 1 properties An object keyed by scope name containing config for the specific collection.
- | | name | string The name of the database.
- | | sync | string Default: "function(doc){channel(doc.channels);}" path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
query Parameters| disable_oidc_validation | boolean Default: false If set, will not attempt to validate the configured OpenID Connect providers are reachable.
+ |
Request Body schema: application/jsonThe configuration to use for the new database
+ | server | string This is the Couchbase Server address or addresses that the database connect to.
+ | | pool | string Deprecated Default: "default" This field is unsupported and ignored.
+ | | bucket | string Default: "The database name" The Couchbase Server backing bucket for the database.
+ | | username | string The username for authenticating to the server.
+ | | password | string The password for authenticating to the server.
+ | | certpath | string The cert path (public key) for X.509 bucket auth.
+ | | keypath | string The key path (private key) for X.509 bucket auth
+ | | cacertpath | string The root CA cert path for X.509 bucket authentication.
+ | | kv_tls_port | integer Default: 11207 The Memcached TLS port.
+ | | max_concurrent_query_ops | integer Default: 1000 The maximum amount of query operations that can be running at any one point.
+ | | object <= 1 properties An object keyed by scope name containing config for the specific collection.
+ | | name | string The name of the database.
+ | | sync | string Default: "function(doc){channel(doc.channels);}" The Javascript function that newly created documents are ran through for the default scope and collection.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The Javascript function that newly created documents are ran through for the default scope and collection.
If scopes parameter is set, this is ignored.
- | | | | | | revs_limit | number >= 0 Default: "100 if conflict allowed and 50 if not" | | | | revs_limit | number >= 0 Default: "100 if conflict allowed and 50 if not" The maximum depth a document's revision tree can grow too.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The maximum depth a document's revision tree can grow too.
The minimum is 20 if conflicts are allowed and 0 if not. It is not recommended to go below 100 when conflicts are allowed.
- | | import_docs | boolean | import_docs | boolean If true, documents will be imported in to Sync Gateway from the bucket when requested. Documents will be ran through the set import_filter if any is set.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> If true, documents will be imported in to Sync Gateway from the bucket when requested. Documents will be ran through the set import_filter if any is set.
The default value depends on the edition of Sync Gateway being used. If the edition is the Community Edition, then this will default to false or else in the Enterprise Edition, it will default to true.
This can also be set to the string continuous which maps to true.
- | | | import_partitions | number Default: 16 | import_partitions | number Default: 16 ** This is an Enterprise Edition feature only**
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> ** This is an Enterprise Edition feature only**
This is how many import partitions should be used for import sharding.
Partitions are distributed among all Sync Gateway nodes participating in import processing (import_docs=true), and each process a subset of the server's vbuckets.
Each partition is processed by an independent function that runs simultaneously to others, so import_partitions can be used to tune concurrency based on the number of Sync Gateway nodes, and the number of cores per node.
- | | | import_filter | string | import_filter | string This is the function that all imported documents in the default scope and collection are ran through in order to filter out what to import and what not to import. This allows you to control what is made available to Couchbase Mobile clients. If it is not set, then no documents are filtered when imported.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> This is the function that all imported documents in the default scope and collection are ran through in order to filter out what to import and what not to import. This allows you to control what is made available to Couchbase Mobile clients. If it is not set, then no documents are filtered when imported.
import_docs must be true to make this field applicable.
If scopes parameter is set, this is ignored.
- | | | import_backup_old_rev | boolean Default: false This controls whether import should attempt to create a temporary backup of the previous revision body (if available) when the document is modified in the bucket.
- | | object These are the settings for webhooks.
- | | feed_type | string Deprecated Default: "DCP" Value: "DCP" The type of feed to use to communicate with Couchbase Server. This will use DCP regardless of specification.
- | | allow_empty_password | boolean Default: false This controls whether users that are created can have an empty password or not.
- | | | | rev_cache_size | number Deprecated | import_backup_old_rev | boolean Default: false This controls whether import should attempt to create a temporary backup of the previous revision body (if available) when the document is modified in the bucket.
+ | | | object These are the settings for webhooks.
+ | | feed_type | string Deprecated Default: "DCP" Value: "DCP" The type of feed to use to communicate with Couchbase Server. This will use DCP regardless of specification.
+ | | allow_empty_password | boolean Default: false This controls whether users that are created can have an empty password or not.
+ | | | | rev_cache_size | number Deprecated Deprecated, please use the database setting cache.rev_cache.size instead
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Deprecated, please use the database setting cache.rev_cache.size instead
The maximum number of revisions to store in the revision cache.
- | | offline | boolean Default: false Start the database in an offline state.
- | | object These are unsupported options and therefore it is not recommended to use them.
- | | object Configuration for Local JWT authentication.
- | | object Configuration for OpenID Connect authentication.
- | | old_rev_expiry_seconds | number Default: 300 The number of seconds before old revisions are removed from the Couchbase Server bucket.
- | | view_query_timeout_secs | integer Default: 75 The number of seconds before a view query should timeout.
- | | local_doc_expiry_secs | integer Default: 7776000 The number of seconds before a _local document should expire.
- | | enable_shared_bucket_access | boolean Default: true Whether to use extended attributes to store Sync Gateway document (_sync) metadata.
- | | session_cookie_secure | boolean | offline | boolean Default: false Start the database in an offline state.
+ | | | object These are unsupported options and therefore it is not recommended to use them.
+ | | object Configuration for Local JWT authentication.
+ | | object Configuration for OpenID Connect authentication.
+ | | old_rev_expiry_seconds | number Default: 300 The number of seconds before old revisions are removed from the Couchbase Server bucket.
+ | | view_query_timeout_secs | integer Default: 75 The number of seconds before a view query should timeout.
+ | | local_doc_expiry_secs | integer Default: 7776000 The number of seconds before a _local document should expire.
+ | | enable_shared_bucket_access | boolean Default: true Whether to use extended attributes to store Sync Gateway document (_sync) metadata.
+ | | session_cookie_secure | boolean Override the session cookie secure flag. If set, the cookie will have the secure flag.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Override the session cookie secure flag. If set, the cookie will have the secure flag.
This will default to true if startup config api.https.tls_cert_path is set otherwise it will default to false.
- | | session_cookie_name | string This can be used to define a custom per-database session cookie name.
- | | session_cookie_http_only | boolean Default: false Make all session cookies for the database set the HttpOnly flag so they are inaccessible to JavaScript.
- | | allow_conflicts | boolean Deprecated Default: true This controls whether to allow conflicting document revisions.
- | | num_index_replicas | number Default: 1 This is the number of Global Secondary Indexes (GSI) to use for core indexes.
- | | use_views | boolean Default: false Force the use of views instead of GSI.
- | | send_www_authenticate_header | boolean Default: true Controls whether to send a WWW-Authenticate header in 401 Unauthorized HTTP responses.
- | | disable_password_auth | boolean Default: false Whether to disable username/password authentication and only allow OIDC and guest access.
- | | bucket_op_timeout_ms | number This is the amount of milliseconds should pass before a bucket operation times out. An error will be returned if the bucket operation times out saying: operation timed out.
- | | slow_query_warning_threshold | number Default: 500 The amount of milliseconds a N1QL query should run before logging a warning.
- | | object | session_cookie_name | string This can be used to define a custom per-database session cookie name.
+ | | | session_cookie_http_only | boolean Default: false Make all session cookies for the database set the HttpOnly flag so they are inaccessible to JavaScript.
+ | | allow_conflicts | boolean Deprecated Default: true This controls whether to allow conflicting document revisions.
+ | | num_index_replicas | number Default: 1 This is the number of Global Secondary Indexes (GSI) to use for core indexes.
+ | | use_views | boolean Default: false Force the use of views instead of GSI.
+ | | send_www_authenticate_header | boolean Default: true Controls whether to send a WWW-Authenticate header in 401 Unauthorized HTTP responses.
+ | | disable_password_auth | boolean Default: false Whether to disable username/password authentication and only allow OIDC and guest access.
+ | | bucket_op_timeout_ms | number This is the amount of milliseconds should pass before a bucket operation times out. An error will be returned if the bucket operation times out saying: operation timed out.
+ | | slow_query_warning_threshold | number Default: 500 The amount of milliseconds a N1QL query should run before logging a warning.
+ | | object Delta sync configuration settings.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Delta sync configuration settings.
This is an Enterprise Edition feature only
- | | compact_interval_days | number Default: 1 | compact_interval_days | number Default: 1 The interval between scheduled tombstone compaction runs (in days). This can be a floating point number.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The interval between scheduled tombstone compaction runs (in days). This can be a floating point number.
If set to 0, compaction will not run automatically.
- | | | sgreplicate_enabled | boolean Default: true Whether the node should accept assign replications (true) or not (false).
- | | sgreplicate_websocket_heartbeat_secs | integer Default: 300 Use a custom heartbeat interval (in seconds) for websocket ping frames.
- | | | | serve_insecure_attachment_types | boolean Default: false | sgreplicate_enabled | boolean Default: true Whether the node should accept assign replications (true) or not (false).
+ | | | sgreplicate_websocket_heartbeat_secs | integer Default: 300 Use a custom heartbeat interval (in seconds) for websocket ping frames.
+ | | | | serve_insecure_attachment_types | boolean Default: false If set, always serve attachments with the Content-Type header set to the type of the attachment.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> If set, always serve attachments with the Content-Type header set to the type of the attachment.
When serving an attachment, usually the Content-Type header is set to the type of the attachment but the Content-Disposition response header will be set instead if the content type is vulnerable to a phishing attack, causing the browser to download the file instead of display it. This option will override that behaviour and always set the Content-Type header.
- | | query_pagination_limit | integer Default: 5000 The query limit to be used during pagination of large queries.
- | | user_xattr_key | string The key to use for the user xattr that will be accessible from the sync function. IF empty, the feature will be disabled.
- | | client_partition_window_secs | integer Default: 2592000 | query_pagination_limit | integer Default: 5000 The query limit to be used during pagination of large queries.
+ | | | user_xattr_key | string The key to use for the user xattr that will be accessible from the sync function. IF empty, the feature will be disabled.
+ | | client_partition_window_secs | integer Default: 2592000 How long (in seconds) clients can remain offline for without losing replication metadata.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> How long (in seconds) clients can remain offline for without losing replication metadata.
Defaults to 30 days (in seconds)
- | | object (User) Properties associated with a user
- | | javascript_timeout_secs | number Default: 60 The maximum number of seconds the sync, import filter, and custom conflict resolver JavaScript functions are allowed to run for before timing out. Set to 0 to allow the JS functions to run uncapped.
- | | suspendable | boolean Default: false | object (User) Properties associated with a user
+ | | | javascript_timeout_secs | number Default: 60 The maximum number of seconds the sync, import filter, and custom conflict resolver JavaScript functions are allowed to run for before timing out. Set to 0 to allow the JS functions to run uncapped.
+ | | suspendable | boolean Default: false Set to true to allow the database to be suspended.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Set to true to allow the database to be suspended.
Defaults to true when running in serverless mode otherwise defaults to false.
- | | object CORS configuration for this database; if present, overrides server's config.
- | | object Per-database logging configuration.
- |
Responses{protocol}://{hostname}:4985/{db}/ Request samples Content typeapplication/json {"server": "string", "pool": "default", "bucket": "The database name", "username": "string", "password": "string", "certpath": "string", "keypath": "string", "cacertpath": "string", "kv_tls_port": 11207, "max_concurrent_query_ops": 1000, "scopes": {"scopename": {"collections": {"collectionname1": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" }, "collectionname2": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" } } } }, "name": "string", "sync": "function(doc){channel(doc.channels);}", "users": {"username1": {"name": "string", "password": "string", "email": "string", "disabled": true, }, "username2": {"name": "string", "password": "string", "email": "string", "disabled": true, } }, "revs_limit": "100 if conflict allowed and 50 if not", "import_docs": true, "import_partitions": 16, "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }", "import_backup_old_rev": false, "event_handlers": {"max_processes": "string", "wait_for_process": "string", "document_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } }, "db_state_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } } }, "feed_type": "DCP", "allow_empty_password": false, "cache": {"channel_cache": {"max_number": 50000, "compact_high_watermark_pct": 80, "compact_low_watermark_pct": 60, "max_wait_pending": 5000, "max_num_pending": 10000, "max_wait_skipped": 3600000, "enable_star_channel": true, "max_length": 500, "min_length": 50, "expiry_seconds": 60, "query_limit": 5000 }, "max_wait_pending": 0, "max_wait_skipped": 0, "enable_star_channel": true, "channel_cache_max_length": 0, "channel_cache_min_length": 0, "channel_cache_expiry": 0, "max_num_pending": 0 }, "rev_cache_size": 0, "offline": false, "unsupported": {"oidc_test_provider": {}, "warning_thresholds": {}, "oidc_tls_skip_verify": true, "sgr_tls_skip_verify": true, "remote_config_tls_skip_verify": true, "guest_read_only": true, "force_api_forbidden_errors": true, "dcp_read_buffer": 0, "kv_buffer": 0 }, "old_rev_expiry_seconds": 300, "view_query_timeout_secs": 75, "local_doc_expiry_secs": 7776000, "enable_shared_bucket_access": true, "session_cookie_secure": true, "session_cookie_name": "string", "session_cookie_http_only": false, "allow_conflicts": true, "num_index_replicas": 1, "use_views": false, "send_www_authenticate_header": true, "disable_password_auth": false, "bucket_op_timeout_ms": 0, "slow_query_warning_threshold": 500, "compact_interval_days": 1, "sgreplicate_enabled": true, "sgreplicate_websocket_heartbeat_secs": 300, "replications": {"replication_id": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ] } }, "serve_insecure_attachment_types": false, "query_pagination_limit": 5000, "user_xattr_key": "string", "client_partition_window_secs": 2592000, "guest": {"name": "string", "password": "string", "email": "string", "disabled": true, }, "javascript_timeout_secs": 60, "suspendable": false, "logging": {"audit": {"enabled": false, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] } } } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Get changes list | object CORS configuration for this database; if present, overrides server's config.
+ | | | object Per-database logging configuration.
+ |
Responses{protocol}://{hostname}:4985/{db}/ Request samples Content typeapplication/json {"server": "string", "pool": "default", "bucket": "The database name", "username": "string", "password": "string", "certpath": "string", "keypath": "string", "cacertpath": "string", "kv_tls_port": 11207, "max_concurrent_query_ops": 1000, "scopes": {"scopename": {"collections": {"collectionname1": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" }, "collectionname2": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" } } } }, "name": "string", "sync": "function(doc){channel(doc.channels);}", "users": {"username1": {"name": "string", "password": "string", "email": "string", "disabled": true, }, "username2": {"name": "string", "password": "string", "email": "string", "disabled": true, } }, "revs_limit": "100 if conflict allowed and 50 if not", "import_docs": true, "import_partitions": 16, "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }", "import_backup_old_rev": false, "event_handlers": {"max_processes": "string", "wait_for_process": "string", "document_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } }, "db_state_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } } }, "feed_type": "DCP", "allow_empty_password": false, "cache": {"channel_cache": {"max_number": 50000, "compact_high_watermark_pct": 80, "compact_low_watermark_pct": 60, "max_wait_pending": 5000, "max_num_pending": 10000, "max_wait_skipped": 3600000, "enable_star_channel": true, "max_length": 500, "min_length": 50, "expiry_seconds": 60, "query_limit": 5000 }, "max_wait_pending": 0, "max_wait_skipped": 0, "enable_star_channel": true, "channel_cache_max_length": 0, "channel_cache_min_length": 0, "channel_cache_expiry": 0, "max_num_pending": 0 }, "rev_cache_size": 0, "offline": false, "unsupported": {"oidc_test_provider": {}, "warning_thresholds": {}, "oidc_tls_skip_verify": true, "sgr_tls_skip_verify": true, "remote_config_tls_skip_verify": true, "guest_read_only": true, "force_api_forbidden_errors": true, "dcp_read_buffer": 0, "kv_buffer": 0 }, "old_rev_expiry_seconds": 300, "view_query_timeout_secs": 75, "local_doc_expiry_secs": 7776000, "enable_shared_bucket_access": true, "session_cookie_secure": true, "session_cookie_name": "string", "session_cookie_http_only": false, "allow_conflicts": true, "num_index_replicas": 1, "use_views": false, "send_www_authenticate_header": true, "disable_password_auth": false, "bucket_op_timeout_ms": 0, "slow_query_warning_threshold": 500, "compact_interval_days": 1, "sgreplicate_enabled": true, "sgreplicate_websocket_heartbeat_secs": 300, "replications": {"replication_id": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ] } }, "serve_insecure_attachment_types": false, "query_pagination_limit": 5000, "user_xattr_key": "string", "client_partition_window_secs": 2592000, "guest": {"name": "string", "password": "string", "email": "string", "disabled": true, }, "javascript_timeout_secs": 60, "suspendable": false, "logging": {"audit": {"enabled": false, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] } } } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Get changes list 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 has been changed.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> 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 has been changed.
This 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.
Required Sync Gateway RBAC roles:
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
query Parameters| limit | integer Maximum number of changes to return.
- | | since | string 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.
- | | style | string Default: "main_only" Enum: "main_only" "all_docs" Controls whether to return the current winning revision (main_only) or all the leaf revision including conflicts and deleted former conflicts (all_docs).
- | | active_only | boolean Default: "false" Set true to exclude deleted documents and notifications for documents the user no longer has access to from the changes feed.
- | | include_docs | boolean Include the body associated with each document.
- | | revocations | boolean If true, revocation messages will be sent on the changes feed.
- | | filter | string Enum: "sync_gateway/bychannel" "_doc_ids" Set a filter to either filter by channels or document IDs.
- | | channels | string A comma-separated list of channel names to filter the response to only the channels specified. To use this option, the filter query option must be set to sync_gateway/bychannels.
- | | doc_ids | Array of strings A valid JSON array of document IDs to filter the documents in the response to only the documents specified. To use this option, the filter query option must be set to _doc_ids and the feed parameter must be normal. Also accepts a comma separated list of document IDs instead.
- | | heartbeat | integer >= 25000 Default: 0 The interval (in milliseconds) to send an empty line (CRLF) in the response. This is to help prevent gateways from deciding the socket is idle and therefore closing it. This is only applicable to feed=longpoll or feed=continuous. This will override any timeouts to keep the feed alive indefinitely. Setting to 0 results in no heartbeat. The maximum heartbeat can be set in the server replication configuration.
- | | timeout | integer [ 0 .. 900000 ] Default: 300000 This is the maximum period (in milliseconds) to wait for a change before the response is sent, even if there are no results. This is only applicable for feed=longpoll or feed=continuous changes feeds. Setting to 0 results in no timeout.
- | | feed | string Default: "normal" Enum: "normal" "longpoll" "continuous" "websocket" The type of changes feed to use.
- | | request_plus | boolean Default: "false" When true, ensures all valid documents written prior to the request being issued are included in the response. This is only applicable for non-continuous feeds.
- |
Responses{protocol}://{hostname}:4985/{keyspace}/_changes Response samples Content typeapplication/json Get changes list query Parameters | limit | integer Maximum number of changes to return.
+ | | since | string 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.
+ | | style | string Default: "main_only" Enum: "main_only" "all_docs" Controls whether to return the current winning revision (main_only) or all the leaf revision including conflicts and deleted former conflicts (all_docs).
+ | | active_only | boolean Default: "false" Set true to exclude deleted documents and notifications for documents the user no longer has access to from the changes feed.
+ | | include_docs | boolean Include the body associated with each document.
+ | | revocations | boolean If true, revocation messages will be sent on the changes feed.
+ | | filter | string Enum: "sync_gateway/bychannel" "_doc_ids" Set a filter to either filter by channels or document IDs.
+ | | channels | string A comma-separated list of channel names to filter the response to only the channels specified. To use this option, the filter query option must be set to sync_gateway/bychannels.
+ | | doc_ids | Array of strings A valid JSON array of document IDs to filter the documents in the response to only the documents specified. To use this option, the filter query option must be set to _doc_ids and the feed parameter must be normal. Also accepts a comma separated list of document IDs instead.
+ | | heartbeat | integer >= 25000 Default: 0 The interval (in milliseconds) to send an empty line (CRLF) in the response. This is to help prevent gateways from deciding the socket is idle and therefore closing it. This is only applicable to feed=longpoll or feed=continuous. This will override any timeouts to keep the feed alive indefinitely. Setting to 0 results in no heartbeat. The maximum heartbeat can be set in the server replication configuration.
+ | | timeout | integer [ 0 .. 900000 ] Default: 300000 This is the maximum period (in milliseconds) to wait for a change before the response is sent, even if there are no results. This is only applicable for feed=longpoll or feed=continuous changes feeds. Setting to 0 results in no timeout.
+ | | feed | string Default: "normal" Enum: "normal" "longpoll" "continuous" "websocket" The type of changes feed to use.
+ | | request_plus | boolean Default: "false" When true, ensures all valid documents written prior to the request being issued are included in the response. This is only applicable for non-continuous feeds.
+ |
Responses{protocol}://{hostname}:4985/{keyspace}/_changes Response samples Content typeapplication/json Get changes list 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 has been changed.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> 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 has been changed.
This 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.
Required Sync Gateway RBAC roles:
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
Request Body schema: application/json| limit | string Maximum number of changes to return.
- | | style | string Controls whether to return the current winning revision (main_only) or all the leaf revision including conflicts and deleted former conflicts (all_docs).
- | | active_only | string Set true to exclude deleted documents and notifications for documents the user no longer has access to from the changes feed.
- | | include_docs | string Include the body associated with each document.
- | | revocations | string If true, revocation messages will be sent on the changes feed.
- | | filter | string Set a filter to either filter by channels or document IDs.
- | | channels | string A comma-separated list of channel names to filter the response to only the channels specified. To use this option, the filter query option must be set to sync_gateway/bychannels.
- | | doc_ids | string A valid JSON array of document IDs to filter the documents in the response to only the documents specified. To use this option, the filter query option must be set to _doc_ids and the feed parameter must be normal.
- | | heartbeat | string The interval (in milliseconds) to send an empty line (CRLF) in the response. This is to help prevent gateways from deciding the socket is idle and therefore closing it. This is only applicable to feed=longpoll or feed=continuous. This will override any timeouts to keep the feed alive indefinitely. Setting to 0 results in no heartbeat. The maximum heartbeat can be set in the server replication configuration.
- | | timeout | string This is the maximum period (in milliseconds) to wait for a change before the response is sent, even if there are no results. This is only applicable for feed=longpoll or feed=continuous changes feeds. Setting to 0 results in no timeout.
- | | feed | string The type of changes feed to use.
- | | request_plus | string When true, ensures all valid documents written prior to the request being issued are included in the response. This is only applicable for non-continuous feeds.
- |
Responses{protocol}://{hostname}:4985/{keyspace}/_changes Request samples Content typeapplication/json Response samples Content typeapplication/json /{db}/_changes Request Body schema: application/json| limit | string Maximum number of changes to return.
+ | | style | string Controls whether to return the current winning revision (main_only) or all the leaf revision including conflicts and deleted former conflicts (all_docs).
+ | | active_only | string Set true to exclude deleted documents and notifications for documents the user no longer has access to from the changes feed.
+ | | include_docs | string Include the body associated with each document.
+ | | revocations | string If true, revocation messages will be sent on the changes feed.
+ | | filter | string Set a filter to either filter by channels or document IDs.
+ | | channels | string A comma-separated list of channel names to filter the response to only the channels specified. To use this option, the filter query option must be set to sync_gateway/bychannels.
+ | | doc_ids | string A valid JSON array of document IDs to filter the documents in the response to only the documents specified. To use this option, the filter query option must be set to _doc_ids and the feed parameter must be normal.
+ | | heartbeat | string The interval (in milliseconds) to send an empty line (CRLF) in the response. This is to help prevent gateways from deciding the socket is idle and therefore closing it. This is only applicable to feed=longpoll or feed=continuous. This will override any timeouts to keep the feed alive indefinitely. Setting to 0 results in no heartbeat. The maximum heartbeat can be set in the server replication configuration.
+ | | timeout | string This is the maximum period (in milliseconds) to wait for a change before the response is sent, even if there are no results. This is only applicable for feed=longpoll or feed=continuous changes feeds. Setting to 0 results in no timeout.
+ | | feed | string The type of changes feed to use.
+ | | request_plus | string When true, ensures all valid documents written prior to the request being issued are included in the response. This is only applicable for non-continuous feeds.
+ |
Responses{protocol}://{hostname}:4985/{keyspace}/_changes Request samples Content typeapplication/json Response samples Content typeapplication/json /{db}/_changes Required Sync Gateway RBAC roles:
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Required Sync Gateway RBAC roles:
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
{protocol}://{hostname}:4985/{keyspace}/_changes /{db}/_ensure_full_commit {protocol}://{hostname}:4985/{keyspace}/_changes /{db}/_ensure_full_commit This endpoint is non-functional but is present for CouchDB compatibility.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This endpoint is non-functional but is present for CouchDB compatibility.
Required Sync Gateway RBAC roles:
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
{protocol}://{hostname}:4985/{db}/_ensure_full_commit Response samples Content typeapplication/json Compare revisions to what is in the database path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
{protocol}://{hostname}:4985/{db}/_ensure_full_commit Response samples Content typeapplication/json Compare revisions to what is in the database Takes a set of document IDs, each with a set of revision IDs. For each document, an array of unknown revisions are returned with an array of known revisions that may be recent ancestors.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Takes a set of document IDs, each with a set of revision IDs. For each document, an array of unknown revisions are returned with an array of known revisions that may be recent ancestors.
Required Sync Gateway RBAC roles:
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
Request Body schema: application/json| docid | Array of strings The document ID with an array of revisions to use for the comparison.
- |
Responses{protocol}://{hostname}:4985/{keyspace}/_revs_diff Request samples Content typeapplication/json Response samples Content typeapplication/json Request Body schema: application/json| docid | Array of strings The document ID with an array of revisions to use for the comparison.
+ |
Responses{protocol}://{hostname}:4985/{keyspace}/_revs_diff Request samples Content typeapplication/json Response samples Content typeapplication/json Configure Sync Gateway databases
- Get database configuration Get database configuration Retrieve the full configuration for the database specified.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Retrieve the full configuration for the database specified.
Required Sync Gateway RBAC roles:
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
query Parameters| redact | boolean Deprecated Default: "true" No longer supported field.
- | | include_javascript | boolean Default: true Include the fields that have Javascript functions in the response. E.g. sync function, import filter, and event handlers.
- | | include_runtime | boolean Default: false Whether to include the values set at runtime, and default values.
- | | refresh_config | boolean Default: false Forces the configuration to be reloaded on the Sync Gateway node.
- |
Responses{protocol}://{hostname}:4985/{db}/_config Response samples Content typeapplication/json {"server": "string", "pool": "default", "bucket": "The database name", "username": "string", "password": "string", "certpath": "string", "keypath": "string", "cacertpath": "string", "kv_tls_port": 11207, "max_concurrent_query_ops": 1000, "scopes": {"scopename": {"collections": {"collectionname1": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" }, "collectionname2": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" } } } }, "name": "string", "sync": "function(doc){channel(doc.channels);}", "revs_limit": "100 if conflict allowed and 50 if not", "import_docs": true, "import_partitions": 16, "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }", "import_backup_old_rev": false, "event_handlers": {"max_processes": "string", "wait_for_process": "string", "document_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } }, "db_state_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } } }, "feed_type": "DCP", "allow_empty_password": false, "cache": {"channel_cache": {"max_number": 50000, "compact_high_watermark_pct": 80, "compact_low_watermark_pct": 60, "max_wait_pending": 5000, "max_num_pending": 10000, "max_wait_skipped": 3600000, "enable_star_channel": true, "max_length": 500, "min_length": 50, "expiry_seconds": 60, "query_limit": 5000 }, "max_wait_pending": 0, "max_wait_skipped": 0, "enable_star_channel": true, "channel_cache_max_length": 0, "channel_cache_min_length": 0, "channel_cache_expiry": 0, "max_num_pending": 0 }, "rev_cache_size": 0, "offline": false, "unsupported": {"oidc_test_provider": {}, "warning_thresholds": {}, "oidc_tls_skip_verify": true, "sgr_tls_skip_verify": true, "remote_config_tls_skip_verify": true, "guest_read_only": true, "force_api_forbidden_errors": true, "dcp_read_buffer": 0, "kv_buffer": 0 }, "old_rev_expiry_seconds": 300, "view_query_timeout_secs": 75, "local_doc_expiry_secs": 7776000, "enable_shared_bucket_access": true, "session_cookie_secure": true, "session_cookie_name": "string", "session_cookie_http_only": false, "allow_conflicts": true, "num_index_replicas": 1, "use_views": false, "send_www_authenticate_header": true, "disable_password_auth": false, "bucket_op_timeout_ms": 0, "slow_query_warning_threshold": 500, "compact_interval_days": 1, "sgreplicate_enabled": true, "sgreplicate_websocket_heartbeat_secs": 300, "replications": {"replication_id": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ] } }, "serve_insecure_attachment_types": false, "query_pagination_limit": 5000, "user_xattr_key": "string", "client_partition_window_secs": 2592000, "javascript_timeout_secs": 60, "suspendable": false, "logging": {"audit": {"enabled": false, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] } } }Replace database configuration path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
query Parameters| redact | boolean Deprecated Default: "true" No longer supported field.
+ | | include_javascript | boolean Default: true Include the fields that have Javascript functions in the response. E.g. sync function, import filter, and event handlers.
+ | | include_runtime | boolean Default: false Whether to include the values set at runtime, and default values.
+ | | refresh_config | boolean Default: false Forces the configuration to be reloaded on the Sync Gateway node.
+ |
Responses{protocol}://{hostname}:4985/{db}/_config Response samples Content typeapplication/json {"server": "string", "pool": "default", "bucket": "The database name", "username": "string", "password": "string", "certpath": "string", "keypath": "string", "cacertpath": "string", "kv_tls_port": 11207, "max_concurrent_query_ops": 1000, "scopes": {"scopename": {"collections": {"collectionname1": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" }, "collectionname2": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" } } } }, "name": "string", "sync": "function(doc){channel(doc.channels);}", "revs_limit": "100 if conflict allowed and 50 if not", "import_docs": true, "import_partitions": 16, "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }", "import_backup_old_rev": false, "event_handlers": {"max_processes": "string", "wait_for_process": "string", "document_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } }, "db_state_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } } }, "feed_type": "DCP", "allow_empty_password": false, "cache": {"channel_cache": {"max_number": 50000, "compact_high_watermark_pct": 80, "compact_low_watermark_pct": 60, "max_wait_pending": 5000, "max_num_pending": 10000, "max_wait_skipped": 3600000, "enable_star_channel": true, "max_length": 500, "min_length": 50, "expiry_seconds": 60, "query_limit": 5000 }, "max_wait_pending": 0, "max_wait_skipped": 0, "enable_star_channel": true, "channel_cache_max_length": 0, "channel_cache_min_length": 0, "channel_cache_expiry": 0, "max_num_pending": 0 }, "rev_cache_size": 0, "offline": false, "unsupported": {"oidc_test_provider": {}, "warning_thresholds": {}, "oidc_tls_skip_verify": true, "sgr_tls_skip_verify": true, "remote_config_tls_skip_verify": true, "guest_read_only": true, "force_api_forbidden_errors": true, "dcp_read_buffer": 0, "kv_buffer": 0 }, "old_rev_expiry_seconds": 300, "view_query_timeout_secs": 75, "local_doc_expiry_secs": 7776000, "enable_shared_bucket_access": true, "session_cookie_secure": true, "session_cookie_name": "string", "session_cookie_http_only": false, "allow_conflicts": true, "num_index_replicas": 1, "use_views": false, "send_www_authenticate_header": true, "disable_password_auth": false, "bucket_op_timeout_ms": 0, "slow_query_warning_threshold": 500, "compact_interval_days": 1, "sgreplicate_enabled": true, "sgreplicate_websocket_heartbeat_secs": 300, "replications": {"replication_id": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ] } }, "serve_insecure_attachment_types": false, "query_pagination_limit": 5000, "user_xattr_key": "string", "client_partition_window_secs": 2592000, "javascript_timeout_secs": 60, "suspendable": false, "logging": {"audit": {"enabled": false, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] } } }Replace database configuration Replaces the database configuration with the one sent in the request.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Replaces the database configuration with the one sent in the request.
The bucket and database name cannot be changed. If these need to be changed, the database will need to be deleted then recreated with the new settings.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
query Parameters| disable_oidc_validation | boolean Default: false If set, will not attempt to validate the configured OpenID Connect providers are reachable.
- |
header Parameters| If-Match | string If set to a configuration's Etag value, enables optimistic concurrency control for the request. Returns HTTP 412 if another update happened underneath this one.
- |
Request Body schema: application/jsonThe new database configuration to use
- | server | string This is the Couchbase Server address or addresses that the database connect to.
- | | pool | string Deprecated Default: "default" This field is unsupported and ignored.
- | | bucket | string Default: "The database name" The Couchbase Server backing bucket for the database.
- | | username | string The username for authenticating to the server.
- | | password | string The password for authenticating to the server.
- | | certpath | string The cert path (public key) for X.509 bucket auth.
- | | keypath | string The key path (private key) for X.509 bucket auth
- | | cacertpath | string The root CA cert path for X.509 bucket authentication.
- | | kv_tls_port | integer Default: 11207 The Memcached TLS port.
- | | max_concurrent_query_ops | integer Default: 1000 The maximum amount of query operations that can be running at any one point.
- | | object <= 1 properties An object keyed by scope name containing config for the specific collection.
- | | name | string The name of the database.
- | | sync | string Default: "function(doc){channel(doc.channels);}" path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
query Parameters| disable_oidc_validation | boolean Default: false If set, will not attempt to validate the configured OpenID Connect providers are reachable.
+ |
header Parameters| If-Match | string If set to a configuration's Etag value, enables optimistic concurrency control for the request. Returns HTTP 412 if another update happened underneath this one.
+ |
Request Body schema: application/jsonThe new database configuration to use
+ | server | string This is the Couchbase Server address or addresses that the database connect to.
+ | | pool | string Deprecated Default: "default" This field is unsupported and ignored.
+ | | bucket | string Default: "The database name" The Couchbase Server backing bucket for the database.
+ | | username | string The username for authenticating to the server.
+ | | password | string The password for authenticating to the server.
+ | | certpath | string The cert path (public key) for X.509 bucket auth.
+ | | keypath | string The key path (private key) for X.509 bucket auth
+ | | cacertpath | string The root CA cert path for X.509 bucket authentication.
+ | | kv_tls_port | integer Default: 11207 The Memcached TLS port.
+ | | max_concurrent_query_ops | integer Default: 1000 The maximum amount of query operations that can be running at any one point.
+ | | object <= 1 properties An object keyed by scope name containing config for the specific collection.
+ | | name | string The name of the database.
+ | | sync | string Default: "function(doc){channel(doc.channels);}" The Javascript function that newly created documents are ran through for the default scope and collection.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The Javascript function that newly created documents are ran through for the default scope and collection.
If scopes parameter is set, this is ignored.
- | | | | | | revs_limit | number >= 0 Default: "100 if conflict allowed and 50 if not" | | | | revs_limit | number >= 0 Default: "100 if conflict allowed and 50 if not" The maximum depth a document's revision tree can grow too.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The maximum depth a document's revision tree can grow too.
The minimum is 20 if conflicts are allowed and 0 if not. It is not recommended to go below 100 when conflicts are allowed.
- | | import_docs | boolean | import_docs | boolean If true, documents will be imported in to Sync Gateway from the bucket when requested. Documents will be ran through the set import_filter if any is set.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> If true, documents will be imported in to Sync Gateway from the bucket when requested. Documents will be ran through the set import_filter if any is set.
The default value depends on the edition of Sync Gateway being used. If the edition is the Community Edition, then this will default to false or else in the Enterprise Edition, it will default to true.
This can also be set to the string continuous which maps to true.
- | | | import_partitions | number Default: 16 | import_partitions | number Default: 16 ** This is an Enterprise Edition feature only**
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> ** This is an Enterprise Edition feature only**
This is how many import partitions should be used for import sharding.
Partitions are distributed among all Sync Gateway nodes participating in import processing (import_docs=true), and each process a subset of the server's vbuckets.
Each partition is processed by an independent function that runs simultaneously to others, so import_partitions can be used to tune concurrency based on the number of Sync Gateway nodes, and the number of cores per node.
- | | | import_filter | string | import_filter | string This is the function that all imported documents in the default scope and collection are ran through in order to filter out what to import and what not to import. This allows you to control what is made available to Couchbase Mobile clients. If it is not set, then no documents are filtered when imported.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> This is the function that all imported documents in the default scope and collection are ran through in order to filter out what to import and what not to import. This allows you to control what is made available to Couchbase Mobile clients. If it is not set, then no documents are filtered when imported.
import_docs must be true to make this field applicable.
If scopes parameter is set, this is ignored.
- | | | import_backup_old_rev | boolean Default: false This controls whether import should attempt to create a temporary backup of the previous revision body (if available) when the document is modified in the bucket.
- | | object These are the settings for webhooks.
- | | feed_type | string Deprecated Default: "DCP" Value: "DCP" The type of feed to use to communicate with Couchbase Server. This will use DCP regardless of specification.
- | | allow_empty_password | boolean Default: false This controls whether users that are created can have an empty password or not.
- | | | | rev_cache_size | number Deprecated | import_backup_old_rev | boolean Default: false This controls whether import should attempt to create a temporary backup of the previous revision body (if available) when the document is modified in the bucket.
+ | | | object These are the settings for webhooks.
+ | | feed_type | string Deprecated Default: "DCP" Value: "DCP" The type of feed to use to communicate with Couchbase Server. This will use DCP regardless of specification.
+ | | allow_empty_password | boolean Default: false This controls whether users that are created can have an empty password or not.
+ | | | | rev_cache_size | number Deprecated Deprecated, please use the database setting cache.rev_cache.size instead
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Deprecated, please use the database setting cache.rev_cache.size instead
The maximum number of revisions to store in the revision cache.
- | | offline | boolean Default: false Start the database in an offline state.
- | | object These are unsupported options and therefore it is not recommended to use them.
- | | object Configuration for Local JWT authentication.
- | | object Configuration for OpenID Connect authentication.
- | | old_rev_expiry_seconds | number Default: 300 The number of seconds before old revisions are removed from the Couchbase Server bucket.
- | | view_query_timeout_secs | integer Default: 75 The number of seconds before a view query should timeout.
- | | local_doc_expiry_secs | integer Default: 7776000 The number of seconds before a _local document should expire.
- | | enable_shared_bucket_access | boolean Default: true Whether to use extended attributes to store Sync Gateway document (_sync) metadata.
- | | session_cookie_secure | boolean | offline | boolean Default: false Start the database in an offline state.
+ | | | object These are unsupported options and therefore it is not recommended to use them.
+ | | object Configuration for Local JWT authentication.
+ | | object Configuration for OpenID Connect authentication.
+ | | old_rev_expiry_seconds | number Default: 300 The number of seconds before old revisions are removed from the Couchbase Server bucket.
+ | | view_query_timeout_secs | integer Default: 75 The number of seconds before a view query should timeout.
+ | | local_doc_expiry_secs | integer Default: 7776000 The number of seconds before a _local document should expire.
+ | | enable_shared_bucket_access | boolean Default: true Whether to use extended attributes to store Sync Gateway document (_sync) metadata.
+ | | session_cookie_secure | boolean Override the session cookie secure flag. If set, the cookie will have the secure flag.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Override the session cookie secure flag. If set, the cookie will have the secure flag.
This will default to true if startup config api.https.tls_cert_path is set otherwise it will default to false.
- | | session_cookie_name | string This can be used to define a custom per-database session cookie name.
- | | session_cookie_http_only | boolean Default: false Make all session cookies for the database set the HttpOnly flag so they are inaccessible to JavaScript.
- | | allow_conflicts | boolean Deprecated Default: true This controls whether to allow conflicting document revisions.
- | | num_index_replicas | number Default: 1 This is the number of Global Secondary Indexes (GSI) to use for core indexes.
- | | use_views | boolean Default: false Force the use of views instead of GSI.
- | | send_www_authenticate_header | boolean Default: true Controls whether to send a WWW-Authenticate header in 401 Unauthorized HTTP responses.
- | | disable_password_auth | boolean Default: false Whether to disable username/password authentication and only allow OIDC and guest access.
- | | bucket_op_timeout_ms | number This is the amount of milliseconds should pass before a bucket operation times out. An error will be returned if the bucket operation times out saying: operation timed out.
- | | slow_query_warning_threshold | number Default: 500 The amount of milliseconds a N1QL query should run before logging a warning.
- | | object | session_cookie_name | string This can be used to define a custom per-database session cookie name.
+ | | | session_cookie_http_only | boolean Default: false Make all session cookies for the database set the HttpOnly flag so they are inaccessible to JavaScript.
+ | | allow_conflicts | boolean Deprecated Default: true This controls whether to allow conflicting document revisions.
+ | | num_index_replicas | number Default: 1 This is the number of Global Secondary Indexes (GSI) to use for core indexes.
+ | | use_views | boolean Default: false Force the use of views instead of GSI.
+ | | send_www_authenticate_header | boolean Default: true Controls whether to send a WWW-Authenticate header in 401 Unauthorized HTTP responses.
+ | | disable_password_auth | boolean Default: false Whether to disable username/password authentication and only allow OIDC and guest access.
+ | | bucket_op_timeout_ms | number This is the amount of milliseconds should pass before a bucket operation times out. An error will be returned if the bucket operation times out saying: operation timed out.
+ | | slow_query_warning_threshold | number Default: 500 The amount of milliseconds a N1QL query should run before logging a warning.
+ | | object Delta sync configuration settings.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Delta sync configuration settings.
This is an Enterprise Edition feature only
- | | compact_interval_days | number Default: 1 | compact_interval_days | number Default: 1 The interval between scheduled tombstone compaction runs (in days). This can be a floating point number.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The interval between scheduled tombstone compaction runs (in days). This can be a floating point number.
If set to 0, compaction will not run automatically.
- | | | sgreplicate_enabled | boolean Default: true Whether the node should accept assign replications (true) or not (false).
- | | sgreplicate_websocket_heartbeat_secs | integer Default: 300 Use a custom heartbeat interval (in seconds) for websocket ping frames.
- | | | | serve_insecure_attachment_types | boolean Default: false | sgreplicate_enabled | boolean Default: true Whether the node should accept assign replications (true) or not (false).
+ | | | sgreplicate_websocket_heartbeat_secs | integer Default: 300 Use a custom heartbeat interval (in seconds) for websocket ping frames.
+ | | | | serve_insecure_attachment_types | boolean Default: false If set, always serve attachments with the Content-Type header set to the type of the attachment.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> If set, always serve attachments with the Content-Type header set to the type of the attachment.
When serving an attachment, usually the Content-Type header is set to the type of the attachment but the Content-Disposition response header will be set instead if the content type is vulnerable to a phishing attack, causing the browser to download the file instead of display it. This option will override that behaviour and always set the Content-Type header.
- | | query_pagination_limit | integer Default: 5000 The query limit to be used during pagination of large queries.
- | | user_xattr_key | string The key to use for the user xattr that will be accessible from the sync function. IF empty, the feature will be disabled.
- | | client_partition_window_secs | integer Default: 2592000 | query_pagination_limit | integer Default: 5000 The query limit to be used during pagination of large queries.
+ | | | user_xattr_key | string The key to use for the user xattr that will be accessible from the sync function. IF empty, the feature will be disabled.
+ | | client_partition_window_secs | integer Default: 2592000 How long (in seconds) clients can remain offline for without losing replication metadata.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> How long (in seconds) clients can remain offline for without losing replication metadata.
Defaults to 30 days (in seconds)
- | | object (User) Properties associated with a user
- | | javascript_timeout_secs | number Default: 60 The maximum number of seconds the sync, import filter, and custom conflict resolver JavaScript functions are allowed to run for before timing out. Set to 0 to allow the JS functions to run uncapped.
- | | suspendable | boolean Default: false | object (User) Properties associated with a user
+ | | | javascript_timeout_secs | number Default: 60 The maximum number of seconds the sync, import filter, and custom conflict resolver JavaScript functions are allowed to run for before timing out. Set to 0 to allow the JS functions to run uncapped.
+ | | suspendable | boolean Default: false Set to true to allow the database to be suspended.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Set to true to allow the database to be suspended.
Defaults to true when running in serverless mode otherwise defaults to false.
- | | object CORS configuration for this database; if present, overrides server's config.
- | | object Per-database logging configuration.
- |
Responses | | logging | object Per-database logging configuration.
+ |
Responses201 Database configuration successfully updated
+ 400 There was a problem with your request
+ 404 Resource could not be found
+ 412 Precondition Failed
+" class="sc-faJlkc sc-fdduAw sc-eINXvP kOqeZB ipNwOs fbuMAW"> Precondition Failed
The supplied If-Match header did not match the current version of the configuration.
Returned when optimistic concurrency control is used, and there has been an update to the configuration in between this update.
- put/{db}/_config{protocol}://{hostname}:4985/{db}/_config Request samples Content typeapplication/json Copy Expand all Collapse all {"server": "string", "pool": "default", "bucket": "The database name", "username": "string", "password": "string", "certpath": "string", "keypath": "string", "cacertpath": "string", "kv_tls_port": 11207, "max_concurrent_query_ops": 1000, "scopes": {"scopename": {"collections": {"collectionname1": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" }, "collectionname2": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" } } } }, "name": "string", "sync": "function(doc){channel(doc.channels);}", "users": {"username1": {"name": "string", "password": "string", "email": "string", "disabled": true, }, "username2": {"name": "string", "password": "string", "email": "string", "disabled": true, } }, "revs_limit": "100 if conflict allowed and 50 if not", "import_docs": true, "import_partitions": 16, "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }", "import_backup_old_rev": false, "event_handlers": {"max_processes": "string", "wait_for_process": "string", "document_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } }, "db_state_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } } }, "feed_type": "DCP", "allow_empty_password": false, "cache": {"channel_cache": {"max_number": 50000, "compact_high_watermark_pct": 80, "compact_low_watermark_pct": 60, "max_wait_pending": 5000, "max_num_pending": 10000, "max_wait_skipped": 3600000, "enable_star_channel": true, "max_length": 500, "min_length": 50, "expiry_seconds": 60, "query_limit": 5000 }, "max_wait_pending": 0, "max_wait_skipped": 0, "enable_star_channel": true, "channel_cache_max_length": 0, "channel_cache_min_length": 0, "channel_cache_expiry": 0, "max_num_pending": 0 }, "rev_cache_size": 0, "offline": false, "unsupported": {"oidc_test_provider": {}, "warning_thresholds": {}, "oidc_tls_skip_verify": true, "sgr_tls_skip_verify": true, "remote_config_tls_skip_verify": true, "guest_read_only": true, "force_api_forbidden_errors": true, "dcp_read_buffer": 0, "kv_buffer": 0 }, "old_rev_expiry_seconds": 300, "view_query_timeout_secs": 75, "local_doc_expiry_secs": 7776000, "enable_shared_bucket_access": true, "session_cookie_secure": true, "session_cookie_name": "string", "session_cookie_http_only": false, "allow_conflicts": true, "num_index_replicas": 1, "use_views": false, "send_www_authenticate_header": true, "disable_password_auth": false, "bucket_op_timeout_ms": 0, "slow_query_warning_threshold": 500, "compact_interval_days": 1, "sgreplicate_enabled": true, "sgreplicate_websocket_heartbeat_secs": 300, "replications": {"replication_id": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ] } }, "serve_insecure_attachment_types": false, "query_pagination_limit": 5000, "user_xattr_key": "string", "client_partition_window_secs": 2592000, "guest": {"name": "string", "password": "string", "email": "string", "disabled": true, }, "javascript_timeout_secs": 60, "suspendable": false, "logging": {"audit": {"enabled": false, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] } } } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Update database configuration put/{db}/_config{protocol}://{hostname}:4985/{db}/_config Request samples Content typeapplication/json Copy Expand all Collapse all {"server": "string", "pool": "default", "bucket": "The database name", "username": "string", "password": "string", "certpath": "string", "keypath": "string", "cacertpath": "string", "kv_tls_port": 11207, "max_concurrent_query_ops": 1000, "scopes": {"scopename": {"collections": {"collectionname1": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" }, "collectionname2": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" } } } }, "name": "string", "sync": "function(doc){channel(doc.channels);}", "users": {"username1": {"name": "string", "password": "string", "email": "string", "disabled": true, }, "username2": {"name": "string", "password": "string", "email": "string", "disabled": true, } }, "revs_limit": "100 if conflict allowed and 50 if not", "import_docs": true, "import_partitions": 16, "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }", "import_backup_old_rev": false, "event_handlers": {"max_processes": "string", "wait_for_process": "string", "document_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } }, "db_state_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } } }, "feed_type": "DCP", "allow_empty_password": false, "cache": {"channel_cache": {"max_number": 50000, "compact_high_watermark_pct": 80, "compact_low_watermark_pct": 60, "max_wait_pending": 5000, "max_num_pending": 10000, "max_wait_skipped": 3600000, "enable_star_channel": true, "max_length": 500, "min_length": 50, "expiry_seconds": 60, "query_limit": 5000 }, "max_wait_pending": 0, "max_wait_skipped": 0, "enable_star_channel": true, "channel_cache_max_length": 0, "channel_cache_min_length": 0, "channel_cache_expiry": 0, "max_num_pending": 0 }, "rev_cache_size": 0, "offline": false, "unsupported": {"oidc_test_provider": {}, "warning_thresholds": {}, "oidc_tls_skip_verify": true, "sgr_tls_skip_verify": true, "remote_config_tls_skip_verify": true, "guest_read_only": true, "force_api_forbidden_errors": true, "dcp_read_buffer": 0, "kv_buffer": 0 }, "old_rev_expiry_seconds": 300, "view_query_timeout_secs": 75, "local_doc_expiry_secs": 7776000, "enable_shared_bucket_access": true, "session_cookie_secure": true, "session_cookie_name": "string", "session_cookie_http_only": false, "allow_conflicts": true, "num_index_replicas": 1, "use_views": false, "send_www_authenticate_header": true, "disable_password_auth": false, "bucket_op_timeout_ms": 0, "slow_query_warning_threshold": 500, "compact_interval_days": 1, "sgreplicate_enabled": true, "sgreplicate_websocket_heartbeat_secs": 300, "replications": {"replication_id": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ] } }, "serve_insecure_attachment_types": false, "query_pagination_limit": 5000, "user_xattr_key": "string", "client_partition_window_secs": 2592000, "guest": {"name": "string", "password": "string", "email": "string", "disabled": true, }, "javascript_timeout_secs": 60, "suspendable": false, "logging": {"audit": {"enabled": false, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] } } } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Update database configuration This is used to update the database configuration fields specified. Only the fields specified in the request will have their values replaced.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This is used to update the database configuration fields specified. Only the fields specified in the request will have their values replaced.
The bucket and database name cannot be changed. If these need to be changed, the database will need to be deleted then recreated with the new settings.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
header Parameters| If-Match | string If set to a configuration's Etag value, enables optimistic concurrency control for the request. Returns HTTP 412 if another update happened underneath this one.
- |
Request Body schema: application/jsonThe database configuration fields to update
- | server | string This is the Couchbase Server address or addresses that the database connect to.
- | | pool | string Deprecated Default: "default" This field is unsupported and ignored.
- | | bucket | string Default: "The database name" The Couchbase Server backing bucket for the database.
- | | username | string The username for authenticating to the server.
- | | password | string The password for authenticating to the server.
- | | certpath | string The cert path (public key) for X.509 bucket auth.
- | | keypath | string The key path (private key) for X.509 bucket auth
- | | cacertpath | string The root CA cert path for X.509 bucket authentication.
- | | kv_tls_port | integer Default: 11207 The Memcached TLS port.
- | | max_concurrent_query_ops | integer Default: 1000 The maximum amount of query operations that can be running at any one point.
- | | scopes | object <= 1 properties An object keyed by scope name containing config for the specific collection.
- | | name | string The name of the database.
- | | sync | string Default: "function(doc){channel(doc.channels);}" path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
header Parameters| If-Match | string If set to a configuration's Etag value, enables optimistic concurrency control for the request. Returns HTTP 412 if another update happened underneath this one.
+ |
Request Body schema: application/jsonThe database configuration fields to update
+ | server | string This is the Couchbase Server address or addresses that the database connect to.
+ | | pool | string Deprecated Default: "default" This field is unsupported and ignored.
+ | | bucket | string Default: "The database name" The Couchbase Server backing bucket for the database.
+ | | username | string The username for authenticating to the server.
+ | | password | string The password for authenticating to the server.
+ | | certpath | string The cert path (public key) for X.509 bucket auth.
+ | | keypath | string The key path (private key) for X.509 bucket auth
+ | | cacertpath | string The root CA cert path for X.509 bucket authentication.
+ | | kv_tls_port | integer Default: 11207 The Memcached TLS port.
+ | | max_concurrent_query_ops | integer Default: 1000 The maximum amount of query operations that can be running at any one point.
+ | | scopes | object <= 1 properties An object keyed by scope name containing config for the specific collection.
+ | | name | string The name of the database.
+ | | sync | string Default: "function(doc){channel(doc.channels);}" The Javascript function that newly created documents are ran through for the default scope and collection.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The Javascript function that newly created documents are ran through for the default scope and collection.
If scopes parameter is set, this is ignored.
- | | users | | | roles | | | revs_limit | number >= 0 Default: "100 if conflict allowed and 50 if not" | | roles | | | revs_limit | number >= 0 Default: "100 if conflict allowed and 50 if not" The maximum depth a document's revision tree can grow too.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The maximum depth a document's revision tree can grow too.
The minimum is 20 if conflicts are allowed and 0 if not. It is not recommended to go below 100 when conflicts are allowed.
- | | import_docs | boolean | import_docs | boolean If true, documents will be imported in to Sync Gateway from the bucket when requested. Documents will be ran through the set import_filter if any is set.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> If true, documents will be imported in to Sync Gateway from the bucket when requested. Documents will be ran through the set import_filter if any is set.
The default value depends on the edition of Sync Gateway being used. If the edition is the Community Edition, then this will default to false or else in the Enterprise Edition, it will default to true.
This can also be set to the string continuous which maps to true.
- | | | import_partitions | number Default: 16 | import_partitions | number Default: 16 ** This is an Enterprise Edition feature only**
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> ** This is an Enterprise Edition feature only**
This is how many import partitions should be used for import sharding.
Partitions are distributed among all Sync Gateway nodes participating in import processing (import_docs=true), and each process a subset of the server's vbuckets.
Each partition is processed by an independent function that runs simultaneously to others, so import_partitions can be used to tune concurrency based on the number of Sync Gateway nodes, and the number of cores per node.
- | | | import_filter | string | import_filter | string This is the function that all imported documents in the default scope and collection are ran through in order to filter out what to import and what not to import. This allows you to control what is made available to Couchbase Mobile clients. If it is not set, then no documents are filtered when imported.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> This is the function that all imported documents in the default scope and collection are ran through in order to filter out what to import and what not to import. This allows you to control what is made available to Couchbase Mobile clients. If it is not set, then no documents are filtered when imported.
import_docs must be true to make this field applicable.
If scopes parameter is set, this is ignored.
- | | | import_backup_old_rev | boolean Default: false This controls whether import should attempt to create a temporary backup of the previous revision body (if available) when the document is modified in the bucket.
- | | event_handlers | object These are the settings for webhooks.
- | | feed_type | string Deprecated Default: "DCP" Value: "DCP" The type of feed to use to communicate with Couchbase Server. This will use DCP regardless of specification.
- | | allow_empty_password | boolean Default: false This controls whether users that are created can have an empty password or not.
- | | cache | | | rev_cache_size | number Deprecated | import_backup_old_rev | boolean Default: false This controls whether import should attempt to create a temporary backup of the previous revision body (if available) when the document is modified in the bucket.
+ | | | event_handlers | object These are the settings for webhooks.
+ | | feed_type | string Deprecated Default: "DCP" Value: "DCP" The type of feed to use to communicate with Couchbase Server. This will use DCP regardless of specification.
+ | | allow_empty_password | boolean Default: false This controls whether users that are created can have an empty password or not.
+ | | cache | | | rev_cache_size | number Deprecated Deprecated, please use the database setting cache.rev_cache.size instead
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Deprecated, please use the database setting cache.rev_cache.size instead
The maximum number of revisions to store in the revision cache.
- | | offline | boolean Default: false Start the database in an offline state.
- | | unsupported | object These are unsupported options and therefore it is not recommended to use them.
- | | local_jwt | object Configuration for Local JWT authentication.
- | | oidc | object Configuration for OpenID Connect authentication.
- | | old_rev_expiry_seconds | number Default: 300 The number of seconds before old revisions are removed from the Couchbase Server bucket.
- | | view_query_timeout_secs | integer Default: 75 The number of seconds before a view query should timeout.
- | | local_doc_expiry_secs | integer Default: 7776000 The number of seconds before a _local document should expire.
- | | enable_shared_bucket_access | boolean Default: true Whether to use extended attributes to store Sync Gateway document (_sync) metadata.
- | | session_cookie_secure | boolean | offline | boolean Default: false Start the database in an offline state.
+ | | | unsupported | object These are unsupported options and therefore it is not recommended to use them.
+ | | local_jwt | object Configuration for Local JWT authentication.
+ | | oidc | object Configuration for OpenID Connect authentication.
+ | | old_rev_expiry_seconds | number Default: 300 The number of seconds before old revisions are removed from the Couchbase Server bucket.
+ | | view_query_timeout_secs | integer Default: 75 The number of seconds before a view query should timeout.
+ | | local_doc_expiry_secs | integer Default: 7776000 The number of seconds before a _local document should expire.
+ | | enable_shared_bucket_access | boolean Default: true Whether to use extended attributes to store Sync Gateway document (_sync) metadata.
+ | | session_cookie_secure | boolean Override the session cookie secure flag. If set, the cookie will have the secure flag.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Override the session cookie secure flag. If set, the cookie will have the secure flag.
This will default to true if startup config api.https.tls_cert_path is set otherwise it will default to false.
- | | session_cookie_name | string This can be used to define a custom per-database session cookie name.
- | | session_cookie_http_only | boolean Default: false Make all session cookies for the database set the HttpOnly flag so they are inaccessible to JavaScript.
- | | allow_conflicts | boolean Deprecated Default: true This controls whether to allow conflicting document revisions.
- | | num_index_replicas | number Default: 1 This is the number of Global Secondary Indexes (GSI) to use for core indexes.
- | | use_views | boolean Default: false Force the use of views instead of GSI.
- | | send_www_authenticate_header | boolean Default: true Controls whether to send a WWW-Authenticate header in 401 Unauthorized HTTP responses.
- | | disable_password_auth | boolean Default: false Whether to disable username/password authentication and only allow OIDC and guest access.
- | | bucket_op_timeout_ms | number This is the amount of milliseconds should pass before a bucket operation times out. An error will be returned if the bucket operation times out saying: operation timed out.
- | | slow_query_warning_threshold | number Default: 500 The amount of milliseconds a N1QL query should run before logging a warning.
- | | delta_sync | object | session_cookie_name | string This can be used to define a custom per-database session cookie name.
+ | | | session_cookie_http_only | boolean Default: false Make all session cookies for the database set the HttpOnly flag so they are inaccessible to JavaScript.
+ | | allow_conflicts | boolean Deprecated Default: true This controls whether to allow conflicting document revisions.
+ | | num_index_replicas | number Default: 1 This is the number of Global Secondary Indexes (GSI) to use for core indexes.
+ | | use_views | boolean Default: false Force the use of views instead of GSI.
+ | | send_www_authenticate_header | boolean Default: true Controls whether to send a WWW-Authenticate header in 401 Unauthorized HTTP responses.
+ | | disable_password_auth | boolean Default: false Whether to disable username/password authentication and only allow OIDC and guest access.
+ | | bucket_op_timeout_ms | number This is the amount of milliseconds should pass before a bucket operation times out. An error will be returned if the bucket operation times out saying: operation timed out.
+ | | slow_query_warning_threshold | number Default: 500 The amount of milliseconds a N1QL query should run before logging a warning.
+ | | delta_sync | object Delta sync configuration settings.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Delta sync configuration settings.
This is an Enterprise Edition feature only
- | | compact_interval_days | number Default: 1 | compact_interval_days | number Default: 1 The interval between scheduled tombstone compaction runs (in days). This can be a floating point number.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The interval between scheduled tombstone compaction runs (in days). This can be a floating point number.
If set to 0, compaction will not run automatically.
- | | | sgreplicate_enabled | boolean Default: true Whether the node should accept assign replications (true) or not (false).
- | | sgreplicate_websocket_heartbeat_secs | integer Default: 300 Use a custom heartbeat interval (in seconds) for websocket ping frames.
- | | replications | | | serve_insecure_attachment_types | boolean Default: false | sgreplicate_enabled | boolean Default: true Whether the node should accept assign replications (true) or not (false).
+ | | | sgreplicate_websocket_heartbeat_secs | integer Default: 300 Use a custom heartbeat interval (in seconds) for websocket ping frames.
+ | | replications | | | serve_insecure_attachment_types | boolean Default: false If set, always serve attachments with the Content-Type header set to the type of the attachment.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> If set, always serve attachments with the Content-Type header set to the type of the attachment.
When serving an attachment, usually the Content-Type header is set to the type of the attachment but the Content-Disposition response header will be set instead if the content type is vulnerable to a phishing attack, causing the browser to download the file instead of display it. This option will override that behaviour and always set the Content-Type header.
- | | query_pagination_limit | integer Default: 5000 The query limit to be used during pagination of large queries.
- | | user_xattr_key | string The key to use for the user xattr that will be accessible from the sync function. IF empty, the feature will be disabled.
- | | client_partition_window_secs | integer Default: 2592000 | query_pagination_limit | integer Default: 5000 The query limit to be used during pagination of large queries.
+ | | | user_xattr_key | string The key to use for the user xattr that will be accessible from the sync function. IF empty, the feature will be disabled.
+ | | client_partition_window_secs | integer Default: 2592000 How long (in seconds) clients can remain offline for without losing replication metadata.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> How long (in seconds) clients can remain offline for without losing replication metadata.
Defaults to 30 days (in seconds)
- | | guest | object (User) Properties associated with a user
- | | javascript_timeout_secs | number Default: 60 The maximum number of seconds the sync, import filter, and custom conflict resolver JavaScript functions are allowed to run for before timing out. Set to 0 to allow the JS functions to run uncapped.
- | | suspendable | boolean Default: false | guest | object (User) Properties associated with a user
+ | | | javascript_timeout_secs | number Default: 60 The maximum number of seconds the sync, import filter, and custom conflict resolver JavaScript functions are allowed to run for before timing out. Set to 0 to allow the JS functions to run uncapped.
+ | | suspendable | boolean Default: false Set to true to allow the database to be suspended.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Set to true to allow the database to be suspended.
Defaults to true when running in serverless mode otherwise defaults to false.
- | | cors | object CORS configuration for this database; if present, overrides server's config.
- | | logging | object Per-database logging configuration.
- |
Responses201 Database configuration successfully updated
- 400 There was a problem with your request
- 412 | cors | object CORS configuration for this database; if present, overrides server's config.
+ | | | logging | object Per-database logging configuration.
+ |
Responses201 Database configuration successfully updated
+ 400 There was a problem with your request
+ 412 Precondition Failed
+" class="sc-faJlkc sc-fdduAw sc-eINXvP kOqeZB ipNwOs fbuMAW"> Precondition Failed
The supplied If-Match header did not match the current version of the configuration.
Returned when optimistic concurrency control is used, and there has been an update to the configuration in between this update.
- post/{db}/_config{protocol}://{hostname}:4985/{db}/_config Request samples Content typeapplication/json Copy Expand all Collapse all {"server": "string", "pool": "default", "bucket": "The database name", "username": "string", "password": "string", "certpath": "string", "keypath": "string", "cacertpath": "string", "kv_tls_port": 11207, "max_concurrent_query_ops": 1000, "scopes": {"scopename": {"collections": {"collectionname1": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" }, "collectionname2": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" } } } }, "name": "string", "sync": "function(doc){channel(doc.channels);}", "users": {"username1": {"name": "string", "password": "string", "email": "string", "disabled": true, }, "username2": {"name": "string", "password": "string", "email": "string", "disabled": true, } }, "revs_limit": "100 if conflict allowed and 50 if not", "import_docs": true, "import_partitions": 16, "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }", "import_backup_old_rev": false, "event_handlers": {"max_processes": "string", "wait_for_process": "string", "document_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } }, "db_state_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } } }, "feed_type": "DCP", "allow_empty_password": false, "cache": {"channel_cache": {"max_number": 50000, "compact_high_watermark_pct": 80, "compact_low_watermark_pct": 60, "max_wait_pending": 5000, "max_num_pending": 10000, "max_wait_skipped": 3600000, "enable_star_channel": true, "max_length": 500, "min_length": 50, "expiry_seconds": 60, "query_limit": 5000 }, "max_wait_pending": 0, "max_wait_skipped": 0, "enable_star_channel": true, "channel_cache_max_length": 0, "channel_cache_min_length": 0, "channel_cache_expiry": 0, "max_num_pending": 0 }, "rev_cache_size": 0, "offline": false, "unsupported": {"oidc_test_provider": {}, "warning_thresholds": {}, "oidc_tls_skip_verify": true, "sgr_tls_skip_verify": true, "remote_config_tls_skip_verify": true, "guest_read_only": true, "force_api_forbidden_errors": true, "dcp_read_buffer": 0, "kv_buffer": 0 }, "old_rev_expiry_seconds": 300, "view_query_timeout_secs": 75, "local_doc_expiry_secs": 7776000, "enable_shared_bucket_access": true, "session_cookie_secure": true, "session_cookie_name": "string", "session_cookie_http_only": false, "allow_conflicts": true, "num_index_replicas": 1, "use_views": false, "send_www_authenticate_header": true, "disable_password_auth": false, "bucket_op_timeout_ms": 0, "slow_query_warning_threshold": 500, "compact_interval_days": 1, "sgreplicate_enabled": true, "sgreplicate_websocket_heartbeat_secs": 300, "replications": {"replication_id": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ] } }, "serve_insecure_attachment_types": false, "query_pagination_limit": 5000, "user_xattr_key": "string", "client_partition_window_secs": 2592000, "guest": {"name": "string", "password": "string", "email": "string", "disabled": true, }, "javascript_timeout_secs": 60, "suspendable": false, "logging": {"audit": {"enabled": false, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] } } } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Get database audit configuration post/{db}/_config{protocol}://{hostname}:4985/{db}/_config Request samples Content typeapplication/json Copy Expand all Collapse all {"server": "string", "pool": "default", "bucket": "The database name", "username": "string", "password": "string", "certpath": "string", "keypath": "string", "cacertpath": "string", "kv_tls_port": 11207, "max_concurrent_query_ops": 1000, "scopes": {"scopename": {"collections": {"collectionname1": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" }, "collectionname2": {"sync": "function(doc){channel(\"collection name\");}", "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }" } } } }, "name": "string", "sync": "function(doc){channel(doc.channels);}", "users": {"username1": {"name": "string", "password": "string", "email": "string", "disabled": true, }, "username2": {"name": "string", "password": "string", "email": "string", "disabled": true, } }, "revs_limit": "100 if conflict allowed and 50 if not", "import_docs": true, "import_partitions": 16, "import_filter": "function(doc) { if (doc.type != 'mobile') { return false; } return true; }", "import_backup_old_rev": false, "event_handlers": {"max_processes": "string", "wait_for_process": "string", "document_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } }, "db_state_changed": {"handler": "webhook", "url": "string", "filter": "string", "timeout": 0, "options": {"property1": null, "property2": null } } }, "feed_type": "DCP", "allow_empty_password": false, "cache": {"channel_cache": {"max_number": 50000, "compact_high_watermark_pct": 80, "compact_low_watermark_pct": 60, "max_wait_pending": 5000, "max_num_pending": 10000, "max_wait_skipped": 3600000, "enable_star_channel": true, "max_length": 500, "min_length": 50, "expiry_seconds": 60, "query_limit": 5000 }, "max_wait_pending": 0, "max_wait_skipped": 0, "enable_star_channel": true, "channel_cache_max_length": 0, "channel_cache_min_length": 0, "channel_cache_expiry": 0, "max_num_pending": 0 }, "rev_cache_size": 0, "offline": false, "unsupported": {"oidc_test_provider": {}, "warning_thresholds": {}, "oidc_tls_skip_verify": true, "sgr_tls_skip_verify": true, "remote_config_tls_skip_verify": true, "guest_read_only": true, "force_api_forbidden_errors": true, "dcp_read_buffer": 0, "kv_buffer": 0 }, "old_rev_expiry_seconds": 300, "view_query_timeout_secs": 75, "local_doc_expiry_secs": 7776000, "enable_shared_bucket_access": true, "session_cookie_secure": true, "session_cookie_name": "string", "session_cookie_http_only": false, "allow_conflicts": true, "num_index_replicas": 1, "use_views": false, "send_www_authenticate_header": true, "disable_password_auth": false, "bucket_op_timeout_ms": 0, "slow_query_warning_threshold": 500, "compact_interval_days": 1, "sgreplicate_enabled": true, "sgreplicate_websocket_heartbeat_secs": 300, "replications": {"replication_id": {"replication_id": "string", "remote": "string", "username": "string", "password": "string", "remote_username": "string", "remote_password": "string", "direction": "push", "conflict_resolution_type": "default", "custom_conflict_resolver": "none", "purge_on_removal": false, "enable_delta_sync": false, "max_backoff_time": 5, "initial_state": "running", "continuous": false, "filter": "sync_gateway/bychannel", "adhoc": false, "batch_size": 200, "run_as": "string", "collections_enabled": false, "collections_local": ["scope1.collection1", "scope1.collection3", "scope1.collection6" ], "collections_remote": ["scope1.collectionA", null, "scope1.collectionF" ] } }, "serve_insecure_attachment_types": false, "query_pagination_limit": 5000, "user_xattr_key": "string", "client_partition_window_secs": 2592000, "guest": {"name": "string", "password": "string", "email": "string", "disabled": true, }, "javascript_timeout_secs": 60, "suspendable": false, "logging": {"audit": {"enabled": false, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] } } } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Get database audit configuration Retrieve the audit configuration for the database specified.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Retrieve the audit configuration for the database specified.
Required Sync Gateway RBAC roles:
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
query Parameters| verbose | boolean Default: false Whether to show name and description with each audit event.
- | | filterable | boolean Default: false Whether to show only filterable audit events.
- |
Responses200 Successfully retrieved database configuration
- 404 Resource could not be found
- get/{db}/_config/audit{protocol}://{hostname}:4985/{db}/_config/audit Response samples Content typeapplication/json Copy Expand all Collapse all {"enabled": true, "events": {"audit_id1": true, "audit_id2": true }, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] }Replace database audit configuration path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
query Parameters| verbose | boolean Default: false Whether to show name and description with each audit event.
+ | | filterable | boolean Default: false Whether to show only filterable audit events.
+ |
Responses200 Successfully retrieved database configuration
+ 404 Resource could not be found
+ get/{db}/_config/audit{protocol}://{hostname}:4985/{db}/_config/audit Response samples Content typeapplication/json Copy Expand all Collapse all {"enabled": true, "events": {"audit_id1": true, "audit_id2": true }, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] }Replace database audit configuration Replaces the database audit configuration with the one sent in the request.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Replaces the database audit configuration with the one sent in the request.
Unspecified audit events will be reset to their default enabled value. Use POST if you want upsert-style semantics.
Required Sync Gateway RBAC roles:
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Request Body schema: application/jsonThe new database audit configuration to use
- One of SimpleVerbose | enabled | | | events | | | disabled_users | Array of objects List of users for which audit logging is disabled.
- | | disabled_roles | Array of objects List of roles for which audit logging is disabled. Either cbs or sgw.
- |
Responses200 Database audit configuration successfully updated
- 400 There was a problem with your request
- 404 Resource could not be found
- put/{db}/_config/audit{protocol}://{hostname}:4985/{db}/_config/audit Request samples Content typeapplication/json Copy Expand all Collapse all {"enabled": true, "events": {"audit_id1": true, "audit_id2": true }, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Update database audit configuration path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
Request Body schema: application/jsonThe new database audit configuration to use
+ One of SimpleVerbose | enabled | | | events | | | disabled_users | Array of objects List of users for which audit logging is disabled.
+ | | disabled_roles | Array of objects List of roles for which audit logging is disabled. Either cbs or sgw.
+ |
Responses200 Database audit configuration successfully updated
+ 400 There was a problem with your request
+ 404 Resource could not be found
+ put/{db}/_config/audit{protocol}://{hostname}:4985/{db}/_config/audit Request samples Content typeapplication/json Copy Expand all Collapse all {"enabled": true, "events": {"audit_id1": true, "audit_id2": true }, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Update database audit configuration This is used to update the database configuration fields specified. Only the fields specified in the request will have their values replaced.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This is used to update the database configuration fields specified. Only the fields specified in the request will have their values replaced.
Unspecified audit events will be unaffected. Use PUT if you want to reset events to their default state.
Required Sync Gateway RBAC roles:
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
query Parameters| verbose | boolean Default: false Whether to show name and description with each audit event.
- |
Request Body schema: application/jsonThe database configuration fields to update
- One of SimpleVerbose | enabled | | | events | | | disabled_users | Array of objects List of users for which audit logging is disabled.
- | | disabled_roles | Array of objects List of roles for which audit logging is disabled. Either cbs or sgw.
- |
Responses200 Database audit configuration successfully updated
- 400 There was a problem with your request
- post/{db}/_config/audit{protocol}://{hostname}:4985/{db}/_config/audit Request samples Content typeapplication/json Copy Expand all Collapse all {"enabled": true, "events": {"audit_id1": true, "audit_id2": true }, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Get database sync function path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
query Parameters| verbose | boolean Default: false Whether to show name and description with each audit event.
+ |
Request Body schema: application/jsonThe database configuration fields to update
+ One of SimpleVerbose | enabled | | | events | | | disabled_users | Array of objects List of users for which audit logging is disabled.
+ | | disabled_roles | Array of objects List of roles for which audit logging is disabled. Either cbs or sgw.
+ |
Responses200 Database audit configuration successfully updated
+ 400 There was a problem with your request
+ post/{db}/_config/audit{protocol}://{hostname}:4985/{db}/_config/audit Request samples Content typeapplication/json Copy Expand all Collapse all {"enabled": true, "events": {"audit_id1": true, "audit_id2": true }, "disabled_users": [{"domain": "cbs", "name": "string" } ], "disabled_roles": [{"domain": "cbs", "name": "string" } ] } Response samples Content typeapplication/json {"error": "string", "reason": "string" }Get database sync function This returns the database's sync function.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This returns the database's sync function.
Response will be blank if there has been no sync function set.
Required Sync Gateway RBAC roles:
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
Responses200 Successfully retrieved the sync function
- 404 Resource could not be found
- get/{keyspace}/_config/sync{protocol}://{hostname}:4985/{keyspace}/_config/sync Response samples Content typeapplication/javascript function (doc, oldDoc) {
+ |
Responses200 Successfully retrieved the sync function
+ 404 Resource could not be found
+ get/{keyspace}/_config/sync{protocol}://{hostname}:4985/{keyspace}/_config/sync Response samples Content typeapplication/javascript function (doc, oldDoc) {
channel(doc.channels);
-}Set database sync function Set database sync function This will allow you to update the sync function.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This will allow you to update the sync function.
Required Sync Gateway RBAC roles:
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
query Parameters| disable_oidc_validation | boolean Default: false If set, will not attempt to validate the configured OpenID Connect providers are reachable.
- |
header Parameters| If-Match | string If set to a configuration's Etag value, enables optimistic concurrency control for the request. Returns HTTP 412 if another update happened underneath this one.
- |
Request Body schema: application/javascriptThe new sync function to use
- Responses200 Updated sync function successfully
- 400 There was a problem with your request
- 404 Resource could not be found
- 412 query Parameters | disable_oidc_validation | boolean Default: false If set, will not attempt to validate the configured OpenID Connect providers are reachable.
+ |
header Parameters| If-Match | string If set to a configuration's Etag value, enables optimistic concurrency control for the request. Returns HTTP 412 if another update happened underneath this one.
+ |
Request Body schema: application/javascriptThe new sync function to use
+ Responses200 Updated sync function successfully
+ 400 There was a problem with your request
+ 404 Resource could not be found
+ 412 Precondition Failed
+" class="sc-faJlkc sc-fdduAw sc-eINXvP kOqeZB ipNwOs fbuMAW"> Precondition Failed
The supplied If-Match header did not match the current version of the configuration.
Returned when optimistic concurrency control is used, and there has been an update to the configuration in between this update.
- put/{keyspace}/_config/sync{protocol}://{hostname}:4985/{keyspace}/_config/sync Request samples Content typeapplication/javascript function (doc, oldDoc) {
+put/{keyspace}/_config/sync{protocol}://{hostname}:4985/{keyspace}/_config/sync Request samples Content typeapplication/javascript function (doc, oldDoc) {
channel(doc.channels);
-} Response samples Content typeapplication/json {"error": "string", "reason": "string" }Remove custom sync function Response samples Content typeapplication/json {"error": "string", "reason": "string" }Remove custom sync function This will remove the custom sync function from the database configuration.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This will remove the custom sync function from the database configuration.
The default sync function is equivalent to:
function (doc) {
channel(doc.channels);
@@ -2097,885 +2097,885 @@
-
path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
header Parameters| If-Match | string The revision ID to target.
- |
Responses200 Successfully reset the sync function
- 404 Resource could not be found
- 412 header Parameters | If-Match | string The revision ID to target.
+ |
Responses200 Successfully reset the sync function
+ 404 Resource could not be found
+ 412 Precondition Failed
+" class="sc-faJlkc sc-fdduAw sc-eINXvP kOqeZB ipNwOs fbuMAW"> Precondition Failed
The supplied If-Match header did not match the current version of the configuration.
Returned when optimistic concurrency control is used, and there has been an update to the configuration in between this update.
- delete/{keyspace}/_config/sync{protocol}://{hostname}:4985/{keyspace}/_config/sync Response samples Content typeapplication/json Get database import filter delete/{keyspace}/_config/sync{protocol}://{hostname}:4985/{keyspace}/_config/sync Response samples Content typeapplication/json Get database import filter This returns the database's import filter that documents are ran through when importing.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This returns the database's import filter that documents are ran through when importing.
Response will be blank if there has been no import filter set.
Required Sync Gateway RBAC roles:
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
Responses200 Successfully retrieved the import filter
- 404 Resource could not be found
- get/{keyspace}/_config/import_filter{protocol}://{hostname}:4985/{keyspace}/_config/import_filter Response samples Content typeapplication/json Set database import filter Responses 200 Successfully retrieved the import filter
+ 404 Resource could not be found
+ get/{keyspace}/_config/import_filter{protocol}://{hostname}:4985/{keyspace}/_config/import_filter Response samples Content typeapplication/json Set database import filter This will allow you to update the database's import filter.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This will allow you to update the database's import filter.
Required Sync Gateway RBAC roles:
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
query Parameters| disable_oidc_validation | boolean Default: false If set, will not attempt to validate the configured OpenID Connect providers are reachable.
- |
header Parameters| If-Match | string If set to a configuration's Etag value, enables optimistic concurrency control for the request. Returns HTTP 412 if another update happened underneath this one.
- |
Request Body schema: application/javascriptThe import filter to use
- Responses200 Updated import filter successfully
- 400 There was a problem with your request
- 404 Resource could not be found
- 412 query Parameters | disable_oidc_validation | boolean Default: false If set, will not attempt to validate the configured OpenID Connect providers are reachable.
+ |
header Parameters| If-Match | string If set to a configuration's Etag value, enables optimistic concurrency control for the request. Returns HTTP 412 if another update happened underneath this one.
+ |
Request Body schema: application/javascriptThe import filter to use
+ Responses200 Updated import filter successfully
+ 400 There was a problem with your request
+ 404 Resource could not be found
+ 412 Precondition Failed
+" class="sc-faJlkc sc-fdduAw sc-eINXvP kOqeZB ipNwOs fbuMAW"> Precondition Failed
The supplied If-Match header did not match the current version of the configuration.
Returned when optimistic concurrency control is used, and there has been an update to the configuration in between this update.
- put/{keyspace}/_config/import_filter{protocol}://{hostname}:4985/{keyspace}/_config/import_filter Response samples Content typeapplication/json {"error": "string", "reason": "string" }Delete import filter put/{keyspace}/_config/import_filter{protocol}://{hostname}:4985/{keyspace}/_config/import_filter Response samples Content typeapplication/json {"error": "string", "reason": "string" }Delete import filter This will remove the custom import filter function from the database configuration so that Sync Gateway will not filter any documents during import.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This will remove the custom import filter function from the database configuration so that Sync Gateway will not filter any documents during import.
Required Sync Gateway RBAC roles:
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
header Parameters| If-Match | string If set to a configuration's Etag value, enables optimistic concurrency control for the request. Returns HTTP 412 if another update happened underneath this one.
- |
Responses200 Successfully deleted the import filter
- 404 Resource could not be found
- 412 header Parameters | If-Match | string If set to a configuration's Etag value, enables optimistic concurrency control for the request. Returns HTTP 412 if another update happened underneath this one.
+ |
Responses200 Successfully deleted the import filter
+ 404 Resource could not be found
+ 412 Precondition Failed
+" class="sc-faJlkc sc-fdduAw sc-eINXvP kOqeZB ipNwOs fbuMAW"> Precondition Failed
The supplied If-Match header did not match the current version of the configuration.
Returned when optimistic concurrency control is used, and there has been an update to the configuration in between this update.
- delete/{keyspace}/_config/import_filter{protocol}://{hostname}:4985/{keyspace}/_config/import_filter Response samples Content typeapplication/json delete/{keyspace}/_config/import_filter{protocol}://{hostname}:4985/{keyspace}/_config/import_filter Response samples Content typeapplication/json Create and manage database users and roles
- Get all the names of the users Get all the names of the users Retrieves all the names of the users that are in the database.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Retrieves all the names of the users that are in the database.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
query Parameters| name_only | boolean Default: true Whether to return user names only, or more detailed information for each user.
- | | limit | integer How many results to return. Using a value of 0 results in no limit.
- |
Responses200 Users retrieved successfully
- 404 Resource could not be found
- get/{db}/_user/{protocol}://{hostname}:4985/{db}/_user/ Response samples Content typeapplication/json Create a new user path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
query Parameters| name_only | boolean Default: true Whether to return user names only, or more detailed information for each user.
+ | | limit | integer How many results to return. Using a value of 0 results in no limit.
+ |
Responses200 Users retrieved successfully
+ 404 Resource could not be found
+ get/{db}/_user/{protocol}://{hostname}:4985/{db}/_user/ Response samples Content typeapplication/json Create a new user Create a new user using the request body to specify the properties on the user.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Create a new user using the request body to specify the properties on the user.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Request Body schema: application/jsonProperties associated with a user
- | name | string path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
Request Body schema: application/jsonProperties associated with a user
+ | name | string The name of the user.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The name of the user.
User names can only have alphanumeric ASCII characters and underscores.
- | | password | string | password | string The password of the user.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The password of the user.
Mandatory. unless allow_empty_password is true in the database configs.
- | | | admin_channels | Array of strings A list of channels to explicitly grant to the user for the default collection.
- | | collection_access | object A set of access grants by scope and collection.
- | | email | string The email address of the user.
- | | disabled | boolean If true, the user will not be able to login to the account as it is disabled.
- | | admin_roles | Array of strings A list of roles to explicitly grant to the user.
- |
Responses201 New user created successfully
- 404 Resource could not be found
- 409 Resource already exists under that name
- post/{db}/_user/{protocol}://{hostname}:4985/{db}/_user/ Request samples Content typeapplication/json Copy Expand all Collapse all {"name": "string", "password": "string", "email": "string", "disabled": true, } Response samples Content typeapplication/json /{db}/_user/ | admin_channels | Array of strings A list of channels to explicitly grant to the user for the default collection.
+ | | | collection_access | object A set of access grants by scope and collection.
+ | | email | string The email address of the user.
+ | | disabled | boolean If true, the user will not be able to login to the account as it is disabled.
+ | | admin_roles | Array of strings A list of roles to explicitly grant to the user.
+ |
Responses201 New user created successfully
+ 404 Resource could not be found
+ 409 Resource already exists under that name
+ post/{db}/_user/{protocol}://{hostname}:4985/{db}/_user/ Request samples Content typeapplication/json Copy Expand all Collapse all {"name": "string", "password": "string", "email": "string", "disabled": true, } Response samples Content typeapplication/json /{db}/_user/ Required Sync Gateway RBAC roles:
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Responses404 Resource could not be found
- head/{db}/_user/{protocol}://{hostname}:4985/{db}/_user/ Response samples Content typeapplication/json Get a user path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
Responses404 Resource could not be found
+ head/{db}/_user/{protocol}://{hostname}:4985/{db}/_user/ Response samples Content typeapplication/json Get a user Retrieve a single users information.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Retrieve a single users information.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- | | name required | |
Responses200 Properties associated with a user
- 404 Resource could not be found
- get/{db}/_user/{name}{protocol}://{hostname}:4985/{db}/_user/{name} Response samples Content typeapplication/json Copy Expand all Collapse all Upsert a user path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ | | name required | |
Responses200 Properties associated with a user
+ 404 Resource could not be found
+ get/{db}/_user/{name}{protocol}://{hostname}:4985/{db}/_user/{name} Response samples Content typeapplication/json Copy Expand all Collapse all Upsert a user If the user does not exist, create a new user otherwise update the existing user.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> If the user does not exist, create a new user otherwise update the existing user.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- | | name required | |
Request Body schema: application/jsonProperties associated with a user
- | name | string path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ | | name required | |
Request Body schema: application/jsonProperties associated with a user
+ | name | string The name of the user.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The name of the user.
User names can only have alphanumeric ASCII characters and underscores.
- | | password | string | password | string The password of the user.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The password of the user.
Mandatory. unless allow_empty_password is true in the database configs.
- | | | admin_channels | Array of strings A list of channels to explicitly grant to the user for the default collection.
- | | collection_access | object A set of access grants by scope and collection.
- | | email | string The email address of the user.
- | | disabled | boolean If true, the user will not be able to login to the account as it is disabled.
- | | admin_roles | Array of strings A list of roles to explicitly grant to the user.
- |
Responses200 Existing user modified successfully
- 404 Resource could not be found
- put/{db}/_user/{name}{protocol}://{hostname}:4985/{db}/_user/{name} Request samples Content typeapplication/json Copy Expand all Collapse all {"name": "string", "password": "string", "email": "string", "disabled": true, } Response samples Content typeapplication/json Delete a user | admin_channels | Array of strings A list of channels to explicitly grant to the user for the default collection.
+ | | | collection_access | object A set of access grants by scope and collection.
+ | | email | string The email address of the user.
+ | | disabled | boolean If true, the user will not be able to login to the account as it is disabled.
+ | | admin_roles | Array of strings A list of roles to explicitly grant to the user.
+ |
Responses200 Existing user modified successfully
+ 404 Resource could not be found
+ put/{db}/_user/{name}{protocol}://{hostname}:4985/{db}/_user/{name} Request samples Content typeapplication/json Copy Expand all Collapse all {"name": "string", "password": "string", "email": "string", "disabled": true, } Response samples Content typeapplication/json Delete a user Delete a user from the database.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Delete a user from the database.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- | | name required | |
Responses200 User deleted successfully
- 404 Resource could not be found
- delete/{db}/_user/{name}{protocol}://{hostname}:4985/{db}/_user/{name} Response samples Content typeapplication/json Check if user exists path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ | | name required | |
Responses200 User deleted successfully
+ 404 Resource could not be found
+ delete/{db}/_user/{name}{protocol}://{hostname}:4985/{db}/_user/{name} Response samples Content typeapplication/json Check if user exists Check if the user exists by checking the status code.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Check if the user exists by checking the status code.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- | | name required | |
head/{db}/_user/{name}{protocol}://{hostname}:4985/{db}/_user/{name} Get all names of the roles path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ | | name required | |
head/{db}/_user/{name}{protocol}://{hostname}:4985/{db}/_user/{name} Get all names of the roles Retrieves all the roles that are in the database.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Retrieves all the roles that are in the database.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
query Parameters| deleted | boolean Default: false Enum: true false Indicates that roles marked as deleted should be included in the result.
- |
Responses200 Roles retrieved successfully
- 404 Resource could not be found
- get/{db}/_role/{protocol}://{hostname}:4985/{db}/_role/ Response samples Content typeapplication/json ["Administrator", "Moderator" ]Create a new role path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
query Parameters| deleted | boolean Default: false Enum: true false Indicates that roles marked as deleted should be included in the result.
+ |
Responses200 Roles retrieved successfully
+ 404 Resource could not be found
+ get/{db}/_role/{protocol}://{hostname}:4985/{db}/_role/ Response samples Content typeapplication/json ["Administrator", "Moderator" ]Create a new role Create a new role using the request body to specify the properties on the role.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Create a new role using the request body to specify the properties on the role.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Request Body schema: application/jsonProperties associated with a role
- | name | string path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
Request Body schema: application/jsonProperties associated with a role
+ | name | string The name of the role.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The name of the role.
Role names can only have alphanumeric ASCII characters and underscores.
- | | admin_channels | Array of strings The channels that users in the role are able to access for the default collection.
- | | collection_access | object A set of access grants by scope and collection.
- |
Responses201 New role created successfully
- 404 Resource could not be found
- 409 Resource already exists under that name
- post/{db}/_role/{protocol}://{hostname}:4985/{db}/_role/ Request samples Content typeapplication/json Copy Expand all Collapse all Response samples Content typeapplication/json /{db}/_role/ | admin_channels | Array of strings The channels that users in the role are able to access for the default collection.
+ | | | collection_access | object A set of access grants by scope and collection.
+ |
Responses201 New role created successfully
+ 404 Resource could not be found
+ 409 Resource already exists under that name
+ post/{db}/_role/{protocol}://{hostname}:4985/{db}/_role/ Request samples Content typeapplication/json Copy Expand all Collapse all Response samples Content typeapplication/json /{db}/_role/ Required Sync Gateway RBAC roles:
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Responses404 Resource could not be found
- head/{db}/_role/{protocol}://{hostname}:4985/{db}/_role/ Response samples Content typeapplication/json Get a role path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
Responses404 Resource could not be found
+ head/{db}/_role/{protocol}://{hostname}:4985/{db}/_role/ Response samples Content typeapplication/json Get a role Retrieve a single roles properties.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Retrieve a single roles properties.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- | | name required | |
Responses200 Properties associated with a role
- 404 Resource could not be found
- get/{db}/_role/{name}{protocol}://{hostname}:4985/{db}/_role/{name} Response samples Content typeapplication/json Copy Expand all Collapse all Upsert a role path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ | | name required | |
Responses200 Properties associated with a role
+ 404 Resource could not be found
+ get/{db}/_role/{name}{protocol}://{hostname}:4985/{db}/_role/{name} Response samples Content typeapplication/json Copy Expand all Collapse all Upsert a role If the role does not exist, create a new role otherwise update the existing role.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> If the role does not exist, create a new role otherwise update the existing role.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- | | name required | |
Request Body schema: application/jsonProperties associated with a role
- | name | string path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ | | name required | |
Request Body schema: application/jsonProperties associated with a role
+ | name | string The name of the role.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The name of the role.
Role names can only have alphanumeric ASCII characters and underscores.
- | | admin_channels | Array of strings The channels that users in the role are able to access for the default collection.
- | | collection_access | object A set of access grants by scope and collection.
- |
Responses404 Resource could not be found
- put/{db}/_role/{name}{protocol}://{hostname}:4985/{db}/_role/{name} Request samples Content typeapplication/json Copy Expand all Collapse all Response samples Content typeapplication/json Delete a role | admin_channels | Array of strings The channels that users in the role are able to access for the default collection.
+ | | | collection_access | object A set of access grants by scope and collection.
+ |
Responses404 Resource could not be found
+ put/{db}/_role/{name}{protocol}://{hostname}:4985/{db}/_role/{name} Request samples Content typeapplication/json Copy Expand all Collapse all Response samples Content typeapplication/json Delete a role Delete a role from the database.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Delete a role from the database.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- | | name required | |
Responses404 Resource could not be found
- delete/{db}/_role/{name}{protocol}://{hostname}:4985/{db}/_role/{name} Response samples Content typeapplication/json Check if role exists path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ | | name required | |
Responses404 Resource could not be found
+ delete/{db}/_role/{name}{protocol}://{hostname}:4985/{db}/_role/{name} Response samples Content typeapplication/json Check if role exists Check if the role exists by checking the status code.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Check if the role exists by checking the status code.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- | | name required | |
Responses404 Resource could not be found
- head/{db}/_role/{name}{protocol}://{hostname}:4985/{db}/_role/{name} Response samples Content typeapplication/json path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ | | name required | |
Responses404 Resource could not be found
+ head/{db}/_role/{name}{protocol}://{hostname}:4985/{db}/_role/{name} Response samples Content typeapplication/json Get information about the current user This will get the information about the current user.
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Responses200 Properties associated with a user session
- 404 Resource could not be found
- get/{db}/_session{protocol}://{hostname}:4985/{db}/_session Response samples Content typeapplication/json Copy Expand all Collapse all {"authentication_handlers": [], "ok": true, "userCtx": {"channels": { }, "name": "string" } }Create a new user session Get information about the current user This will get the information about the current user.
+ path Parameters| db required | string Example: db1 The name of the database to run the operation against.
+ |
Responses200 Properties associated with a user session
+ 404 Resource could not be found
+ get/{db}/_session{protocol}://{hostname}:4985/{db}/_session Response samples Content typeapplication/json Copy Expand all Collapse all {"authentication_handlers": [], "ok": true, "userCtx": {"channels": { }, "name": "string" } }Create a new user session Generates a login session for a user and returns the session ID and cookie name for that session. If no TTL is provided, then the default of 24 hours will be used.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Generates a login session for a user and returns the session ID and cookie name for that session. If no TTL is provided, then the default of 24 hours will be used.
A session cannot be generated for an non-existent user or the GUEST user.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Request Body schema: application/jsonThe body can depend on if using the Public or Admin APIs.
- | name | string User name to generate the session for.
- | | ttl | integer Time until the session expires. Uses default value of 24 hours if left blank.
- |
Responses200 Session created successfully. Returned body is dependant on if using Public or Admin APIs.
- 400 Origin is not in the approved list of allowed origins
- 404 Resource could not be found
- post/{db}/_session{protocol}://{hostname}:4985/{db}/_session Request samples Content typeapplication/json {"name": "string", "ttl": 0 } Response samples Content typeapplication/json {"session_id": "c5af80a039db4ed9d2b6865576b6999935282689", "expires": "2022-01-21T15:24:44Z", "cookie_name": "SyncGatewaySession" }/{db}/_session path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- |
Responses404 Resource could not be found
- head/{db}/_session{protocol}://{hostname}:4985/{db}/_session Response samples Content typeapplication/json Get session information path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ |
Request Body schema: application/jsonThe body can depend on if using the Public or Admin APIs.
+ | name | string User name to generate the session for.
+ | | ttl | integer Time until the session expires. Uses default value of 24 hours if left blank.
+ |
Responses200 Session created successfully. Returned body is dependant on if using Public or Admin APIs.
+ 400 Origin is not in the approved list of allowed origins
+ 404 Resource could not be found
+ post/{db}/_session{protocol}://{hostname}:4985/{db}/_session Request samples Content typeapplication/json {"name": "string", "ttl": 0 } Response samples Content typeapplication/json {"session_id": "c5af80a039db4ed9d2b6865576b6999935282689", "expires": "2022-01-21T15:24:44Z", "cookie_name": "SyncGatewaySession" }/{db}/_session path Parameters| db required | string Example: db1 The name of the database to run the operation against.
+ |
Responses404 Resource could not be found
+ head/{db}/_session{protocol}://{hostname}:4985/{db}/_session Response samples Content typeapplication/json Get session information Retrieve session information such as the user the session belongs too and what channels that user can access.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Retrieve session information such as the user the session belongs too and what channels that user can access.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- | | sessionid required | string The ID of the session to target.
- |
Responses200 Properties associated with a user session
- 404 Resource could not be found
- get/{db}/_session/{sessionid}{protocol}://{hostname}:4985/{db}/_session/{sessionid} Response samples Content typeapplication/json Copy Expand all Collapse all {"authentication_handlers": [], "ok": true, "userCtx": {"channels": { }, "name": "string" } }Remove session path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ | | sessionid required | string The ID of the session to target.
+ |
Responses200 Properties associated with a user session
+ 404 Resource could not be found
+ get/{db}/_session/{sessionid}{protocol}://{hostname}:4985/{db}/_session/{sessionid} Response samples Content typeapplication/json Copy Expand all Collapse all {"authentication_handlers": [], "ok": true, "userCtx": {"channels": { }, "name": "string" } }Remove session Invalidates the session provided so that anyone using it is logged out and is prevented from future use.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Invalidates the session provided so that anyone using it is logged out and is prevented from future use.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- | | sessionid required | string The ID of the session to target.
- |
Responses200 Successfully removed the user session
- 404 Resource could not be found
- delete/{db}/_session/{sessionid}{protocol}://{hostname}:4985/{db}/_session/{sessionid} Response samples Content typeapplication/json Remove all of a users sessions path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ | | sessionid required | string The ID of the session to target.
+ |
Responses200 Successfully removed the user session
+ 404 Resource could not be found
+ delete/{db}/_session/{sessionid}{protocol}://{hostname}:4985/{db}/_session/{sessionid} Response samples Content typeapplication/json Remove all of a users sessions Invalidates all the sessions that a user has.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Invalidates all the sessions that a user has.
Will still return a 200 status code if the user has no sessions.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- | | name required | |
Responses200 User now has no sessions
- 404 Resource could not be found
- delete/{db}/_user/{name}/_session{protocol}://{hostname}:4985/{db}/_user/{name}/_session Response samples Content typeapplication/json Remove session with user validation path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ | | name required | |
Responses200 User now has no sessions
+ 404 Resource could not be found
+ delete/{db}/_user/{name}/_session{protocol}://{hostname}:4985/{db}/_user/{name}/_session Response samples Content typeapplication/json Remove session with user validation Invalidates the session only if it belongs to the user.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Invalidates the session only if it belongs to the user.
Required Sync Gateway RBAC roles:
- Sync Gateway Architect
- Sync Gateway Application
- path Parameters| db required | string Example: db1 The name of the database to run the operation against.
- | | name required | | | sessionid required | string The ID of the session to target.
- |
Responses200 Session has been successfully removed as the user was associated with the session
- 404 Resource could not be found
- delete/{db}/_user/{name}/_session/{sessionid}{protocol}://{hostname}:4985/{db}/_user/{name}/_session/{sessionid} Response samples Content typeapplication/json path Parameters | db required | string Example: db1 The name of the database to run the operation against.
+ | | name required | | | sessionid required | string The ID of the session to target.
+ |
Responses200 Session has been successfully removed as the user was associated with the session
+ 404 Resource could not be found
+ delete/{db}/_user/{name}/_session/{sessionid}{protocol}://{hostname}:4985/{db}/_user/{name}/_session/{sessionid} Response samples Content typeapplication/json Create and manage documents and attachments
- Get a document with the corresponding metadata Get a document with the corresponding metadata Returns the a documents latest revision with its metadata.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Returns the a documents latest revision with its metadata.
Note: 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.
Required Sync Gateway RBAC roles:
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- | | docid required | string Example: doc1 The document ID to run the operation against.
- |
query Parameters| include_doc | string Include the body associated with the document.
- | | redact | boolean This redacts sensitive parts of the response. Cannot be used when include_docs=true
- |
Responses200 Document found successfully
- 400 There was a problem with your request
- 404 Resource could not be found
- get/{keyspace}/_raw/{docid}{protocol}://{hostname}:4985/{keyspace}/_raw/{docid} Response samples Content typeapplication/json Copy Expand all Collapse all /{keyspace}/_raw/{docid} | docid required | string Example: doc1 The document ID to run the operation against.
+ | |
query Parameters| include_doc | string Include the body associated with the document.
+ | | redact | boolean This redacts sensitive parts of the response. Cannot be used when include_docs=true
+ |
Responses200 Document found successfully
+ 400 There was a problem with your request
+ 404 Resource could not be found
+ get/{keyspace}/_raw/{docid}{protocol}://{hostname}:4985/{keyspace}/_raw/{docid} Response samples Content typeapplication/json Copy Expand all Collapse all /{keyspace}/_raw/{docid} Required Sync Gateway RBAC roles:
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Required Sync Gateway RBAC roles:
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- | | docid required | string Example: doc1 The document ID to run the operation against.
- |
Responses400 There was a problem with your request
- 404 Resource could not be found
- head/{keyspace}/_raw/{docid}{protocol}://{hostname}:4985/{keyspace}/_raw/{docid} Response samples Content typeapplication/json {"error": "string", "reason": "string" }Purge a document | docid required | string Example: doc1 The document ID to run the operation against.
+ | |
Responses400 There was a problem with your request
+ 404 Resource could not be found
+ head/{keyspace}/_raw/{docid}{protocol}://{hostname}:4985/{keyspace}/_raw/{docid} Response samples Content typeapplication/json {"error": "string", "reason": "string" }Purge a document The purge command provides a way to remove a document from the database. The operation removes all 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).
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> The purge command provides a way to remove a document from the database. The operation removes all 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).
When enable_shared_bucket_access is enabled, this endpoint removes the document and its associated extended attributes.
Required Sync Gateway RBAC roles:
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
Request Body schema: application/json| doc_id | Array of strings Items Value: "*" Request Body schema: application/json| doc_id | Array of strings Items Value: "*" The document ID to purge. The array must only be 1 element which is *.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The document ID to purge. The array must only be 1 element which is *.
All revisions will be permanently removed for that document.
- | | property name* additional property | Array of strings Items Value: "*" |
Responses200 Attempted documents purge. Check output to verify the documents that were purged. The document IDs will not be listed if they have not been purged (for example, due to no existing).
- 400 Bad request. This could be due to the documents listed in the request body not having the ["*"] value for each document ID.
- 404 Resource could not be found
- post/{keyspace}/_purge{protocol}://{hostname}:4985/{keyspace}/_purge Request samples Content typeapplication/json Example Copy Expand all Collapse all Response samples Content typeapplication/json Example Copy Expand all Collapse all Create a new document | property name* additional property | Array of strings Items Value: "*" | |
Responses200 Attempted documents purge. Check output to verify the documents that were purged. The document IDs will not be listed if they have not been purged (for example, due to no existing).
+ 400 Bad request. This could be due to the documents listed in the request body not having the ["*"] value for each document ID.
+ 404 Resource could not be found
+ post/{keyspace}/_purge{protocol}://{hostname}:4985/{keyspace}/_purge Request samples Content typeapplication/json Example Copy Expand all Collapse all Response samples Content typeapplication/json Example Copy Expand all Collapse all Create a new document Create a new document in the keyspace.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Create a new document in the keyspace.
This will generate a random document ID unless specified in the body.
A document can have a maximum size of 20MB.
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
query Parameters| roundtrip | boolean Block until document has been received by change cache
- |
Request Body schema: application/json| _id | string The ID of the document.
- | | _rev | string The revision of the document.
- | | _exp | string query Parameters | roundtrip | boolean Block until document has been received by change cache
+ |
Request Body schema: application/json| _id | string The ID of the document.
+ | | _rev | string The revision of the document.
+ | | _exp | string Expiry time after which the document will be purged. The expiration time is set and managed on the Couchbase Server document. The value can be specified in two ways; in ISO-8601 format, for example the 6th of July 2022 at 17:00 in the BST timezone would be 2016-07-06T17:00:00+01:00; it can also be specified as a numeric Couchbase Server expiry value. Couchbase Server expiry values are specified as Unix time, and if the desired TTL is below 30 days then it can also represent an interval in seconds from the current time (for example, a value of 5 will remove the document 5 seconds after it is written to Couchbase Server). The document expiration time is returned in the response of GET /{db}/{doc} when show_exp=true is included in the query.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> Expiry time after which the document will be purged. The expiration time is set and managed on the Couchbase Server document. The value can be specified in two ways; in ISO-8601 format, for example the 6th of July 2022 at 17:00 in the BST timezone would be 2016-07-06T17:00:00+01:00; it can also be specified as a numeric Couchbase Server expiry value. Couchbase Server expiry values are specified as Unix time, and if the desired TTL is below 30 days then it can also represent an interval in seconds from the current time (for example, a value of 5 will remove the document 5 seconds after it is written to Couchbase Server). The document expiration time is returned in the response of GET /{db}/{doc} when show_exp=true is included in the query.
As with the existing explicit purge mechanism, this applies only to the local database; it has nothing to do with replication. This expiration time is not propagated when the document is replicated. The purge of the document does not cause it to be deleted on any other database.
- | | _deleted | boolean Whether the document is a tombstone or not. If true, it is a tombstone.
- | | _revisions | | | _attachments | | | property name* additional property | |
Responses200 New document revision created successfully.
- 400 There was a problem with your request
- 404 Resource could not be found
- 409 Resource already exists under that name
- post/{keyspace}/{protocol}://{hostname}:4985/{keyspace}/ Request samples Content typeapplication/json Copy Expand all Collapse all {"_id": "string", "_rev": "string", "_exp": "string", "_deleted": true, } Response samples Content typeapplication/json {"id": "string", "ok": true, "rev": "string" }Gets all the documents in the database with the given parameters | _deleted | boolean Whether the document is a tombstone or not. If true, it is a tombstone.
+ | | | _revisions | | | _attachments | | | property name* additional property | |
Responses200 New document revision created successfully.
+ 400 There was a problem with your request
+ 404 Resource could not be found
+ 409 Resource already exists under that name
+ post/{keyspace}/{protocol}://{hostname}:4985/{keyspace}/ Request samples Content typeapplication/json Copy Expand all Collapse all {"_id": "string", "_rev": "string", "_exp": "string", "_deleted": true, } Response samples Content typeapplication/json {"id": "string", "ok": true, "rev": "string" }Gets all the documents in the database with the given parameters Returns all documents in the database based on the specified parameters.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Returns all documents in the database based on the specified parameters.
Required Sync Gateway RBAC roles:
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
query Parameters| include_docs | boolean Include the body associated with each document.
- | | channels | boolean Include the channels each document is part of that the calling user also has access too.
- | | access | boolean Include what user/roles that each document grants access too.
- | | revs | boolean Include all the revisions for each document under the _revisions property.
- | | update_seq | boolean Include the document sequence number update_seq property for each document.
- | | keys | Array of strings An array of document ID strings to filter by.
- | | startkey | string Return records starting with the specified key.
- | | endkey | string Stop returning records when this key is reached.
- | | limit | number This limits the number of result rows returned. Using a value of 0 has the same effect as the value 1.
- |
Responses200 Operation ran successfully
- 400 There was a problem with your request
- 404 Resource could not be found
- get/{keyspace}/_all_docs{protocol}://{hostname}:4985/{keyspace}/_all_docs Response samples Content typeapplication/json Copy Expand all Collapse all {"rows": [{"key": "string", "id": "string", } ], "total_rows": 0, "update_seq": 0 }Get all the documents in the database using a built-in view query Parameters | include_docs | boolean Include the body associated with each document.
+ | | channels | boolean Include the channels each document is part of that the calling user also has access too.
+ | | access | boolean Include what user/roles that each document grants access too.
+ | | revs | boolean Include all the revisions for each document under the _revisions property.
+ | | update_seq | boolean Include the document sequence number update_seq property for each document.
+ | | keys | Array of strings An array of document ID strings to filter by.
+ | | startkey | string Return records starting with the specified key.
+ | | endkey | string Stop returning records when this key is reached.
+ | | limit | number This limits the number of result rows returned. Using a value of 0 has the same effect as the value 1.
+ |
Responses200 Operation ran successfully
+ 400 There was a problem with your request
+ 404 Resource could not be found
+ get/{keyspace}/_all_docs{protocol}://{hostname}:4985/{keyspace}/_all_docs Response samples Content typeapplication/json Copy Expand all Collapse all {"rows": [{"key": "string", "id": "string", } ], "total_rows": 0, "update_seq": 0 }Get all the documents in the database using a built-in view Returns all documents in the database based on the specified parameters.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Returns all documents in the database based on the specified parameters.
Required Sync Gateway RBAC roles:
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
query Parameters| include_docs | boolean Include the body associated with each document.
- | | channels | boolean Include the channels each document is part of that the calling user also has access too.
- | | access | boolean Include what user/roles that each document grants access too.
- | | revs | boolean Include all the revisions for each document under the _revisions property.
- | | update_seq | boolean Include the document sequence number update_seq property for each document.
- | | startkey | string Return records starting with the specified key.
- | | endkey | string Stop returning records when this key is reached.
- | | limit | number This limits the number of result rows returned. Using a value of 0 has the same effect as the value 1.
- |
Request Body schema: application/json| keys required | Array of strings List of the documents to retrieve.
- |
Responses200 Operation ran successfully
- 400 There was a problem with your request
- 404 Resource could not be found
- post/{keyspace}/_all_docs{protocol}://{hostname}:4985/{keyspace}/_all_docs Request samples Content typeapplication/json Copy Expand all Collapse all Response samples Content typeapplication/json Copy Expand all Collapse all {"rows": [{"key": "string", "id": "string", } ], "total_rows": 0, "update_seq": 0 }/{db}/_all_docs query Parameters | include_docs | boolean Include the body associated with each document.
+ | | channels | boolean Include the channels each document is part of that the calling user also has access too.
+ | | access | boolean Include what user/roles that each document grants access too.
+ | | revs | boolean Include all the revisions for each document under the _revisions property.
+ | | update_seq | boolean Include the document sequence number update_seq property for each document.
+ | | startkey | string Return records starting with the specified key.
+ | | endkey | string Stop returning records when this key is reached.
+ | | limit | number This limits the number of result rows returned. Using a value of 0 has the same effect as the value 1.
+ |
Request Body schema: application/json| keys required | Array of strings List of the documents to retrieve.
+ |
Responses200 Operation ran successfully
+ 400 There was a problem with your request
+ 404 Resource could not be found
+ post/{keyspace}/_all_docs{protocol}://{hostname}:4985/{keyspace}/_all_docs Request samples Content typeapplication/json Copy Expand all Collapse all Response samples Content typeapplication/json Copy Expand all Collapse all {"rows": [{"key": "string", "id": "string", } ], "total_rows": 0, "update_seq": 0 }/{db}/_all_docs Required Sync Gateway RBAC roles:
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> Required Sync Gateway RBAC roles:
- Sync Gateway Application
- Sync Gateway Application Read Only
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
path Parameters | keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
The keyspace to run the operation against.
+" class="sc-faJlkc sc-fdduAw kOqeZB fOLHUk"> The keyspace to run the operation against.
A keyspace is a dot-separated string, comprised of a database name, and optionally a named scope and collection.
- |
query Parameters| include_docs | boolean Include the body associated with each document.
- | | channels | boolean Include the channels each document is part of that the calling user also has access too.
- | | access | boolean Include what user/roles that each document grants access too.
- | | revs | boolean Include all the revisions for each document under the _revisions property.
- | | update_seq | boolean Include the document sequence number update_seq property for each document.
- | | keys | Array of strings An array of document ID strings to filter by.
- | | startkey | string Return records starting with the specified key.
- | | endkey | string Stop returning records when this key is reached.
- | | limit | number This limits the number of result rows returned. Using a value of 0 has the same effect as the value 1.
- |
Responses400 There was a problem with your request
- 404 Resource could not be found
- head/{keyspace}/_all_docs{protocol}://{hostname}:4985/{keyspace}/_all_docs Response samples Content typeapplication/json {"error": "string", "reason": "string" }Bulk document operations query Parameters | include_docs | boolean Include the body associated with each document.
+ | | channels | boolean Include the channels each document is part of that the calling user also has access too.
+ | | access | boolean Include what user/roles that each document grants access too.
+ | | revs | boolean Include all the revisions for each document under the _revisions property.
+ | | update_seq | boolean Include the document sequence number update_seq property for each document.
+ | | keys | Array of strings An array of document ID strings to filter by.
+ | | startkey | string Return records starting with the specified key.
+ | | endkey | string Stop returning records when this key is reached.
+ | | limit | number This limits the number of result rows returned. Using a value of 0 has the same effect as the value 1.
+ |
Responses400 There was a problem with your request
+ 404 Resource could not be found
+ head/{keyspace}/_all_docs{protocol}://{hostname}:4985/{keyspace}/_all_docs Response samples Content typeapplication/json {"error": "string", "reason": "string" }Bulk document operations This will allow multiple documented to be created, updated or deleted in bulk.
+" class="sc-faJlkc sc-fdduAw kOqeZB hsvkLi"> This will allow multiple documented to be created, updated or deleted in bulk.
To create a new document, simply add the body in an object under docs. A doc ID will be generated by Sync Gateway unless _id is specified.
To update an existing document, provide the document ID (_id) and revision ID (_rev) as well as the new body values.
To delete an existing document, provide the document ID (_id), revision ID (_rev), and set the deletion flag (_deleted) to true.
@@ -2991,23 +2991,23 @@
- path Parameters| keyspace required | string Examples: - db1 - Default scope and collection
- db1.collection1 - Named collection within the default scope
- db1.scope1.collection1 - Fully-qualified scope and collection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|