Couchbase Database Credentials API

Endpoints for managing database access credentials for clusters.

Documentation

Specifications

Other Resources

OpenAPI Specification

couchbase-database-credentials-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Couchbase Analytics Service REST Allowed CIDRs Database Credentials API
  description: The Couchbase Analytics Service REST API provides access to the Analytics service for running complex analytical queries on operational data without impacting performance of key-value operations. It supports SQL++ queries for analytics, management of links to external data sources, and configuration of user-defined libraries. The service enables real-time analytics on JSON data alongside transactional workloads.
  version: '7.6'
  contact:
    name: Couchbase Support
    url: https://support.couchbase.com
  termsOfService: https://www.couchbase.com/terms-of-use
servers:
- url: https://localhost:8095
  description: Analytics Service (default port)
- url: https://localhost:18095
  description: Analytics Service (SSL)
security:
- basicAuth: []
tags:
- name: Database Credentials
  description: Endpoints for managing database access credentials for clusters.
paths:
  /v4/organizations/{organizationId}/projects/{projectId}/clusters/{clusterId}/users:
    get:
      operationId: listDatabaseCredentials
      summary: List database credentials
      description: Returns the list of database access credentials configured for the specified cluster.
      tags:
      - Database Credentials
      parameters:
      - $ref: '#/components/parameters/organizationId'
      - $ref: '#/components/parameters/projectId'
      - $ref: '#/components/parameters/clusterId'
      responses:
        '200':
          description: Successful retrieval of database credentials
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/DatabaseCredential'
        '401':
          description: Unauthorized access
        '429':
          description: Rate limit exceeded
    post:
      operationId: createDatabaseCredential
      summary: Create database credentials
      description: Creates new database access credentials for the specified cluster.
      tags:
      - Database Credentials
      parameters:
      - $ref: '#/components/parameters/organizationId'
      - $ref: '#/components/parameters/projectId'
      - $ref: '#/components/parameters/clusterId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatabaseCredentialCreateRequest'
      responses:
        '201':
          description: Database credentials created successfully
        '400':
          description: Invalid credentials configuration
        '401':
          description: Unauthorized access
        '429':
          description: Rate limit exceeded
components:
  parameters:
    projectId:
      name: projectId
      in: path
      required: true
      description: The UUID of the project
      schema:
        type: string
        format: uuid
    clusterId:
      name: clusterId
      in: path
      required: true
      description: The UUID of the cluster
      schema:
        type: string
        format: uuid
    organizationId:
      name: organizationId
      in: path
      required: true
      description: The UUID of the organization
      schema:
        type: string
        format: uuid
  schemas:
    DatabaseCredential:
      type: object
      description: Database access credential
      properties:
        id:
          type: string
          format: uuid
          description: Credential UUID
        name:
          type: string
          description: Credential name
        access:
          type: array
          description: Access privileges
          items:
            type: object
            properties:
              privileges:
                type: array
                items:
                  type: string
                  enum:
                  - data_reader
                  - data_writer
              resources:
                type: object
                properties:
                  buckets:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        scopes:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                              collections:
                                type: array
                                items:
                                  type: string
        audit:
          $ref: '#/components/schemas/AuditInfo'
    AuditInfo:
      type: object
      description: Audit timestamps
      properties:
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
        modifiedAt:
          type: string
          format: date-time
          description: Last modification timestamp
        createdBy:
          type: string
          description: User who created the resource
        modifiedBy:
          type: string
          description: User who last modified the resource
        version:
          type: integer
          description: Resource version number
    DatabaseCredentialCreateRequest:
      type: object
      description: Request to create database credentials
      required:
      - name
      - password
      - access
      properties:
        name:
          type: string
          description: Credential name
        password:
          type: string
          description: Credential password (must meet complexity requirements)
        access:
          type: array
          description: Access privileges to assign
          items:
            type: object
            properties:
              privileges:
                type: array
                items:
                  type: string
                  enum:
                  - data_reader
                  - data_writer
              resources:
                type: object
                properties:
                  buckets:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic Authentication using Couchbase Server credentials.
externalDocs:
  description: Couchbase Analytics Service REST API Documentation
  url: https://docs.couchbase.com/server/current/analytics/rest-analytics.html