Azure Cosmos DB Collections API

Document collections (containers)

Operations 4

GET /dbs/{dbId}/colls List collections in a database #
POST /dbs/{dbId}/colls Create a collection #
GET /dbs/{dbId}/colls/{collId} Get a collection #
DELETE /dbs/{dbId}/colls/{collId} Delete a collection #

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/azure-cosmos-db-collections-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

azure-cosmos-db-collections-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Azure Cosmos DB Data Plane REST Collections API
  version: '2018-12-31'
  description: 'Data-plane REST API for Azure Cosmos DB (SQL/Core API). Requests are sent to the

    per-account endpoint `https://{databaseaccount}.documents.azure.com` and authorized

    with a master key or resource token using HMAC-signed `Authorization` headers, or

    with a Microsoft Entra ID bearer token. The `x-ms-version` header selects the API

    version; the latest known version is used when omitted.

    '
  contact:
    name: Azure Cosmos DB REST API
    url: https://learn.microsoft.com/en-us/rest/api/cosmos-db/
servers:
- url: https://{databaseaccount}.documents.azure.com
  description: Cosmos DB account endpoint
  variables:
    databaseaccount:
      default: my-account
      description: Your Cosmos DB account name
tags:
- name: Collections
  description: Document collections (containers)
paths:
  /dbs/{dbId}/colls:
    parameters:
    - in: path
      name: dbId
      required: true
      schema:
        type: string
    get:
      summary: List collections in a database
      operationId: listCollections
      tags:
      - Collections
      responses:
        '200':
          description: Collections
          content:
            application/json:
              schema:
                type: object
                properties:
                  DocumentCollections:
                    type: array
                    items:
                      type: object
      security:
      - cosmosAuth: []
      - entra: []
    post:
      summary: Create a collection
      operationId: createCollection
      tags:
      - Collections
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - id
              properties:
                id:
                  type: string
                partitionKey:
                  type: object
                indexingPolicy:
                  type: object
      responses:
        '201':
          description: Collection created
          content:
            application/json:
              schema:
                type: object
      security:
      - cosmosAuth: []
      - entra: []
  /dbs/{dbId}/colls/{collId}:
    parameters:
    - in: path
      name: dbId
      required: true
      schema:
        type: string
    - in: path
      name: collId
      required: true
      schema:
        type: string
    get:
      summary: Get a collection
      operationId: getCollection
      tags:
      - Collections
      responses:
        '200':
          description: Collection
          content:
            application/json:
              schema:
                type: object
      security:
      - cosmosAuth: []
      - entra: []
    delete:
      summary: Delete a collection
      operationId: deleteCollection
      tags:
      - Collections
      responses:
        '204':
          description: Deleted
      security:
      - cosmosAuth: []
      - entra: []
components:
  securitySchemes:
    cosmosAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Cosmos DB master-key or resource-token HMAC signature. Format:

        `type=master&ver=1.0&sig=<base64-hmac-sha256>` (URL-encoded).

        See https://learn.microsoft.com/en-us/rest/api/cosmos-db/access-control-on-cosmosdb-resources

        '
    entra:
      type: oauth2
      description: Microsoft Entra ID OAuth 2.0 bearer token
      flows:
        clientCredentials:
          tokenUrl: https://login.microsoftonline.com/common/oauth2/v2.0/token
          scopes:
            https://cosmos.azure.com/.default: Cosmos DB data plane access