CosmosDB REST

Microsoft Documentation

Enumeration

Databases

URL: $base/dbs Resource Link: dbs Resource Type: dbs

Collections

URL: $base/dbs/<dbname>/colls Resource Link: dbs/<dbname> Resource Type: colls

Docs

URL: $base/dbs/<dbname>/colls/<coll-id>/docs Resource Link: dbs/<dbname>/colls/<coll-id> Resource Type: docs

Authentication

Resource Types

  • Database operations: dbs
  • Container operations: colls
  • Stored Procedures: sprocs
  • User Defined Functions: udfs
  • Triggers: triggers
  • Users: users
  • Permissions: permissions
  • Item level operations: docs
  • If the operation is performed against a specific resource then the value is the link to that resource. Examples:

    • For Get Database use: dbs/{databaseId}
    • For Get Document use: dbs/{databaseId}/colls/{containerId}/docs/{docId}
  • If the operation is performed against a set of resources (List, Create, Query) then the value is the link of the parent resource. Examples:

    • For Create Document use: dbs/{databaseId}/colls/{containerId}
    • For Create Stored Procedure use: dbs/{databaseId}/colls/{containerId}
    • For Create a Container use: dbs/{databaseId}
    • For Create Database use: "" an empty string since Databases do not have a parent resource