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

# Add Channel Rate

> Requires `notification-rate:update`. Rates are append-only: a new
price is a new row valid from `valid_from` (default now), so past
sends keep the price they were sent at. A send uses the latest rate
valid at send time for the recipient's country, else the
all-countries rate (`country` null). Without `change_reason` a
default note is stored. `409 rate-already-exists` when a rate of the
same channel, provider and country already starts at that date.




## OpenAPI

````yaml api-reference/notification/platform/openapi.yaml POST /notification/rate
openapi: 3.0.1
info:
  title: Notification Platform API (admin)
  description: |
    Admin side of the notification platform
    (notification/notification-platform): the event catalog and its channel
    rules, channel rates, the suppression list, the traceability search of
    occurrences, and the resend and retry of a notification.

    **Lists.** Every list takes `page` (default 1) and `page_size` (at most
    100; the default is given on each list), plus the flat filters
    documented on it. The shared list query of the Enterprise client is also
    accepted: `search` (folded into `q`) and `filters`
    (`field|operator|value`, comma separated), where `eq` and `in` become
    the flat key of the same name and `created_at` with `gte` / `lte`
    becomes `created_from` / `created_to`; other operators are ignored and
    an explicit flat key wins over the same key inside `filters`. A
    malformed `filters` answers `400`. Results come in `data`, with
    `paging`.

    **Reasons.** Every write carries a mandatory reason (`change_reason` or
    `reason`). It lands in the audit log with the actor, so the history of a
    record shows who changed what and why. A body that misses it, or has any
    other invalid or unknown field, answers `422` with one `{ code, field,
    message }` per problem (`change-reason-required` for a missing
    `change_reason`, `invalid-field` otherwise).
  version: '2026-11-03'
servers:
  - description: Production
    url: https://api.bbrands.io/api/v3
  - description: Certification
    url: https://certification.api.bbrands.io/api/v3
  - description: Development
    url: https://development.api.bbrands.io/api/v3
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Notification Event Catalog
    description: Catalog events, their channels, rules and change history.
  - name: Notification Rate
    description: Append-only price of a send by channel, provider and country.
  - name: Notification Suppression
    description: Addresses that no channel sends to until lifted.
  - name: Notification Occurrence
    description: Traceability of every event occurrence and its decisions.
  - name: Notification
    description: Resend and retry of a notification.
paths:
  /notification/rate:
    post:
      tags:
        - Notification Rate
      summary: Add a channel rate
      description: |
        Requires `notification-rate:update`. Rates are append-only: a new
        price is a new row valid from `valid_from` (default now), so past
        sends keep the price they were sent at. A send uses the latest rate
        valid at send time for the recipient's country, else the
        all-countries rate (`country` null). Without `change_reason` a
        default note is stored. `409 rate-already-exists` when a rate of the
        same channel, provider and country already starts at that date.
      operationId: notificationRateCreate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - channel
                - provider
                - amount
                - currency
              properties:
                channel:
                  $ref: '#/components/schemas/Channel'
                provider:
                  $ref: '#/components/schemas/Provider'
                country:
                  type: string
                  nullable: true
                  description: ISO 3166-1 alpha-2; empty or null for all countries.
                  example: CL
                unit:
                  type: string
                  enum:
                    - message
                    - segment
                  default: message
                amount:
                  type: number
                  minimum: 0
                  maximum: 1000000
                currency:
                  type: string
                  description: ISO 4217.
                  example: USD
                valid_from:
                  type: string
                  description: ISO 8601 date-time with offset, or a date (midnight UTC).
                  example: '2026-12-01'
                change_reason:
                  type: string
                  minLength: 3
                  maxLength: 500
            example:
              channel: sms
              provider: onesignal
              country: CL
              unit: segment
              amount: 0.045
              currency: USD
              valid_from: '2026-12-01'
      responses:
        '201':
          description: Rate added
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ChannelRate'
                  message:
                    type: string
                  meta:
                    $ref: '#/components/schemas/Meta'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  schemas:
    Channel:
      type: string
      enum:
        - email
        - in_app
        - live_activity
        - push
        - sms
        - whatsapp
    Provider:
      type: string
      enum:
        - horizon
        - meta
        - onesignal
        - resend
    ChannelRate:
      type: object
      properties:
        document_id:
          type: string
          format: uuid
        channel:
          $ref: '#/components/schemas/Channel'
        provider:
          $ref: '#/components/schemas/Provider'
        country:
          type: string
          nullable: true
          description: ISO 3166-1 alpha-2; null for all countries.
        unit:
          type: string
          enum:
            - message
            - segment
        amount:
          type: number
        currency:
          type: string
          example: USD
        valid_from:
          type: string
          format: date-time
        change_reason:
          type: string
          nullable: true
        created_by:
          type: string
          format: uuid
          nullable: true
        created_at:
          type: string
          format: date-time
    Meta:
      type: object
      properties:
        correlation:
          type: string
          description: Request correlation id; quote it when reporting an issue.
        status:
          type: integer
        timestamp:
          type: string
          format: date-time
        version:
          type: string
          nullable: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            errors:
              type: array
              items: {}
            message:
              type: string
        meta:
          $ref: '#/components/schemas/Meta'
  responses:
    BadRequest:
      description: Malformed path, query, `filters` or JSON body
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing, invalid, revoked or expired credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: The caller lacks the required permission
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Conflict:
      description: >-
        The request conflicts with the current state; `error.errors[].code` says
        why
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnprocessableEntity:
      description: |
        Business-rule or body validation error; `error.errors` lists one
        `{ code, field, message }` per problem
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: UNPROCESSABLE_ENTITY
              errors:
                - code: change-reason-required
                  field: change_reason
                  message: change_reason is required
              message: Unprocessable Entity
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: A `secret` API key, `hzk_<env>_<prefix>_<secret>`.

````

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