Cockroach Labs Service Accounts API

Manage service accounts used for machine-to-machine authentication within the organization.

Operations 5

GET /api/v1/service-accounts List service accounts #
POST /api/v1/service-accounts Create a service account #
GET /api/v1/service-accounts/{id} Get a service account #
PATCH /api/v1/service-accounts/{id} Update a service account #
DELETE /api/v1/service-accounts/{id} Delete a service account #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/cockroach-labs-service-accounts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

cockroach-labs-service-accounts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: CockroachDB Cloud Service Accounts API
  description: The CockroachDB Cloud API is a REST interface that provides programmatic access to manage the lifecycle of clusters within a CockroachDB Cloud organization.
  version: '2024-09-16'
  contact:
    name: Cockroach Labs Support
    url: https://support.cockroachlabs.com
  termsOfService: https://www.cockroachlabs.com/cloud-terms-and-conditions/
servers:
- url: https://cockroachlabs.cloud
  description: CockroachDB Cloud Production Server
security:
- bearerAuth: []
tags:
- name: Service Accounts
  description: Manage service accounts used for machine-to-machine authentication within the organization.
paths:
  /api/v1/service-accounts:
    get:
      operationId: ListServiceAccounts
      summary: List service accounts
      description: Returns a list of service accounts in the organization. Supports pagination.
      tags:
      - Service Accounts
      parameters:
      - $ref: '#/components/parameters/paginationPage'
      - $ref: '#/components/parameters/paginationLimit'
      - $ref: '#/components/parameters/paginationAsOfTime'
      - $ref: '#/components/parameters/paginationSortOrder'
      responses:
        '200':
          description: List of service accounts returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListServiceAccountsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: CreateServiceAccount
      summary: Create a service account
      description: Creates a new service account for machine-to-machine authentication. Requires ORG_ADMIN role.
      tags:
      - Service Accounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateServiceAccountRequest'
      responses:
        '200':
          description: Service account created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceAccount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /api/v1/service-accounts/{id}:
    get:
      operationId: GetServiceAccount
      summary: Get a service account
      description: Retrieves details of a specific service account by ID.
      tags:
      - Service Accounts
      parameters:
      - $ref: '#/components/parameters/resourceId'
      responses:
        '200':
          description: Service account retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceAccount'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: UpdateServiceAccount
      summary: Update a service account
      description: Updates the name or description of an existing service account. Requires ORG_ADMIN role.
      tags:
      - Service Accounts
      parameters:
      - $ref: '#/components/parameters/resourceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateServiceAccountSpecification'
      responses:
        '200':
          description: Service account updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceAccount'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: DeleteServiceAccount
      summary: Delete a service account
      description: Permanently deletes a service account by ID. All associated API keys are also revoked. Requires ORG_ADMIN role.
      tags:
      - Service Accounts
      parameters:
      - $ref: '#/components/parameters/resourceId'
      responses:
        '200':
          description: Service account deleted successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceAccount'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    BadRequest:
      description: The request body or parameters are invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication credentials are missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    paginationPage:
      name: pagination.page
      in: query
      description: Page number for paginated results, starting from 1.
      schema:
        type: string
    resourceId:
      name: id
      in: path
      required: true
      description: Unique identifier of the resource.
      schema:
        type: string
    paginationSortOrder:
      name: pagination.sort_order
      in: query
      description: Sort direction for paginated results. Accepted values are ASC and DESC.
      schema:
        type: string
        enum:
        - ASC
        - DESC
    paginationLimit:
      name: pagination.limit
      in: query
      description: Maximum number of results to return per page.
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 500
    paginationAsOfTime:
      name: pagination.as_of_time
      in: query
      description: RFC3339 timestamp to return results as they were at a specific point in time (time-travel query).
      schema:
        type: string
        format: date-time
  schemas:
    ServiceAccount:
      type: object
      description: A service account used for machine-to-machine authentication within a CockroachDB Cloud organization.
      properties:
        id:
          type: string
          description: Unique identifier of the service account.
        name:
          type: string
          description: Name of the service account.
        description:
          type: string
          description: Description of the service account's purpose.
        creator_id:
          type: string
          description: User ID of the account creator.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the service account was created.
    ListServiceAccountsResponse:
      type: object
      description: Paginated list of service accounts.
      properties:
        service_accounts:
          type: array
          description: Array of service account objects.
          items:
            $ref: '#/components/schemas/ServiceAccount'
        pagination:
          $ref: '#/components/schemas/PaginationResponse'
    PaginationResponse:
      type: object
      description: Pagination metadata included in list responses.
      properties:
        next:
          type: string
          description: Token or cursor for retrieving the next page of results.
        last:
          type: string
          description: Token or cursor for the last page of results.
        time:
          type: string
          format: date-time
          description: Server time at which the paginated query was executed.
    CreateServiceAccountRequest:
      type: object
      description: Request body for creating a new service account.
      required:
      - name
      properties:
        name:
          type: string
          description: Name for the new service account.
        description:
          type: string
          description: Optional description of the service account.
    UpdateServiceAccountSpecification:
      type: object
      description: Specification for updating a service account.
      properties:
        name:
          type: string
          description: New name for the service account.
        description:
          type: string
          description: New description for the service account.
    Error:
      type: object
      description: Standard error response returned by the API.
      properties:
        code:
          type: integer
          description: HTTP status code of the error.
        message:
          type: string
          description: Human-readable description of the error.
        details:
          type: array
          description: Additional detail objects providing error context.
          items:
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication. Generate a token in the CockroachDB Cloud Console under Organization Settings > API Access.
externalDocs:
  description: CockroachDB Cloud API Documentation
  url: https://www.cockroachlabs.com/docs/cockroachcloud/cloud-api