Couchbase Local Documents API

Endpoints for managing local documents used by replication checkpoints.

Documentation

Specifications

Other Resources

OpenAPI Specification

couchbase-local-documents-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Couchbase Analytics Service REST Allowed CIDRs Local Documents 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: Local Documents
  description: Endpoints for managing local documents used by replication checkpoints.
paths:
  /{db}/_local/{localDocId}:
    get:
      operationId: getLocalDocument
      summary: Get a local document
      description: Retrieves a local document. Local documents are not replicated and are used internally for replication checkpoints.
      tags:
      - Local Documents
      parameters:
      - $ref: '#/components/parameters/db'
      - name: localDocId
        in: path
        required: true
        description: Local document ID
        schema:
          type: string
      responses:
        '200':
          description: Successful retrieval of local document
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized access
        '404':
          description: Local document not found
    put:
      operationId: putLocalDocument
      summary: Create or update a local document
      description: Creates or updates a local document. Local documents are not replicated and are used for replication checkpoints.
      tags:
      - Local Documents
      parameters:
      - $ref: '#/components/parameters/db'
      - name: localDocId
        in: path
        required: true
        description: Local document ID
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
      responses:
        '200':
          description: Local document saved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentWriteResponse'
        '401':
          description: Unauthorized access
        '409':
          description: Conflict
    delete:
      operationId: deleteLocalDocument
      summary: Delete a local document
      description: Deletes a local document.
      tags:
      - Local Documents
      parameters:
      - $ref: '#/components/parameters/db'
      - name: localDocId
        in: path
        required: true
        description: Local document ID
        schema:
          type: string
      - name: rev
        in: query
        required: true
        description: Current revision of the local document
        schema:
          type: string
      responses:
        '200':
          description: Local document deleted successfully
        '401':
          description: Unauthorized access
        '404':
          description: Local document not found
components:
  schemas:
    DocumentWriteResponse:
      type: object
      description: Response from a document write operation
      properties:
        id:
          type: string
          description: Document ID
        rev:
          type: string
          description: New revision ID
        ok:
          type: boolean
          description: Whether the operation succeeded
  parameters:
    db:
      name: db
      in: path
      required: true
      description: The database name
      schema:
        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