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

# Create a notification rule

> Creates a rule (201). Each email must be a workspace member's, and each channel one Statisfy is in. Each condition's field must be one the workspace has. A name another rule has is a 409.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/notification-rules
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/notification-rules:
    post:
      tags:
        - notification_rules
      summary: Create a notification rule
      description: >-
        Creates a rule (201). Each email must be a workspace member's, and each
        channel one Statisfy is in. Each condition's field must be one the
        workspace has. A name another rule has is a 409.
      operationId: notification_rules_create
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                conditions:
                  anyOf:
                    - $ref: '#/components/schemas/RuleCondition'
                    - $ref: '#/components/schemas/RuleGroup'
                    - type: 'null'
                  default: null
                  description: >-
                    When the rule sends: a condition, or an `and` or `or` group
                    of them (at most 3 levels and 20 conditions). Null: every
                    meeting
                  title: Conditions
                enabled:
                  default: true
                  title: Enabled
                  type: boolean
                name:
                  description: Unique in your workspace
                  maxLength: 255
                  minLength: 1
                  title: Name
                  type: string
                recipients:
                  $ref: '#/components/schemas/RecipientsInput'
                type:
                  const: meeting_insights
                  default: meeting_insights
                  title: Type
                  type: string
              required:
                - name
                - recipients
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationRuleView'
          description: Successful Response
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationRuleView'
          description: Created
      security:
        - HTTPBearer: []
components:
  schemas:
    RuleCondition:
      additionalProperties: false
      properties:
        field:
          description: >-
            A field key of the object, as GET /v1/fields?object=<object> lists
            it
          maxLength: 200
          minLength: 1
          title: Field
          type: string
        object:
          description: >-
            account (the meeting's account) or user (the meeting's internal
            user)
          title: Object
          type: string
        op:
          description: >-
            eq, neq, gt, gte, lt, lte, in, nin, contains, notcontains, begins,
            ends, exists, notexists, date_relative, not_date_relative or
            date_window, as in the app's filter
          enum:
            - eq
            - neq
            - gt
            - gte
            - lt
            - lte
            - in
            - nin
            - contains
            - notcontains
            - begins
            - ends
            - date_relative
            - not_date_relative
            - date_window
            - exists
            - notexists
          title: Op
          type: string
        value:
          default: null
          description: A list for in and nin; none for exists and notexists
          title: Value
      required:
        - object
        - field
        - op
      title: RuleCondition
      type: object
    RuleGroup:
      additionalProperties: false
      properties:
        and:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/RuleCondition'
                  - $ref: '#/components/schemas/RuleGroup'
              type: array
            - type: 'null'
          default: null
          description: All of these
          title: And
        or:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/RuleCondition'
                  - $ref: '#/components/schemas/RuleGroup'
              type: array
            - type: 'null'
          default: null
          description: Any of these
          title: Or
      title: RuleGroup
      type: object
    RecipientsInput:
      additionalProperties: false
      properties:
        emails:
          anyOf:
            - items:
                maxLength: 320
                minLength: 1
                type: string
              maxItems: 50
              type: array
            - type: 'null'
          default: null
          description: 'Emails of members of your workspace. Left out: kept'
          title: Emails
        slack_channels:
          anyOf:
            - items:
                maxLength: 64
                minLength: 1
                type: string
              maxItems: 50
              type: array
            - type: 'null'
          default: null
          description: 'Slack channels Statisfy is in. Left out: kept'
          title: Slack Channels
        teams_channels:
          anyOf:
            - items:
                maxLength: 200
                minLength: 1
                type: string
              maxItems: 50
              type: array
            - type: 'null'
          default: null
          description: 'Teams channels Statisfy is in. Left out: kept'
          title: Teams Channels
      title: RecipientsInput
      type: object
    NotificationRuleView:
      properties:
        conditions:
          anyOf:
            - $ref: '#/components/schemas/ConditionView'
            - $ref: '#/components/schemas/GroupView'
            - type: 'null'
          description: >-
            When the rule sends: a condition, or an `and` or `or` group of them
            (at most 3 levels and 20 conditions). Null: every meeting
          title: Conditions
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Created At
        enabled:
          title: Enabled
          type: boolean
        id:
          title: Id
          type: string
        name:
          title: Name
          type: string
        recipients:
          $ref: '#/components/schemas/Recipients'
        type:
          const: meeting_insights
          description: 'What it sends: a processed meeting''s insights'
          title: Type
          type: string
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Updated At
      required:
        - id
        - name
        - type
        - enabled
        - conditions
        - recipients
        - created_at
        - updated_at
      title: NotificationRuleView
      type: object
    ConditionView:
      properties:
        field:
          title: Field
          type: string
        object:
          description: 'The object the field is on: account, user, opportunity, ...'
          title: Object
          type: string
        op:
          title: Op
          type: string
        value:
          title: Value
      required:
        - object
        - field
        - op
      title: ConditionView
      type: object
    GroupView:
      properties:
        and:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ConditionView'
                  - $ref: '#/components/schemas/GroupView'
              type: array
            - type: 'null'
          description: All of these
          title: And
        or:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/ConditionView'
                  - $ref: '#/components/schemas/GroupView'
              type: array
            - type: 'null'
          description: Any of these
          title: Or
      title: GroupView
      type: object
    Recipients:
      properties:
        emails:
          description: Workspace members' emails
          items:
            type: string
          title: Emails
          type: array
        slack_channels:
          description: Slack channel ids, from GET /v1/notification-rules/channels
          items:
            type: string
          title: Slack Channels
          type: array
        teams_channels:
          description: Teams channel ids, from GET /v1/notification-rules/channels
          items:
            type: string
          title: Teams Channels
          type: array
      required:
        - emails
        - slack_channels
        - teams_channels
      title: Recipients
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

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