Create an alarm

POST /v2/Alarms
application/json

Body Required

  • friendlyName string Required

    Friendly name for alarm

  • queryType string Required

    Type of query

    Values are ERROR_CODE, LOG_LEVEL, or ALL.

  • query string

    Value to query for

  • triggerValue integer Required

    Threshold to send customer alarm notification

  • timeWindow string Required

    Time window for alarm to trigger

    Values are FIVE_MINS, FIFTEEN_MINS, ONE_HOUR, TWELVE_HOURS, or ONE_DAY.

  • email array[string]

    Email notifications to send

  • webhook string

    Webhook notification to send

  • consoleIndicator boolean

    Whether to send console notifications

  • description string Required

    Description for the alarm.

  • enabled boolean Required

    Is alarm enbled? Default is true.

    Default value is true.

Responses

  • 201 application/json

    Created

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attribute Show response attribute object
    • sid string

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AK[0-9a-fA-F]{32}$.

  • 400 application/json

    BAD REQUEST

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • message string

      Error message

    • code integer

      Twilio error code

    • user_error boolean

      Indicates if it was a user error

    • http_status_code integer

      Http error code returned

    • params object
      Hide params attribute Show params attribute object
      • * string Additional properties
    • more_info string

      More information link

    • status integer

      HTTP status code

  • 401 application/json

    UNAUTHORIZED

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • message string

      Error message

    • code integer

      Twilio error code

    • user_error boolean

      Indicates if it was a user error

    • http_status_code integer

      Http error code returned

    • params object
      Hide params attribute Show params attribute object
      • * string Additional properties
    • more_info string

      More information link

    • status integer

      HTTP status code

  • 409 application/json

    CONFLICT

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • message string

      Error message

    • code integer

      Twilio error code

    • user_error boolean

      Indicates if it was a user error

    • http_status_code integer

      Http error code returned

    • params object
      Hide params attribute Show params attribute object
      • * string Additional properties
    • more_info string

      More information link

    • status integer

      HTTP status code

  • 429 application/json

    TOO MANY REQUEST

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • message string

      Error message

    • code integer

      Twilio error code

    • user_error boolean

      Indicates if it was a user error

    • http_status_code integer

      Http error code returned

    • params object
      Hide params attribute Show params attribute object
      • * string Additional properties
    • more_info string

      More information link

    • status integer

      HTTP status code

  • 500 application/json

    INTERNAL SERVER ERROR

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • message string

      Error message

    • code integer

      Twilio error code

    • user_error boolean

      Indicates if it was a user error

    • http_status_code integer

      Http error code returned

    • params object
      Hide params attribute Show params attribute object
      • * string Additional properties
    • more_info string

      More information link

    • status integer

      HTTP status code

POST /v2/Alarms
curl \
 --request POST 'https://monitor.twilio.com/v2/Alarms' \
 --user "username:password" \
 --header "Content-Type: application/json" \
 --data '{"friendlyName":"string","queryType":"ERROR_CODE","query":"string","triggerValue":42,"timeWindow":"FIVE_MINS","email":["string"],"webhook":"string","consoleIndicator":true,"description":"string","enabled":true}'
Request examples
{
  "friendlyName": "string",
  "queryType": "ERROR_CODE",
  "query": "string",
  "triggerValue": 42,
  "timeWindow": "FIVE_MINS",
  "email": [
    "string"
  ],
  "webhook": "string",
  "consoleIndicator": true,
  "description": "string",
  "enabled": true
}
Response examples (201)
# Headers
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: X-Custom-Header1, X-Custom-Header2

# Payload
{
  "sid": "string"
}
Response examples (400)
# Headers
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: X-Custom-Header1, X-Custom-Header2

# Payload
{
  "message": "string",
  "code": 42,
  "user_error": true,
  "http_status_code": 42,
  "params": {
    "additionalProperty1": "string",
    "additionalProperty2": "string"
  },
  "more_info": "string",
  "status": 42
}
Response examples (401)
# Headers
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: X-Custom-Header1, X-Custom-Header2

# Payload
{
  "message": "string",
  "code": 42,
  "user_error": true,
  "http_status_code": 42,
  "params": {
    "additionalProperty1": "string",
    "additionalProperty2": "string"
  },
  "more_info": "string",
  "status": 42
}
Response examples (409)
# Headers
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: X-Custom-Header1, X-Custom-Header2

# Payload
{
  "message": "string",
  "code": 42,
  "user_error": true,
  "http_status_code": 42,
  "params": {
    "additionalProperty1": "string",
    "additionalProperty2": "string"
  },
  "more_info": "string",
  "status": 42
}
Response examples (429)
# Headers
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: X-Custom-Header1, X-Custom-Header2

# Payload
{
  "message": "string",
  "code": 42,
  "user_error": true,
  "http_status_code": 42,
  "params": {
    "additionalProperty1": "string",
    "additionalProperty2": "string"
  },
  "more_info": "string",
  "status": 42
}
Response examples (500)
# Headers
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: X-Custom-Header1, X-Custom-Header2

# Payload
{
  "message": "string",
  "code": 42,
  "user_error": true,
  "http_status_code": 42,
  "params": {
    "additionalProperty1": "string",
    "additionalProperty2": "string"
  },
  "more_info": "string",
  "status": 42
}