> ## 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.

# Set the Microsoft Teams channel rules

> Saves the whole rule: send all four parts, with null for an unused id_field or name_field and [] for unused prefixes or suffixes. It applies now to every Teams channel, which resets the changes made to single channels: a channel is read when the rule is empty, or when any part matches it, a CRM field value included. Group chats are always read. Each channel or group chat that Statisfy is in and that has no account gets the account whose value names that row alone (a value that also names another row does not link). When two accounts do, it is a conflict and nothing is linked. An account already set is never changed. A channel the save turns on gets its last 30 days at the next daily sync. Up to 20 prefixes and 20 suffixes, each 1 to 80 characters after one leading # and spaces are removed (it is stored in lower case), none twice; a CRM field must be an account field, and not the same for both. A 422 lists each bad part (`field`, `index`); more than 20 values in a list, or a value over 200 characters, is a 422 of the body check, whose details have `loc` and `msg`. Teams need not be connected.



## OpenAPI

````yaml /api/statisfy-api.openapi.json put /v1/integrations/microsoft_teams/channel-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/integrations/microsoft_teams/channel-rules:
    put:
      tags:
        - integrations
      summary: Set the Microsoft Teams channel rules
      description: >-
        Saves the whole rule: send all four parts, with null for an unused
        id_field or name_field and [] for unused prefixes or suffixes. It
        applies now to every Teams channel, which resets the changes made to
        single channels: a channel is read when the rule is empty, or when any
        part matches it, a CRM field value included. Group chats are always
        read. Each channel or group chat that Statisfy is in and that has no
        account gets the account whose value names that row alone (a value that
        also names another row does not link). When two accounts do, it is a
        conflict and nothing is linked. An account already set is never changed.
        A channel the save turns on gets its last 30 days at the next daily
        sync. Up to 20 prefixes and 20 suffixes, each 1 to 80 characters after
        one leading # and spaces are removed (it is stored in lower case), none
        twice; a CRM field must be an account field, and not the same for both.
        A 422 lists each bad part (`field`, `index`); more than 20 values in a
        list, or a value over 200 characters, is a 422 of the body check, whose
        details have `loc` and `msg`. Teams need not be connected.
      operationId: integrations_microsoft_teams_put_channel_rules
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                id_field:
                  anyOf:
                    - maxLength: 200
                      type: string
                    - type: 'null'
                  description: >-
                    The account CRM field that holds a channel or group chat id;
                    null: none
                  title: Id Field
                name_field:
                  anyOf:
                    - maxLength: 200
                      type: string
                    - type: 'null'
                  description: >-
                    The account CRM field that holds a channel or group chat
                    name; null: none
                  title: Name Field
                prefixes:
                  description: Read the channels whose name starts with one
                  items:
                    maxLength: 200
                    type: string
                  maxItems: 20
                  title: Prefixes
                  type: array
                suffixes:
                  description: Read the channels whose name ends with one
                  items:
                    maxLength: 200
                    type: string
                  maxItems: 20
                  title: Suffixes
                  type: array
              required:
                - id_field
                - name_field
                - prefixes
                - suffixes
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamsChannelRulesSaved'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    TeamsChannelRulesSaved:
      properties:
        conflicts:
          title: Conflicts
          type: integer
        id_field:
          anyOf:
            - type: string
            - type: 'null'
          title: Id Field
        id_field_missing:
          title: Id Field Missing
          type: boolean
        ingesting:
          title: Ingesting
          type: integer
        links_written:
          title: Links Written
          type: integer
        name_field:
          anyOf:
            - type: string
            - type: 'null'
          title: Name Field
        name_field_missing:
          title: Name Field Missing
          type: boolean
        not_ingesting:
          title: Not Ingesting
          type: integer
        prefixes:
          items:
            type: string
          title: Prefixes
          type: array
        suffixes:
          items:
            type: string
          title: Suffixes
          type: array
      required:
        - prefixes
        - suffixes
        - id_field_missing
        - name_field_missing
        - ingesting
        - not_ingesting
        - links_written
        - conflicts
      title: TeamsChannelRulesSaved
      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.