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

# Add an alert rule over one project (owners, admins)

> Evaluated every minute. A rule sends once when it starts firing and once when it resolves; within its cooldown, or while muted, the change is recorded but not sent. new_issue sends once per new issue.



## OpenAPI

````yaml /api-reference/openapi.json post /orgs/{orgId}/alerts/rules
openapi: 3.1.0
info:
  title: Apsio API
  version: 0.1.0
  description: >-
    Read API v0: your projects, release health and comparisons, missing symbols,
    issues, sessions, vitals, cohort comparisons, performance (app start,
    screens, hangs, MetricKit) and network endpoints and traces for one project.
    Authenticate with a project token as a bearer token, with an OAuth access
    token from Apsio's authorization server (MCP clients), or, from the console,
    with the session cookie of a member of the project's organization.
servers:
  - url: https://api.apsio.io/v1
security: []
paths:
  /orgs/{orgId}/alerts/rules:
    post:
      summary: Add an alert rule over one project (owners, admins)
      description: >-
        Evaluated every minute. A rule sends once when it starts firing and once
        when it resolves; within its cooldown, or while muted, the change is
        recorded but not sent. new_issue sends once per new issue.
      parameters:
        - schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            example: 0192f3a4-0000-7000-8000-00000000a001
          required: true
          name: orgId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  type: string
                  pattern: >-
                    ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                app_id:
                  type:
                    - string
                    - 'null'
                  pattern: >-
                    ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                preset:
                  type: string
                  enum:
                    - crash_free_below
                    - new_issue
                    - issue_spike
                    - endpoint_failure_above
                params:
                  type: object
                  additionalProperties:
                    anyOf:
                      - type: number
                      - type: string
                        maxLength: 512
                  description: >-
                    The preset's parameters. crash_free_below: threshold_percent
                    (50 to 99.99), window_hours (1 to 168, default 24),
                    min_sessions (default 100), release. new_issue:
                    min_occurrences (default 1), release. issue_spike: factor (2
                    to 1000, default 5; the last hour against the 7-day hourly
                    mean), min_occurrences (default 20). endpoint_failure_above:
                    threshold_percent (0.1 to 100), window_hours (1 to 24,
                    default 1), min_requests (default 100), method, host,
                    template.
                  example:
                    threshold_percent: 99.5
                    window_hours: 24
                destination_id:
                  type: string
                  pattern: >-
                    ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                cooldown_minutes:
                  type: integer
                  minimum: 5
                  maximum: 10080
                enabled:
                  type: boolean
                muted_until:
                  type:
                    - string
                    - 'null'
                  format: date-time
                  description: Muted until then (at most 30 days); null unmutes.
              required:
                - project_id
                - preset
                - params
                - destination_id
      responses:
        '201':
          description: The rule
      security:
        - session: []
components:
  securitySchemes:
    session:
      type: apiKey
      in: cookie
      name: apsio_session
      description: >-
        The console session, set by /v1/auth/callback (`__Host-apsio_session`
        when host-only).

````

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