Microsoft Azure Stored Procedures API

Operations for managing stored procedures

GitHub OpenAPI

Operations 2

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /dbs/{databaseId}/colls/{containerId}/sprocs List stored procedures in a container · Microsoft Azure List Stored Procedures #
Ask an LLM
“Which stored procedures exist in my Cosmos DB container?”
“Can I list the server-side scripts registered on one container?”
Tell an agent
List stored procedures in container {container} of database {database}.
Show the stored procedures of container {container} in database {database} using API version {version}.
POST /dbs/{databaseId}/colls/{containerId}/sprocs Create a stored procedure in a container · Microsoft Azure Create a Stored Procedure #
Ask an LLM
“How do I add a new stored procedure to a Cosmos DB container?”
“What do I send as the body when registering a stored procedure script?”
Tell an agent
Create stored procedure {id} with script {script} in container {container} of database {database}.
Register sproc {id} running {script} on container {container}, database {database}, API version {version}.

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/microsoft-azure:microsoft-azure-stored-procedures-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

microsoft-azure-stored-procedures-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Microsoft Azure Azure Cosmos DB REST Stored Procedures API
  description: Azure Cosmos DB is a globally distributed, multi-model database service that provides turnkey global distribution, elastic scaling of throughput and storage, single-digit millisecond latency at the 99th percentile, and guaranteed high availability, all backed by industry-leading SLAs. The REST API enables programmatic access to Cosmos DB resources for creating, querying, and managing databases, containers, items, stored procedures, triggers, and user-defined functions.
  version: '2018-12-31'
  contact:
    name: Microsoft Azure Support
    url: https://azure.microsoft.com/en-us/support/
    email: azuresupport@microsoft.com
  license:
    name: Microsoft API License
    url: https://learn.microsoft.com/en-us/legal/
  x-logo:
    url: https://azure.microsoft.com/svghandler/azure-logo.png
servers:
- url: https://{accountName}.documents.azure.com
  description: Azure Cosmos DB account endpoint
  variables:
    accountName:
      default: mycosmosaccount
      description: The name of the Azure Cosmos DB account.
security:
- masterKey: []
- resourceToken: []
tags:
- name: Stored Procedures
  description: Operations for managing stored procedures
paths:
  /dbs/{databaseId}/colls/{containerId}/sprocs:
    get:
      operationId: StoredProcedures_List
      summary: Microsoft Azure List Stored Procedures
      description: Returns a list of stored procedures under the specified container.
      tags:
      - Stored Procedures
      parameters:
      - $ref: '#/components/parameters/DatabaseIdParameter'
      - $ref: '#/components/parameters/ContainerIdParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Successfully returned the list of stored procedures.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoredProcedureListResult'
              examples:
                StoredproceduresList200Example:
                  summary: Default StoredProcedures_List 200 response
                  x-microcks-default: true
                  value:
                    _rid: '500123'
                    StoredProcedures:
                    - id: abc123
                      body: example_value
                      _rid: '500123'
                      _ts: 10
                      _self: example_value
                      _etag: example_value
                    _count: 10
        default:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                StoredproceduresListdefaultExample:
                  summary: Default StoredProcedures_List default response
                  x-microcks-default: true
                  value:
                    code: example_value
                    message: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: StoredProcedures_Create
      summary: Microsoft Azure Create a Stored Procedure
      description: Creates a new stored procedure in the specified container.
      tags:
      - Stored Procedures
      parameters:
      - $ref: '#/components/parameters/DatabaseIdParameter'
      - $ref: '#/components/parameters/ContainerIdParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoredProcedureCreateRequest'
            examples:
              StoredproceduresCreateRequestExample:
                summary: Default StoredProcedures_Create request
                x-microcks-default: true
                value:
                  id: abc123
                  body: example_value
      responses:
        '201':
          description: Successfully created the stored procedure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoredProcedure'
              examples:
                StoredproceduresCreate201Example:
                  summary: Default StoredProcedures_Create 201 response
                  x-microcks-default: true
                  value:
                    id: abc123
                    body: example_value
                    _rid: '500123'
                    _ts: 10
                    _self: example_value
                    _etag: example_value
        default:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                StoredproceduresCreatedefaultExample:
                  summary: Default StoredProcedures_Create default response
                  x-microcks-default: true
                  value:
                    code: example_value
                    message: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    StoredProcedureListResult:
      type: object
      description: List of Cosmos DB stored procedures.
      properties:
        _rid:
          type: string
          readOnly: true
          example: '500123'
        StoredProcedures:
          type: array
          items:
            $ref: '#/components/schemas/StoredProcedure'
          description: List of stored procedures.
          example: []
        _count:
          type: integer
          readOnly: true
          example: 10
    StoredProcedureCreateRequest:
      type: object
      description: Request body for creating a stored procedure.
      properties:
        id:
          type: string
          description: The unique name of the stored procedure.
          example: abc123
        body:
          type: string
          description: The body of the stored procedure (JavaScript function).
          example: example_value
      required:
      - id
      - body
    ErrorResponse:
      type: object
      description: Error response from Cosmos DB.
      properties:
        code:
          type: string
          description: The error code.
          example: example_value
        message:
          type: string
          description: The error message.
          example: example_value
      required:
      - code
      - message
    StoredProcedure:
      type: object
      description: A Cosmos DB stored procedure.
      properties:
        id:
          type: string
          description: The unique name of the stored procedure.
          example: abc123
        body:
          type: string
          description: The body of the stored procedure (JavaScript function).
          example: example_value
        _rid:
          type: string
          readOnly: true
          example: '500123'
        _ts:
          type: integer
          readOnly: true
          example: 10
        _self:
          type: string
          readOnly: true
          example: example_value
        _etag:
          type: string
          readOnly: true
          example: example_value
      required:
      - id
      - body
  parameters:
    ApiVersionParameter:
      name: x-ms-version
      in: header
      required: true
      description: The version of the Cosmos DB REST API.
      schema:
        type: string
        default: '2018-12-31'
    DatabaseIdParameter:
      name: databaseId
      in: path
      required: true
      description: The ID of the database.
      schema:
        type: string
    ContainerIdParameter:
      name: containerId
      in: path
      required: true
      description: The ID of the container (collection).
      schema:
        type: string
  securitySchemes:
    masterKey:
      type: apiKey
      name: Authorization
      in: header
      description: Cosmos DB master key authorization. The authorization token is a hash-based message authentication code (HMAC) constructed from the request using the master key.
    resourceToken:
      type: apiKey
      name: Authorization
      in: header
      description: Cosmos DB resource token for fine-grained access control to specific resources.