REST API reference

    The REST API supports the management of Couchbase-Server clusters.

    The REST API supports the management of Couchbase-Server clusters. This includes cluster-creation and the definition of nodes, services, and server groups. The API also supports the extensive retrieval of statistics.

    This page provides a complete list of HTTP methods and URIs. It also lists HTTP Request Headers and HTTP Response Codes.

    Nodes and Clusters API

    The Cluster API provides support for managing and retrieving information about clusters. It also provides support for managing rebalance, failover, and server group awareness. The APIs for each area are assigned a table, below.

    Cluster Initialization and Provisioning

    HTTP Method URI Documented at

    POST

    /clusterInit

    Initialize a Cluster

    POST

    /nodes/self/controller/settings

    Initializing a Node

    POST

    /settings/web

    Establishing Credentials

    POST

    /node/controller/rename

    Naming a Node

    POST

    /pools/default

    Configuring Memory

    POST

    /node/controller/setupServices

    Assigning Services

    POST

    /pools/default

    Naming a Cluster

    Node Addition and Removal

    HTTP Method URI Documented at

    POST

    /controller/addNode

    Adding Nodes to Clusters

    POST

    /node/controller/doJoinCluster

    Joining Nodes to Clusters

    POST

    /controller/ejectNode

    Removing Nodes from Clusters

    Rebalance

    HTTP Method URI Documented at

    POST

    /controller/rebalance

    Rebalancing the Cluster

    GET

    /pools/default

    Getting Rebalance Reason Codes

    GET

    /pools/default/rebalanceProgress

    Getting Rebalance Progress

    GET

    /pools/default/retryRebalance

    Configuring Rebalance Retries

    POST

    /pools/default/retryRebalance

    Configuring Rebalance Retries

    GET

    /pools/default/pendingRetryRebalance

    Getting Rebalance-Retry Status

    POST

    /controller/cancelRebalanceRetry/<rebalance-id>

    Canceling Rebalance Retries

    GET

    /settings/rebalance

    Limiting Concurrent vBucket Moves

    POST

    /settings/rebalance

    Limiting Concurrent vBucket Moves

    POST

    /internalSettings

    Disabling Consistent View Query Results on Rebalance

    Manual-Failover

    HTTP Method URI Documented at

    POST

    /controller/failOver

    Performing Hard Failover

    POST

    /controller/startGracefulFailover

    Performing Graceful Failover

    POST

    /controller/setRecoveryType

    Setting Recovery Type

    Auto-Failover

    HTTP Method URI Documented at

    GET

    /settings/autoFailover

    Retrieving Auto-Failover Settings

    POST

    /settings/autoFailover

    Enabling and Disabling Auto-Failover

    POST

    /settings/autoFailover/resetCount

    Resetting Auto-Failover

    POST

    /controller/setRecoveryType

    Setting Recovery Type

    Settings and Connections

    HTTP Method URI Documented at

    GET

    /internalSettings

    Managing Internal Settings

    POST

    /internalSettings

    Managing Internal Settings

    GET

    /settings/maxParallelIndexers

    Managing Internal Settings

    POST

    /settings/maxParallelIndexers

    Managing Internal Settings

    GET

    /pools/default/settings/memcached/global

    Managing Cluster Connections

    POST

    /pools/default/settings/memcached/global

    Managing Cluster Connections

    PUT

    /node/controller/setupAlternateAddresses/external

    Managing Alternate Addresses

    DELETE

    /node/controller/setupAlternateAddresses/external

    Managing Alternate Addresses

    GET

    /settings/alerts

    Getting Alert Settings

    POST

    /settings/alerts

    Enabling and Disabling Email Notifications

    POST

    /settings/alerts/sendTestEmail

    Sending Test Emails

    Status and Events

    HTTP Method URI Documented at

    GET

    /pools/default/tasks

    Getting Cluster Tasks

    GET

    /logs/rebalanceReport?reportID=<report-id>

    Getting Cluster Tasks

    GET

    /pools

    Retrieving Cluster Information

    GET

    /pools/default

    Viewing Cluster Details

    GET

    /events

    Getting System Events

    GET

    /eventsStreaming

    Getting System Events

    GET

    /pools/default/terseClusterInfo

    Identifying the Orchestrator Node

    GET

    /pools/nodes

    Getting information about Nodes

    GET

    /pools/default/nodeServices

    Listing Node Services

    Statistics

    HTTP Method URI Documented at

    GET

    /pools/default/stats/range/<metric_name>/[function-expression]

    Getting a Single Statistic

    POST

    /pools/default/stats/range

    Getting Multiple Statistics

    Logging

    HTTP Method URI Documented at

    POST

    /controller/startLogsCollection

    Collecting Logs

    POST

    /controller/cancelLogsCollection

    Collecting Logs

    GET

    /pools/default/tasks

    Getting Cluster Tasks

    GET

    /diag

    Retrieving Diagnostic and Log Information

    GET

    /sasl_logs

    Retrieving Diagnostic and Log Information

    POST

    /logClientError

    Logging Client-Side Errors

    Server Groups API

    Server Group Awareness provides enhanced availability. Specifically, it protects a cluster from large-scale infrastructure failure, through the definition of groups. Its REST API is expressed by the following table.

    HTTP Method URI Documented at

    GET

    /pools/default/serverGroups

    Getting Group Information

    POST

    /pools/default/serverGroups

    Creating Groups

    POST

    /pools/default/serverGroups/<:uuid>/addNode

    Adding Nodes to Groups

    PUT

    /pools/default/serverGroups/<:uuid>

    Renaming Groups

    PUT

    /pools/default/serverGroups?rev=<:number>

    Updating Group Membership

    DELETE

    /pools/default/serverGroups/<:uuid>

    Deleting Groups

    Security API

    The Security REST API provides the endpoints for general security, for authentication, and for authorization. These APIs are listed in the tables below.

    General Security

    HTTP Method URI Documented at

    GET

    ./whoami

    Who Am I?

    GET

    /settings/audit

    Configure Auditing

    POST

    /settings/audit

    Configure Auditing

    GET

    /settings/audit/descriptors

    Configure Auditing

    GET

    /settings/security

    Restrict Node-Addition

    POST

    /settings/security

    Restrict Node-Addition

    POST

    /clusterInit

    Initialize a Cluster

    GET

    /settings/security/[service-name]

    Configure On-the-Wire Security

    POST

    /settings/security/[service-name]

    Configure On-the-Wire Security

    POST

    /node/controller/rotateInternalCredentials

    Rotate Internal Credentials

    GET

    /settings/security/responseHeaders

    Configure HSTS

    POST

    /settings/security/responseHeaders

    Configure HSTS

    DELETE

    /settings/security/responseHeaders

    Configure HSTS

    Authentication

    HTTP Method URI Documented at

    GET

    /settings/ldap

    Configure LDAP

    POST

    /settings/ldap

    Configure LDAP

    GET

    /settings/saml

    Configure SAML

    POST

    /settings/saml

    Configure SAML

    GET

    /settings/saslauthdAuth

    Configure saslauthd

    POST

    /settings/saslauthdAuth

    Configure saslauthd

    GET

    /settings/passwordPolicy

    Set Password Policy

    POST

    /settings/passwordPolicy

    Set Password Policy

    POST

    /controller/changePassword

    Change Password

    POST

    /node/controller/loadTrustedCAs

    Load Root Certificates

    GET

    /node/controller/loadTrustedCAs

    Get Root Certificates

    DELETE

    /pools/default/trustedCAs/<id>

    Delete Root Certificates

    GET

    /pools/default/certificates

    Retrieve All Node Certificates

    POST

    /node/controller/reloadCertificate

    Upload and Retrieve Node Certificates

    GET

    /pools/default/certificate/node/<ip-address-or-domain-name>

    Upload and Retrieve Node Certificates

    POST

    /controller/regenerateCertificate

    Regenerate All Certificates

    Authorization

    HTTP Method URI Documented at

    GET

    /settings/rbac/roles

    List Roles

    GET

    /settings/rbac/users

    List Current Users and Their Roles

    POST

    /pools/default/checkPermissions

    Check Permissions

    GET

    /settings/rbac/groups

    List Currently Defined Groups

    PUT

    /settings/rbac/users/local/<new-username>

    Create a Local User

    PATCH

    /settings/rbac/users/local/<existing-username>

    Create a Local User

    PUT

    /settings/rbac/users/local/<new-username>

    Create an External User

    PUT

    /settings/rbac/groups/<new-groupname>

    Create a Group

    DELETE

    /settings/rbac/users/local/<local-username>

    Delete Users and Groups

    DELETE

    /settings/rbac/users/external/<external-username>

    Delete Users and Groups

    DELETE

    /settings/rbac/groups/<groupname>

    Delete Users and Groups

    System-Secrets Management

    HTTP Method URI Documented at

    GET

    /nodes/self/secretsManagement

    Configuring System Secrets

    POST

    /node/controller/secretsManagement

    Configuring System Secrets

    POST

    /node/controller/changeMasterPassword

    Changing the Master Password

    POST

    /node/controller/rotateDataKey

    Rotating the Data Key

    Analytics Service API

    The Analytics Service provides a REST API for querying, configuration, and the management of links and libraries. The API is listed in the following tables.

    Enterprise Analytics Service API

    HTTP Method URI Documented at

    POST

    /api/v1/request

    Request Service

    GET

    /api/v1/request

    Read-Only Request Service

    Enterprise Analytics Admin API

    HTTP Method URI Documented at

    GET

    /api/v1/active_requests

    Active Requests

    DELETE

    /api/v1/active_requests

    Request Cancellation

    GET

    /api/v1/completed_requests

    Completed Requests

    GET

    /api/v1/status/service

    Service Status

    POST

    /api/v1/service/restart

    Service Restart

    POST

    /api/v1/node/restart

    Node Restart

    GET

    /api/v1/status/ingestion

    Ingestion Status

    Enterprise Analytics Config API

    HTTP Method URI Documented at

    GET

    /api/v1/config/service

    View Service-Level Parameters

    PUT

    /api/v1/config/service

    Modify Service-Level Parameters

    GET

    /api/v1/config/node

    View Node-Specific Parameters

    PUT

    /api/v1/config/node

    Modify Node-Specific Parameters

    Enterprise Analytics Settings API

    HTTP Method URI Documented at

    GET

    /settings/analytics

    View Enterprise Analytics Settings

    POST

    /settings/analytics

    Modify Enterprise Analytics Settings

    HTTP Method URI Documented at

    POST

    /api/v1/link/{name}

    Create Link

    GET

    /api/v1/link/{name}

    Query Link

    PUT

    /api/v1/link/{name}

    Edit Link

    DELETE

    /api/v1/link/{name}

    Delete Link

    GET

    /api/v1/link

    Query All Links

    HTTP Request Headers

    The following HTTP request headers are used to create requests:

    Header Supported Values Description of Use Required

    Accept

    Comma-delimited list of media types or media type patterns.

    Indicates to the server what media type(s) this client is prepared to accept.

    Recommended

    Authorization

    Basic plus username and password (per RFC 2617).

    Identifies the authorized user making this request.

    No, unless secured

    Content-Length

    Body Length (in bytes)

    Describes the size of the message body.

    Yes, on requests that contain a message body.

    Content-Type

    Content type

    Describes the representation and syntax of the request message body.

    Yes, on requests that contain a message body.

    Host

    Origin host name

    Required to allow support of multiple origin hosts at a single IP address.

    All requests

    X-YYYYY-Client-Specification-Version

    String

    Declares the specification version of the YYYYY API that this client was programmed against.

    No

    HTTP Response Codes

    The Enterprise Analytics returns one of the following HTTP status codes in response to REST API requests:

    HTTP response Description

    200 OK

    Successful request and an HTTP response body returns. If this creates a new resource with a URI, the 200 status will also have a location header containing the canonical URI for the newly created resource.

    201 Created

    Request to create a new resource is successful, but no HTTP response body returns. The URI for the newly created resource returns with the status code.

    202 Accepted

    The request is accepted for processing, but processing is not complete. Per HTTP/1.1, the response, if any, SHOULD include an indication of the request’s current status, and either a pointer to a status monitor or some estimate of when the request will be fulfilled.

    204 No Content

    The server fulfilled the request, but does not need to return a response body.

    400 Bad Request

    The request could not be processed because it contains missing or invalid information, such as validation error on an input field, a missing required value, and so on.

    401 Unauthorized

    The credentials provided with this request are missing or invalid.

    403 Forbidden

    The server recognized the given credentials, but you do not possess proper access to perform this request.

    404 Not Found

    URI provided in a request does not exist.

    405 Method Not Allowed

    The HTTP verb specified in the request (DELETE, GET, HEAD, POST, PUT) is not supported for this URI.

    406 Not Acceptable

    The resource identified by this request cannot create a response corresponding to one of the media types in the Accept header of the request.

    409 Conflict

    A create or update request could not be completed, because it would cause a conflict in the current state of the resources supported by the server. For example, an attempt to create a new resource with a unique identifier already assigned to some existing resource.

    500 Internal Server Error

    The server encountered an unexpected condition which prevented it from fulfilling the request.

    501 Not Implemented

    The server does not currently support the functionality required to fulfill the request.

    503 Service Unavailable

    The server is currently unable to handle the request due to temporary overloading or maintenance of the server.