Twilio Monitor API

Twilio Monitor API is a powerful tool that allows developers to monitor and analyze the performance and security of their Twilio applications in real-time. With the Monitor API, users can track API usage, monitor error rates, and receive alerts for important events such as message delivery failures or security breaches. The API provides detailed insights into application performance, allowing developers to quickly identify and troubleshoot issues before they impact user experience.

OpenAPI Specification

monitor-openapi-original.yml Raw ↑
components:
  schemas:
    monitor.v1.alert:
      type: object
      properties:
        account_sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^AC[0-9a-fA-F]{32}$
          nullable: true
          description: >-
            The SID of the
            [Account](https://www.twilio.com/docs/iam/api/account) that created
            the Alert resource.
        alert_text:
          type: string
          nullable: true
          description: The text of the alert.
        api_version:
          type: string
          nullable: true
          description: >-
            The API version used when the alert was generated.  Can be empty for
            events that don't have a specific API version.
        date_created:
          type: string
          format: date-time
          nullable: true
          description: >-
            The date and time in GMT when the resource was created specified in
            [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        date_generated:
          type: string
          format: date-time
          nullable: true
          description: >-
            The date and time in GMT when the alert was generated specified in
            [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format.  Due
            to buffering, this can be different than `date_created`.
        date_updated:
          type: string
          format: date-time
          nullable: true
          description: >-
            The date and time in GMT when the resource was last updated
            specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
            format.
        error_code:
          type: string
          nullable: true
          description: >-
            The error code for the condition that generated the alert. See the
            [Error Dictionary](https://www.twilio.com/docs/api/errors) for
            possible causes and solutions to the error.
        log_level:
          type: string
          nullable: true
          description: 'The log level.  Can be: `error`, `warning`, `notice`, or `debug`.'
        more_info:
          type: string
          nullable: true
          description: >-
            The URL of the page in our [Error
            Dictionary](https://www.twilio.com/docs/api/errors) with more
            information about the error condition.
        request_method:
          type: string
          format: http-method
          enum:
            - HEAD
            - GET
            - POST
            - PATCH
            - PUT
            - DELETE
          nullable: true
          description: >-
            The method used by the request that generated the alert. If the
            alert was generated by a request we made to your server, this is the
            method we used. If the alert was generated by a request from your
            application to our API, this is the method your application used.
        request_url:
          type: string
          nullable: true
          description: >-
            The URL of the request that generated the alert. If the alert was
            generated by a request we made to your server, this is the URL on
            your server that generated the alert. If the alert was generated by
            a request from your application to our API, this is the URL of the
            resource requested.
        resource_sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^[a-zA-Z]{2}[0-9a-fA-F]{32}$
          nullable: true
          description: >-
            The SID of the resource for which the alert was generated.  For
            instance, if your server failed to respond to an HTTP request during
            the flow of a particular call, this value would be the SID of the
            server.  This value is empty if the alert was not generated for a
            particular resource.
        sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^NO[0-9a-fA-F]{32}$
          nullable: true
          description: The unique string that we created to identify the Alert resource.
        url:
          type: string
          format: uri
          nullable: true
          description: The absolute URL of the Alert resource.
        service_sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^[a-zA-Z]{2}[0-9a-fA-F]{32}$
          nullable: true
          description: >-
            The SID of the service or resource that generated the alert. Can be
            `null`.
    monitor.v1.alert-instance:
      type: object
      properties:
        account_sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^AC[0-9a-fA-F]{32}$
          nullable: true
          description: >-
            The SID of the
            [Account](https://www.twilio.com/docs/iam/api/account) that created
            the Alert resource.
        alert_text:
          type: string
          nullable: true
          description: The text of the alert.
        api_version:
          type: string
          nullable: true
          description: >-
            The API version used when the alert was generated.  Can be empty for
            events that don't have a specific API version.
        date_created:
          type: string
          format: date-time
          nullable: true
          description: >-
            The date and time in GMT when the resource was created specified in
            [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        date_generated:
          type: string
          format: date-time
          nullable: true
          description: >-
            The date and time in GMT when the alert was generated specified in
            [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format.  Due
            to buffering, this can be different than `date_created`.
        date_updated:
          type: string
          format: date-time
          nullable: true
          description: >-
            The date and time in GMT when the resource was last updated
            specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
            format.
        error_code:
          type: string
          nullable: true
          description: >-
            The error code for the condition that generated the alert. See the
            [Error Dictionary](https://www.twilio.com/docs/api/errors) for
            possible causes and solutions to the error.
        log_level:
          type: string
          nullable: true
          description: 'The log level.  Can be: `error`, `warning`, `notice`, or `debug`.'
        more_info:
          type: string
          nullable: true
          description: >-
            The URL of the page in our [Error
            Dictionary](https://www.twilio.com/docs/api/errors) with more
            information about the error condition.
        request_method:
          type: string
          format: http-method
          enum:
            - HEAD
            - GET
            - POST
            - PATCH
            - PUT
            - DELETE
          nullable: true
          description: >-
            The method used by the request that generated the alert. If the
            alert was generated by a request we made to your server, this is the
            method we used. If the alert was generated by a request from your
            application to our API, this is the method your application used.
        request_url:
          type: string
          nullable: true
          description: >-
            The URL of the request that generated the alert. If the alert was
            generated by a request we made to your server, this is the URL on
            your server that generated the alert. If the alert was generated by
            a request from your application to our API, this is the URL of the
            resource requested.
        request_variables:
          type: string
          nullable: true
          description: >-
            The variables passed in the request that generated the alert. This
            value is only returned when a single Alert resource is fetched.
        resource_sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^[a-zA-Z]{2}[0-9a-fA-F]{32}$
          nullable: true
          description: >-
            The SID of the resource for which the alert was generated.  For
            instance, if your server failed to respond to an HTTP request during
            the flow of a particular call, this value would be the SID of the
            server.  This value is empty if the alert was not generated for a
            particular resource.
        response_body:
          type: string
          nullable: true
          description: >-
            The response body of the request that generated the alert. This
            value is only returned when a single Alert resource is fetched.
        response_headers:
          type: string
          nullable: true
          description: >-
            The response headers of the request that generated the alert. This
            value is only returned when a single Alert resource is fetched.
        sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^NO[0-9a-fA-F]{32}$
          nullable: true
          description: The unique string that we created to identify the Alert resource.
        url:
          type: string
          format: uri
          nullable: true
          description: The absolute URL of the Alert resource.
        request_headers:
          type: string
          nullable: true
          description: >-
            The request headers of the request that generated the alert. This
            value is only returned when a single Alert resource is fetched.
        service_sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^[a-zA-Z]{2}[0-9a-fA-F]{32}$
          nullable: true
          description: >-
            The SID of the service or resource that generated the alert. Can be
            `null`.
    monitor.v1.event:
      type: object
      properties:
        account_sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^AC[0-9a-fA-F]{32}$
          nullable: true
          description: >-
            The SID of the
            [Account](https://www.twilio.com/docs/iam/api/account) that created
            the Event resource.
        actor_sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^US[0-9a-fA-F]{32}$
          nullable: true
          description: >-
            The SID of the actor that caused the event, if available. Can be
            `null`.
        actor_type:
          type: string
          nullable: true
          description: >-
            The type of actor that caused the event. Can be: `user` for a change
            made by a logged-in user in the Twilio Console, `account` for an
            event caused by an API request by an authenticating Account,
            `twilio-admin` for an event caused by a Twilio employee, and so on.
        description:
          type: string
          nullable: true
          description: A description of the event. Can be `null`.
        event_data:
          nullable: true
          description: >-
            An object with additional data about the event. The  contents depend
            on `event_type`. For example, event-types of the form
            `RESOURCE.updated`, this value contains a `resource_properties`
            dictionary that describes the previous and updated properties of the
            resource.
        event_date:
          type: string
          format: date-time
          nullable: true
          description: >-
            The date and time in GMT when the event was recorded specified in
            [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
        event_type:
          type: string
          nullable: true
          description: >-
            The event's type. Event-types are typically in the form:
            `RESOURCE_TYPE.ACTION`, where `RESOURCE_TYPE` is the type of
            resource that was affected and `ACTION` is what happened to it. For
            example, `phone-number.created`. For a full list of all event-types,
            see the [Monitor Event
            Types](https://www.twilio.com/docs/usage/monitor-events#event-types).
        resource_sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^[a-zA-Z]{2}[0-9a-fA-F]{32}$
          nullable: true
          description: The SID of the resource that was affected.
        resource_type:
          type: string
          nullable: true
          description: >-
            The type of resource that was affected. For a full list of all
            resource-types, see the [Monitor Event
            Types](https://www.twilio.com/docs/usage/monitor-events#event-types).
        sid:
          type: string
          minLength: 34
          maxLength: 34
          pattern: ^AE[0-9a-fA-F]{32}$
          nullable: true
          description: The unique string that we created to identify the Event resource.
        source:
          type: string
          nullable: true
          description: >-
            The originating system or interface that caused the event.  Can be:
            `web` for events caused by user action in the Twilio Console, `api`
            for events caused by a request to our API, or   `twilio` for events
            caused by an automated or internal Twilio system.
        source_ip_address:
          type: string
          nullable: true
          description: >-
            The IP address of the source, if the source is outside the Twilio
            cloud. This value is `null` for events with `source` of `twilio`
        url:
          type: string
          format: uri
          nullable: true
          description: The absolute URL of the resource that was affected. Can be `null`.
        links:
          type: object
          format: uri-map
          nullable: true
          description: The absolute URLs of related resources.
    ListAlertResponse:
      type: object
      properties:
        alerts:
          type: array
          items:
            $ref: '#/components/schemas/monitor.v1.alert'
        meta:
          type: object
          properties:
            first_page_url:
              type: string
              format: uri
            next_page_url:
              type: string
              format: uri
              nullable: true
            page:
              type: integer
            page_size:
              type: integer
            previous_page_url:
              type: string
              format: uri
              nullable: true
            url:
              type: string
              format: uri
            key:
              type: string
    ListEventResponse:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/monitor.v1.event'
        meta:
          type: object
          properties:
            first_page_url:
              type: string
              format: uri
            next_page_url:
              type: string
              format: uri
              nullable: true
            page:
              type: integer
            page_size:
              type: integer
            previous_page_url:
              type: string
              format: uri
              nullable: true
            url:
              type: string
              format: uri
            key:
              type: string
  securitySchemes:
    accountSid_authToken:
      type: http
      scheme: basic
info:
  title: Twilio - Monitor
  description: This is the public Twilio REST API.
  termsOfService: https://www.twilio.com/legal/tos
  contact:
    name: Twilio Support
    url: https://support.twilio.com
    email: [email protected]
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.52.0
openapi: 3.0.1
paths:
  /v1/Alerts/{Sid}:
    servers:
      - url: https://monitor.twilio.com
    description: Debugger alerts
    x-twilio:
      defaultOutputProperties:
        - sid
        - error_code
        - log_level
        - alert_text
      pathType: instance
    get:
      description: ''
      tags:
        - Alerts
      parameters:
        - name: Sid
          in: path
          description: The SID of the Alert resource to fetch.
          schema:
            type: string
            minLength: 34
            maxLength: 34
            pattern: ^NO[0-9a-fA-F]{32}$
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/monitor.v1.alert-instance'
          description: OK
      security:
        - accountSid_authToken: []
      operationId: FetchAlert
      x-maturity:
        - GA
  /v1/Alerts:
    servers:
      - url: https://monitor.twilio.com
    description: Debugger alerts
    x-twilio:
      defaultOutputProperties:
        - sid
        - error_code
        - log_level
        - alert_text
      pathType: list
    get:
      description: ''
      tags:
        - Alerts
      parameters:
        - name: LogLevel
          in: query
          description: >-
            Only show alerts for this log-level.  Can be: `error`, `warning`,
            `notice`, or `debug`.
          schema:
            type: string
        - name: StartDate
          in: query
          description: >-
            Only include alerts that occurred on or after this date and time.
            Specify the date and time in GMT and format as `YYYY-MM-DD` or
            `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are
            not supported.
          schema:
            type: string
            format: date-time
        - name: EndDate
          in: query
          description: >-
            Only include alerts that occurred on or before this date and time.
            Specify the date and time in GMT and format as `YYYY-MM-DD` or
            `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are
            not supported.
          schema:
            type: string
            format: date-time
        - name: PageSize
          in: query
          description: >-
            How many resources to return in each list page. The default is 50,
            and the maximum is 1000.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
        - name: Page
          in: query
          description: The page index. This value is simply for client state.
          schema:
            type: integer
            minimum: 0
        - name: PageToken
          in: query
          description: The page token. This is provided by the API.
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListAlertResponse'
          description: OK
      security:
        - accountSid_authToken: []
      operationId: ListAlert
      x-maturity:
        - GA
  /v1/Events/{Sid}:
    servers:
      - url: https://monitor.twilio.com
    description: Debugger events
    x-twilio:
      defaultOutputProperties:
        - sid
        - event_type
        - event_type
        - description
      pathType: instance
    get:
      description: ''
      tags:
        - Events
      parameters:
        - name: Sid
          in: path
          description: The SID of the Event resource to fetch.
          schema:
            type: string
            minLength: 34
            maxLength: 34
            pattern: ^AE[0-9a-fA-F]{32}$
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/monitor.v1.event'
          description: OK
      security:
        - accountSid_authToken: []
      operationId: FetchEvent
      x-maturity:
        - GA
  /v1/Events:
    servers:
      - url: https://monitor.twilio.com
    description: Debugger events
    x-twilio:
      defaultOutputProperties:
        - sid
        - event_type
        - event_type
        - description
      pathType: list
    get:
      description: Returns a list of events in the account, sorted by event-date.
      tags:
        - Events
      parameters:
        - name: ActorSid
          in: query
          description: >-
            Only include events initiated by this Actor. Useful for auditing
            actions taken by specific users or API credentials.
          schema:
            type: string
            minLength: 34
            maxLength: 34
            pattern: ^US[0-9a-fA-F]{32}$
        - name: EventType
          in: query
          description: >-
            Only include events of this [Event
            Type](https://www.twilio.com/docs/usage/monitor-events#event-types).
          schema:
            type: string
        - name: ResourceSid
          in: query
          description: >-
            Only include events that refer to this resource. Useful for
            discovering the history of a specific resource.
          schema:
            type: string
            minLength: 34
            maxLength: 34
            pattern: ^[a-zA-Z]{2}[0-9a-fA-F]{32}$
        - name: SourceIpAddress
          in: query
          description: >-
            Only include events that originated from this IP address. Useful for
            tracking suspicious activity originating from the API or the Twilio
            Console.
          schema:
            type: string
        - name: StartDate
          in: query
          description: >-
            Only include events that occurred on or after this date. Specify the
            date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
            format.
          schema:
            type: string
            format: date-time
        - name: EndDate
          in: query
          description: >-
            Only include events that occurred on or before this date. Specify
            the date in GMT and [ISO
            8601](https://en.wikipedia.org/wiki/ISO_8601) format.
          schema:
            type: string
            format: date-time
        - name: PageSize
          in: query
          description: >-
            How many resources to return in each list page. The default is 50,
            and the maximum is 1000.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
        - name: Page
          in: query
          description: The page index. This value is simply for client state.
          schema:
            type: integer
            minimum: 0
        - name: PageToken
          in: query
          description: The page token. This is provided by the API.
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListEventResponse'
          description: OK
      security:
        - accountSid_authToken: []
      operationId: ListEvent
      x-maturity:
        - GA
servers:
  - url: https://monitor.twilio.com
tags:
  - name: Alerts
  - name: Events
x-maturity:
  - name: GA
    description: This product is Generally Available.