> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rootly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Observability log patterns

> List log patterns (clustered log templates) with counts against the previous window of the same length. Only `service:`, `severity:` and `pattern:` filters apply; others are echoed in `meta.ignored_filters`. Each pattern's `logs_query` drills into matching rows with `GET /v1/observability/logs`; it is omitted when that query would exceed the `/logs` length or clause limits. Requires a personal or Global API key (Team API Keys are group-scoped and get 403 `unsupported_api_key`) or an OAuth token with the `obs.logs:read` (or `all`) scope, and the Observability logs read permission. A Global API key uses its service user's Observability role, which starts as the team's default Observability role. Limited to 60 requests per minute per token; on this endpoint the X-RateLimit-* headers report that per-minute budget, not the default API limit. Every 429 returns the errors envelope with code rate_limited and a Retry-After header.



## OpenAPI

````yaml https://rootly-heroku.s3.amazonaws.com/swagger/v1/swagger.json get /v1/observability/patterns
openapi: 3.0.1
info:
  title: Rootly API v1
  version: v1
  license:
    name: Rootly
    url: https://rootly.com
  description: >+
    # How to generate an API Key?

    - **Organization dropdown** > **Organization Settings** > **API Keys**


    # JSON:API Specification

    Rootly is using **JSON:API** (https://jsonapi.org) specification:

    - JSON:API is a specification for how a client should request that resources
    be fetched or modified, and how a server should respond to those requests.

    - JSON:API is designed to minimize both the number of requests and the
    amount of data transmitted between clients and servers. This efficiency is
    achieved without compromising readability, flexibility, or discoverability.

    - JSON:API requires use of the JSON:API media type
    (**application/vnd.api+json**) for exchanging data.


    # Authentication and Requests

    We use standard HTTP Authentication over HTTPS to authorize your requests.

    ```
      curl --request GET \
    --header 'Content-Type: application/vnd.api+json' \

    --header 'Authorization: Bearer YOUR-TOKEN' \

    --url https://api.rootly.com/v1/incidents

    ```


    <br/>


    # Rate limiting

    - There is a default limit of **5** **GET**, **HEAD**, and **OPTIONS** calls
    **per API key** every **60 seconds** (0 hours). The limit is calculated over
    a **0-hour sliding window** looking back from the current time. While the
    limit can be configured to support higher thresholds, you must first contact
    your **Rootly Customer Success Manager** to make any adjustments.

    - There is a default limit of **3** **POST**, **PUT**, **PATCH** or
    **DELETE** calls **per API key** every **60 seconds** (0 hours). The limit
    is calculated over a **0-hour sliding window** looking back from the current
    time. While the limit can be configured to support higher thresholds, you
    must first contact your **Rootly Customer Success Manager** to make any
    adjustments.

    - When rate limits are exceeded, the API will return a **429 Too Many
    Requests** HTTP status code with the response: `{"error": "Rate limit
    exceeded. Try again later."}`

    - **X-RateLimit headers** are included in every API response, providing
    real-time rate limit information:
      - **X-RateLimit-Limit** - The maximum number of requests permitted and the time window (e.g., "1000, 1000;window=3600" for 1000 requests per hour)
      - **X-RateLimit-Remaining** - The number of requests remaining in the current rate limit window
      - **X-RateLimit-Used** - The number of requests already made in the current window
      - **X-RateLimit-Reset** - The time at which the current rate limit window resets, in UTC epoch seconds

    # Pagination

    - Pagination is supported for all endpoints that return a collection of
    items.

    - Pagination is controlled by the **page** query parameter


    ## Example

    ```
      curl --request GET \
    --header 'Content-Type: application/vnd.api+json' \

    --header 'Authorization: Bearer YOUR-TOKEN' \

    --url https://api.rootly.com/v1/incidents?page[number]=1&page[size]=10

    ```

  x-logo:
    url: https://rootly-heroku.s3.us-east-1.amazonaws.com/swagger/v1/logo.png
servers:
  - url: https://api.rootly.com
security: []
paths:
  /v1/observability/patterns:
    get:
      tags:
        - Observability
      summary: List Observability log patterns
      description: >-
        List log patterns (clustered log templates) with counts against the
        previous window of the same length. Only `service:`, `severity:` and
        `pattern:` filters apply; others are echoed in `meta.ignored_filters`.
        Each pattern's `logs_query` drills into matching rows with `GET
        /v1/observability/logs`; it is omitted when that query would exceed the
        `/logs` length or clause limits. Requires a personal or Global API key
        (Team API Keys are group-scoped and get 403 `unsupported_api_key`) or an
        OAuth token with the `obs.logs:read` (or `all`) scope, and the
        Observability logs read permission. A Global API key uses its service
        user's Observability role, which starts as the team's default
        Observability role. Limited to 60 requests per minute per token; on this
        endpoint the X-RateLimit-* headers report that per-minute budget, not
        the default API limit. Every 429 returns the errors envelope with code
        rate_limited and a Retry-After header.
      operationId: listObservabilityPatterns
      parameters:
        - name: filter[query]
          in: query
          required: false
          schema:
            type: string
          description: >-
            Query using `service:`, `severity:` and `pattern:` filters, e.g.
            `service:checkout severity:error`.
        - name: filter[from]
          in: query
          required: false
          schema:
            type: string
          description: >-
            Window start: ISO8601 or relative like `now-6h`. Defaults to
            `now-1h`. At most 7 days long, within the last 30 days.
        - name: filter[to]
          in: query
          required: false
          schema:
            type: string
          description: 'Window end: ISO8601 or relative like `now`. Defaults to `now`.'
        - name: filter[flagged]
          in: query
          required: false
          schema:
            type: boolean
          description: Only patterns flagged by a detector (new, spike, error surge).
        - name: sort
          in: query
          required: false
          schema:
            type: string
            enum:
              - count
              - change
            default: count
          description: >-
            `count` for the most frequent patterns, `change` for the biggest
            change against the previous window.
        - name: page[size]
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 25
            default: 15
          description: >-
            Number of top patterns to return (1-25, default 15), ordered by
            sort. Not paginated: meta.truncated is true when more patterns
            matched; narrow filter[query] to see them.
      responses:
        '200':
          description: Patterns with the effective query and windows
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - type
                        - attributes
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                          enum:
                            - observability_log_patterns
                        attributes:
                          type: object
                          properties:
                            service:
                              type: string
                            pattern_hash:
                              type: string
                            template:
                              type: string
                            total:
                              type: integer
                            previous_total:
                              type: integer
                            change_percent:
                              type: integer
                              nullable: true
                            errors:
                              type: integer
                            warnings:
                              type: integer
                            max_severity:
                              type: string
                            first_seen:
                              type: string
                              format: date-time
                            detectors:
                              type: array
                              items:
                                type: string
                            logs_query:
                              type: string
                  meta:
                    type: object
                    required:
                      - query
                      - window
                      - previous_window
                      - sort
                      - flagged
                      - returned
                      - truncated
                      - warnings
                    properties:
                      query:
                        type: string
                      ignored_filters:
                        type: string
                        nullable: true
                      window:
                        $ref: '#/components/schemas/observability_window'
                      previous_window:
                        $ref: '#/components/schemas/observability_window'
                      sort:
                        type: string
                      flagged:
                        type: boolean
                      returned:
                        type: integer
                      truncated:
                        type: boolean
                      warnings:
                        type: array
                        items:
                          $ref: '#/components/schemas/observability_warning'
        '400':
          description: Window outside pattern retention
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/observability_errors'
        '403':
          description: Observability is not available for the team
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/observability_errors'
        '404':
          description: The role cannot read logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/observability_errors'
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before retrying
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/observability_errors'
        '503':
          description: ClickHouse is unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/observability_errors'
      security:
        - bearer_auth: []
components:
  schemas:
    observability_window:
      type: object
      required:
        - from
        - to
      properties:
        from:
          type: string
          format: date-time
          description: Resolved window start (UTC, inclusive)
        to:
          type: string
          format: date-time
          description: >-
            Resolved window end (UTC). Inclusive for logs; exclusive for
            patterns, whose counts cover whole minutes in [from, to)
    observability_warning:
      type: object
      required:
        - code
        - detail
      properties:
        code:
          type: string
          enum:
            - no_data
            - attribute_missing
        detail:
          type: string
    observability_errors:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            type: object
            required:
              - status
              - code
              - title
            properties:
              status:
                type: string
              code:
                type: string
                description: >-
                  Stable machine-readable error code, e.g. invalid_range,
                  outside_retention, search_requires_narrower_range,
                  invalid_cursor, invalid_query, too_expensive,
                  invalid_parameter, observability_unavailable,
                  insufficient_scope, unsupported_api_key, not_found,
                  unavailable, rate_limited
              title:
                type: string
              source:
                type: object
                properties:
                  parameter:
                    type: string
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.