Snowflake Alert API

The Snowflake Alert API is a REST API that you can use to access, update, and perform certain actions on Alert resource in a Snowflake database.

OpenAPI Specification

alert.yaml Raw ↑
openapi: 3.0.0
servers:
- description: Snowflake REST Server
  url: https://org-account.snowflakecomputing.com
info:
  version: 0.0.1
  title: Snowflake Alert API
  description: The Snowflake Alert API is a REST API that you can use to access, update, and perform certain actions on Alert resource in a Snowflake database.
  contact:
    name: Snowflake, Inc.
    url: https://snowflake.com
    email: support@snowflake.com
paths:
  /api/v2/databases/{database}/schemas/{schema}/alerts:
    get:
      summary: List Alerts
      tags:
      - alert
      description: List alerts
      operationId: listAlerts
      parameters:
      - $ref: common.yaml#/components/parameters/database
      - $ref: common.yaml#/components/parameters/schema
      - $ref: common.yaml#/components/parameters/like
      - $ref: common.yaml#/components/parameters/startsWith
      - $ref: common.yaml#/components/parameters/showLimit
      - $ref: common.yaml#/components/parameters/fromName
      responses:
        '200':
          description: successful
          headers:
            X-Snowflake-Request-ID:
              $ref: common.yaml#/components/headers/X-Snowflake-Request-ID
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Alert'
              examples:
                Listalerts200Example:
                  summary: Default listAlerts 200 response
                  x-microcks-default: true
                  value:
                  - name: Example Title
                    comment: example_value
                    schedule:
                      schedule_type: example_value
                    warehouse: example_value
                    condition: example_value
                    action: example_value
                    created_on: '2026-01-15T10:30:00Z'
                    database_name: example_value
                    schema_name: example_value
                    owner: example_value
                    owner_role_type: example_value
                    state: example_value
        '202':
          $ref: common.yaml#/components/responses/202SuccessAcceptedResponse
        '400':
          $ref: common.yaml#/components/responses/400BadRequest
        '401':
          $ref: common.yaml#/components/responses/401Unauthorized
        '403':
          $ref: common.yaml#/components/responses/403Forbidden
        '404':
          $ref: common.yaml#/components/responses/404NotFound
        '405':
          $ref: common.yaml#/components/responses/405MethodNotAllowed
        '408':
          $ref: common.yaml#/components/responses/408RequestTimeout
        '409':
          $ref: common.yaml#/components/responses/409Conflict
        '410':
          $ref: common.yaml#/components/responses/410Gone
        '429':
          $ref: common.yaml#/components/responses/429LimitExceeded
        '500':
          $ref: common.yaml#/components/responses/500InternalServerError
        '503':
          $ref: common.yaml#/components/responses/503ServiceUnavailable
        '504':
          $ref: common.yaml#/components/responses/504GatewayTimeout
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      summary: Create an Alert
      tags:
      - alert
      description: Create an alert
      operationId: createAlert
      parameters:
      - $ref: common.yaml#/components/parameters/database
      - $ref: common.yaml#/components/parameters/schema
      - $ref: common.yaml#/components/parameters/createMode
      responses:
        '200':
          $ref: common.yaml#/components/responses/200SuccessResponse
        '202':
          $ref: common.yaml#/components/responses/202SuccessAcceptedResponse
        '400':
          $ref: common.yaml#/components/responses/400BadRequest
        '401':
          $ref: common.yaml#/components/responses/401Unauthorized
        '403':
          $ref: common.yaml#/components/responses/403Forbidden
        '404':
          $ref: common.yaml#/components/responses/404NotFound
        '405':
          $ref: common.yaml#/components/responses/405MethodNotAllowed
        '408':
          $ref: common.yaml#/components/responses/408RequestTimeout
        '409':
          $ref: common.yaml#/components/responses/409Conflict
        '410':
          $ref: common.yaml#/components/responses/410Gone
        '429':
          $ref: common.yaml#/components/responses/429LimitExceeded
        '500':
          $ref: common.yaml#/components/responses/500InternalServerError
        '503':
          $ref: common.yaml#/components/responses/503ServiceUnavailable
        '504':
          $ref: common.yaml#/components/responses/504GatewayTimeout
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Alert'
            examples:
              CreatealertRequestExample:
                summary: Default createAlert request
                x-microcks-default: true
                value:
                  name: Example Title
                  comment: example_value
                  schedule:
                    schedule_type: example_value
                  warehouse: example_value
                  condition: example_value
                  action: example_value
                  created_on: '2026-01-15T10:30:00Z'
                  database_name: example_value
                  schema_name: example_value
                  owner: example_value
                  owner_role_type: example_value
                  state: example_value
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /api/v2/databases/{database}/schemas/{schema}/alerts/{name}:
    get:
      summary: Fetch an Alert
      tags:
      - alert
      description: Fetch an alert
      operationId: fetchAlert
      parameters:
      - $ref: common.yaml#/components/parameters/database
      - $ref: common.yaml#/components/parameters/schema
      - $ref: common.yaml#/components/parameters/name
      responses:
        '200':
          description: successful
          headers:
            X-Snowflake-Request-ID:
              $ref: common.yaml#/components/headers/X-Snowflake-Request-ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
              examples:
                Fetchalert200Example:
                  summary: Default fetchAlert 200 response
                  x-microcks-default: true
                  value:
                    name: Example Title
                    comment: example_value
                    schedule:
                      schedule_type: example_value
                    warehouse: example_value
                    condition: example_value
                    action: example_value
                    created_on: '2026-01-15T10:30:00Z'
                    database_name: example_value
                    schema_name: example_value
                    owner: example_value
                    owner_role_type: example_value
                    state: example_value
        '202':
          $ref: common.yaml#/components/responses/202SuccessAcceptedResponse
        '400':
          $ref: common.yaml#/components/responses/400BadRequest
        '401':
          $ref: common.yaml#/components/responses/401Unauthorized
        '403':
          $ref: common.yaml#/components/responses/403Forbidden
        '404':
          $ref: common.yaml#/components/responses/404NotFound
        '405':
          $ref: common.yaml#/components/responses/405MethodNotAllowed
        '408':
          $ref: common.yaml#/components/responses/408RequestTimeout
        '409':
          $ref: common.yaml#/components/responses/409Conflict
        '410':
          $ref: common.yaml#/components/responses/410Gone
        '429':
          $ref: common.yaml#/components/responses/429LimitExceeded
        '500':
          $ref: common.yaml#/components/responses/500InternalServerError
        '503':
          $ref: common.yaml#/components/responses/503ServiceUnavailable
        '504':
          $ref: common.yaml#/components/responses/504GatewayTimeout
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: Delete an Alert
      tags:
      - alert
      description: Delete an alert
      operationId: deleteAlert
      parameters:
      - $ref: common.yaml#/components/parameters/database
      - $ref: common.yaml#/components/parameters/schema
      - $ref: common.yaml#/components/parameters/name
      - $ref: common.yaml#/components/parameters/ifExists
      responses:
        '200':
          $ref: common.yaml#/components/responses/200SuccessResponse
        '202':
          $ref: common.yaml#/components/responses/202SuccessAcceptedResponse
        '400':
          $ref: common.yaml#/components/responses/400BadRequest
        '401':
          $ref: common.yaml#/components/responses/401Unauthorized
        '403':
          $ref: common.yaml#/components/responses/403Forbidden
        '404':
          $ref: common.yaml#/components/responses/404NotFound
        '405':
          $ref: common.yaml#/components/responses/405MethodNotAllowed
        '408':
          $ref: common.yaml#/components/responses/408RequestTimeout
        '409':
          $ref: common.yaml#/components/responses/409Conflict
        '410':
          $ref: common.yaml#/components/responses/410Gone
        '429':
          $ref: common.yaml#/components/responses/429LimitExceeded
        '500':
          $ref: common.yaml#/components/responses/500InternalServerError
        '503':
          $ref: common.yaml#/components/responses/503ServiceUnavailable
        '504':
          $ref: common.yaml#/components/responses/504GatewayTimeout
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /api/v2/databases/{database}/schemas/{schema}/alerts/{name}:clone:
    post:
      summary: Create a New Alert by Cloning From the Specified Resource
      tags:
      - alert
      description: Create a new alert by cloning from the specified resource
      operationId: cloneAlert
      parameters:
      - $ref: common.yaml#/components/parameters/database
      - $ref: common.yaml#/components/parameters/schema
      - $ref: common.yaml#/components/parameters/name
      - $ref: common.yaml#/components/parameters/createMode
      - name: targetDatabase
        description: Database of the newly created resource. Defaults to the source's database
        in: query
        required: true
        schema:
          type: string
        example: example_value
      - name: targetSchema
        description: Schema of the newly created resource. Defaults to the source's schema
        in: query
        required: true
        schema:
          type: string
        example: example_value
      responses:
        '200':
          $ref: common.yaml#/components/responses/200SuccessResponse
        '202':
          $ref: common.yaml#/components/responses/202SuccessAcceptedResponse
        '400':
          $ref: common.yaml#/components/responses/400BadRequest
        '401':
          $ref: common.yaml#/components/responses/401Unauthorized
        '403':
          $ref: common.yaml#/components/responses/403Forbidden
        '404':
          $ref: common.yaml#/components/responses/404NotFound
        '405':
          $ref: common.yaml#/components/responses/405MethodNotAllowed
        '408':
          $ref: common.yaml#/components/responses/408RequestTimeout
        '409':
          $ref: common.yaml#/components/responses/409Conflict
        '410':
          $ref: common.yaml#/components/responses/410Gone
        '429':
          $ref: common.yaml#/components/responses/429LimitExceeded
        '500':
          $ref: common.yaml#/components/responses/500InternalServerError
        '503':
          $ref: common.yaml#/components/responses/503ServiceUnavailable
        '504':
          $ref: common.yaml#/components/responses/504GatewayTimeout
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertClone'
            examples:
              ClonealertRequestExample:
                summary: Default cloneAlert request
                x-microcks-default: true
                value:
                  name: Example Title
                  point_of_time:
                    point_of_time_type: example_value
                    reference: at
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /api/v2/databases/{database}/schemas/{schema}/alerts/{name}:execute:
    post:
      summary: Execute an Alert
      tags:
      - alert
      description: Execute an alert
      operationId: executeAlert
      parameters:
      - $ref: common.yaml#/components/parameters/database
      - $ref: common.yaml#/components/parameters/schema
      - $ref: common.yaml#/components/parameters/name
      responses:
        '200':
          $ref: common.yaml#/components/responses/200SuccessResponse
        '202':
          $ref: common.yaml#/components/responses/202SuccessAcceptedResponse
        '400':
          $ref: common.yaml#/components/responses/400BadRequest
        '401':
          $ref: common.yaml#/components/responses/401Unauthorized
        '403':
          $ref: common.yaml#/components/responses/403Forbidden
        '404':
          $ref: common.yaml#/components/responses/404NotFound
        '405':
          $ref: common.yaml#/components/responses/405MethodNotAllowed
        '408':
          $ref: common.yaml#/components/responses/408RequestTimeout
        '409':
          $ref: common.yaml#/components/responses/409Conflict
        '410':
          $ref: common.yaml#/components/responses/410Gone
        '429':
          $ref: common.yaml#/components/responses/429LimitExceeded
        '500':
          $ref: common.yaml#/components/responses/500InternalServerError
        '503':
          $ref: common.yaml#/components/responses/503ServiceUnavailable
        '504':
          $ref: common.yaml#/components/responses/504GatewayTimeout
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    Alert:
      type: object
      description: A Snowflake alert
      properties:
        name:
          type: string
          description: Name of the alert
          example: Example Title
        comment:
          type: string
          description: user comment associated to an object in the dictionary
          example: example_value
        schedule:
          $ref: '#/components/schemas/Schedule'
          description: The schedule the alert runs under
        warehouse:
          type: string
          description: The warehouse the alert runs in
          example: example_value
        condition:
          type: string
          description: The SQL statement that must be evaluated to determine whether to trigger the alert
          example: example_value
        action:
          type: string
          description: The SQL statement to execute when the alert is triggered
          example: example_value
        created_on:
          type: string
          format: date-time
          readOnly: true
          description: Date and time when the alert was created.
          example: '2026-01-15T10:30:00Z'
        database_name:
          type: string
          readOnly: true
          description: Database in which the alert is stored
          example: example_value
        schema_name:
          type: string
          readOnly: true
          description: Schema in which the alert is stored
          example: example_value
        owner:
          type: string
          readOnly: true
          description: Role that owns the alert
          example: example_value
        owner_role_type:
          type: string
          readOnly: true
          description: The type of role that owns the alert
          example: example_value
        state:
          type: string
          readOnly: true
          description: The current state of the alert
          example: example_value
      required:
      - name
      - schedule
      - condition
      - action
    Schedule:
      type: object
      properties:
        schedule_type:
          type: string
          description: Type of the schedule, can be either CRON_TYPE or MINUTES_TYPE
          example: example_value
      required:
      - schedule_type
      discriminator:
        propertyName: schedule_type
        mapping:
          CRON_TYPE: CronSchedule
          SCHEDULE_TYPE: MinutesSchedule
    CronSchedule:
      type: object
      allOf:
      - $ref: '#/components/schemas/Schedule'
      properties:
        cron_expr:
          type: string
          description: A cron expression for the scheduled execution.
          example: example_value
        timezone:
          type: string
          description: The time zone for the schedule.
          example: example_value
      required:
      - cron_expr
      - timezone
    MinutesSchedule:
      type: object
      allOf:
      - $ref: '#/components/schemas/Schedule'
      properties:
        minutes:
          type: integer
          example: 10
      required:
      - minutes
    AlertClone:
      type: object
      properties:
        name:
          type: string
          description: Name of the alert
          example: Example Title
        point_of_time:
          $ref: '#/components/schemas/PointOfTime'
          description: 'Type of the point of time. Possible values include:


            - `timestamp`: Exact time using the standard timezone format. Example: `2023-09-15 10:59:43`.

            - `offset`: Interval relative to ''now.'' Example: `1 day`.

            - `statement`: ID of a query statement to use as the reference point for <a href=https://docs.snowflake.com/en/sql-reference/sql/create-clone#time-travel-parameters>Time Travel</a>.


            For more information, see https://docs.snowflake.com/en/sql-reference/data-types-datetime.

            '
      required:
      - name
    PointOfTime:
      type: object
      properties:
        point_of_time_type:
          type: string
          description: 'Type of the point of time. Possible values include: timestamp, offset, statement'
          example: example_value
        reference:
          type: string
          enum:
          - at
          - before
          x-enum-varnames:
          - AT
          - BEFORE
          description: Relation to the point of time.  Currently, the API supports `at` and `before`
          example: at
      required:
      - point_of_time_type
      - reference
      discriminator:
        propertyName: point_of_time_type
        mapping:
          timestamp: PointOfTimeTimestamp
          offset: PointOfTimeOffset
          statement: PointOfTimeStatement
    PointOfTimeTimestamp:
      type: object
      allOf:
      - $ref: '#/components/schemas/PointOfTime'
      properties:
        timestamp:
          type: string
          description: Timestamp of the point of time.
          example: example_value
      required:
      - timestamp
    PointOfTimeOffset:
      type: object
      allOf:
      - $ref: '#/components/schemas/PointOfTime'
      properties:
        offset:
          type: string
          description: Point of time identified by an offset in reference to the current time, such as `10 min`.
          example: example_value
      required:
      - offset
    PointOfTimeStatement:
      type: object
      allOf:
      - $ref: '#/components/schemas/PointOfTime'
      properties:
        statement:
          type: string
          description: Statement of the point of time.
          example: example_value
      required:
      - statement
  securitySchemes:
    KeyPair:
      $ref: common.yaml#/components/securitySchemes/KeyPair
    ExternalOAuth:
      $ref: common.yaml#/components/securitySchemes/ExternalOAuth
    SnowflakeOAuth:
      $ref: common.yaml#/components/securitySchemes/SnowflakeOAuth
security:
- KeyPair: []
- ExternalOAuth: []
- SnowflakeOAuth: []