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

# Add a usage alert

> Adds a usage alert, which is to email its recipients when your team's usage crosses its trigger, at most once a UTC day, or once a billing period for overage and budget_percent.

> [accordion] Details
>
> It is recorded in your team's audit log. Each goes to the address the recipient signs in with.
>
> * Owners and Admins only. An API key needs team:manage.
>
> * trigger: calls (in a UTC day), included\_calls\_percent (of the day's included calls), overage (cents of overage in the billing period), budget\_percent (of the overage budget) or cap\_reached. Percentages are 1 to 1000.
>
> * recipients: roles, everyone in them when it sends, and member\_ids, verified members of your team (members who have joined it). At least one. Alerts in dollars (overage, budget\_percent) email only the Owners and Admins among them.
>
> * A team keeps up to 50 alerts.
>
> * **Callers:** an API key, an MCP OAuth token or a Dashboard session.
>
> * **Permission:** `team:manage`; an API key also needs `team:manage`.
>
> * **Effect:** Creates or changes something.
>
> * **Errors:** [`business_account_required`](https://docs.pomerado.ai/errors#business_account_required), [`role_permission_missing`](https://docs.pomerado.ai/errors#role_permission_missing), and the [errors any request can get](https://docs.pomerado.ai/errors.md).


## OpenAPI

````yaml /api-reference/openapi.json post /v1/usage/alerts
openapi: 3.1.0
info:
  title: Pomerado API
  version: '1'
  description: >-
    Run and build website tools, follow their jobs, and manage logins, API keys
    and webhooks. Authenticate with a Pomerado API key (pom_…), an MCP OAuth
    token or a Dashboard session as a Bearer token.
servers:
  - url: https://api.pomerado.ai
security: []
tags:
  - name: account
    x-group: Account
  - name: api_keys
    x-group: API keys
  - name: connected_apps
    x-group: Connected apps
  - name: usage
    x-group: Usage
  - name: quota
    x-group: Quota
  - name: spend_controls
    x-group: Spend controls
  - name: usage_alerts
    x-group: Usage alerts
  - name: usage_summary
    x-group: Usage summary
  - name: billing
    x-group: Billing
  - name: integrations
    x-group: Integrations
  - name: connect
    x-group: Connect
  - name: code
    x-group: Code
  - name: logins
    x-group: Saved logins
  - name: two_factor
    x-group: 2FA
  - name: login_access
    x-group: Login access
  - name: tools
    x-group: Tools
  - name: shapes
    x-group: Shapes
  - name: webhooks
    x-group: Webhooks
  - name: payer_profiles
    x-group: Payer profiles
  - name: payer_addresses
    x-group: Payer addresses
  - name: payment_methods
    x-group: Payment methods
  - name: runs
    x-group: Runs
  - name: builds
    x-group: Builds
  - name: jobs
    x-group: Jobs
  - name: suggestions
    x-group: Suggestions
  - name: audit
    x-group: Audit
  - name: files
    x-group: Files
  - name: team
    x-group: Team
  - name: sso
    x-group: Single sign-on
  - name: issue_reports
    x-group: Problem reports
paths:
  /v1/usage/alerts:
    post:
      tags:
        - usage_alerts
      summary: Add a usage alert
      description: >-
        Adds a usage alert, which is to email its recipients when your team's
        usage crosses its trigger, at most once a UTC day, or once a billing
        period for overage and budget_percent.
      operationId: usage_alerts.create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - trigger
                - recipients
              properties:
                trigger:
                  $ref: '#/components/schemas/UsageAlertTrigger'
                recipients:
                  type: object
                  required: []
                  properties:
                    roles:
                      type: array
                      items:
                        type: string
                        enum:
                          - owner
                          - admin
                          - member
                          - tool_user
                      description: Everyone in these roles when it sends
                      maxItems: 4
                    member_ids:
                      type: array
                      items:
                        $ref: '#/components/schemas/user_id'
                      description: >-
                        Verified members of your team, each by user ID: members
                        who have joined it
                      maxItems: 100
                  additionalProperties: false
                  description: At least one role or member
                'on':
                  type: boolean
                  description: Default true
              additionalProperties: false
      responses:
        '201':
          description: The alert
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageAlert'
        '400':
          description: invalid_request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: unauthorized, reauthentication_required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: business_account_required, role_permission_missing, forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: request_too_large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: internal_error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: temporarily_unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearer: []
components:
  schemas:
    UsageAlertTrigger:
      anyOf:
        - type: object
          required:
            - kind
            - calls
          properties:
            kind:
              type: string
              enum:
                - calls
            calls:
              type: integer
              description: Tool calls in a UTC day
              minimum: 1
              maximum: 1000000000
          additionalProperties: false
        - type: object
          required:
            - kind
            - percent
          properties:
            kind:
              type: string
              enum:
                - included_calls_percent
            percent:
              type: integer
              description: Of the UTC day's included calls, 1 to 1000
              minimum: 1
              maximum: 1000
          additionalProperties: false
        - type: object
          required:
            - kind
            - overage_cents
          properties:
            kind:
              type: string
              enum:
                - overage
            overage_cents:
              type: integer
              description: Overage in the billing period, in US cents
              minimum: 1
              maximum: 100000000000
          additionalProperties: false
        - type: object
          required:
            - kind
            - percent
          properties:
            kind:
              type: string
              enum:
                - budget_percent
            percent:
              type: integer
              description: Of the overage budget in the billing period, 1 to 1000
              minimum: 1
              maximum: 1000
          additionalProperties: false
        - type: object
          required:
            - kind
          properties:
            kind:
              type: string
              enum:
                - cap_reached
          additionalProperties: false
      description: >-
        What sets it off: calls or included_calls_percent each UTC day, overage
        or budget_percent (dollars, Owners and Admins only) each billing period,
        or cap_reached when the daily cap refuses runs
    user_id:
      type: string
      description: >-
        a team member ID: the user_id GET /v1/team/members gives: user_ and up
        to 100 letters or digits
      examples:
        - user_01K6QZ8V3N4M5P6R7S8T9W0XYZ
    UsageAlert:
      type: object
      required:
        - id
        - trigger
        - window
        - 'on'
        - recipients
        - on_changed_at
        - last_sent_at
      properties:
        id:
          type: string
        trigger:
          $ref: '#/components/schemas/UsageAlertTrigger'
        window:
          type: string
          enum:
            - day
            - billing_period
          description: 'It is emailed at most once in each: a UTC day, or a billing period'
        'on':
          type: boolean
        recipients:
          type: object
          required:
            - roles
            - members
          properties:
            roles:
              type: array
              items:
                type: string
                enum:
                  - owner
                  - admin
                  - member
                  - tool_user
              description: Everyone in these roles when it sends
            members:
              type: array
              items:
                $ref: '#/components/schemas/SpendControlPerson'
          additionalProperties: false
        on_changed_at:
          type: string
          description: When it was created, or last turned on or off
        last_sent_at:
          anyOf:
            - type: string
              description: ISO 8601 UTC
            - type: 'null'
      additionalProperties: false
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - retryable
            - docs_url
          properties:
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            docs_url:
              type: string
            details:
              type: object
              required: []
              properties: {}
              additionalProperties:
                $id: /schemas/unknown
          additionalProperties: false
      additionalProperties: false
    SpendControlPerson:
      type: object
      required:
        - member_id
        - name
        - email
      properties:
        member_id:
          type: string
          description: The member's user ID
        name:
          anyOf:
            - type: string
            - type: 'null'
        email:
          anyOf:
            - type: string
            - type: 'null'
      additionalProperties: false
      description: >-
        A member. name and email are null once your team no longer knows them,
        and to an API key without team:manage for anyone but its own member
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````

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