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

# Set or clear per-channel WhatsApp opt-out

> `action: set` creates or reactivates an opt-out for the given channel and phone. `action: clear` revokes it. Idempotent clears are safe.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/opt-outs
openapi: 3.0.0
info:
  title: Flowella REST API
  version: 2.1.0
  description: >-
    Public v1 HTTP API for Flowella. Authenticate with `Authorization: Bearer
    <api_key>` (`flo_` prefix). Canonical base: `https://api.flowella.io/v1`.
    Legacy `https://app.flowella.io/api/v1/...` requests are permanently
    redirected (308) to the canonical host, preserving method and body.
servers:
  - url: https://api.flowella.io
    description: Canonical API host
  - url: https://app.flowella.io
    description: Legacy app host — /api/v1 permanently redirects (308) to the API host /v1
security: []
tags:
  - name: System
    description: Health and auth checks
  - name: Messages
    description: Send WhatsApp messages
  - name: Conversations
    description: Inbox conversations
  - name: Contacts
    description: CRM contacts
  - name: Templates
    description: WhatsApp templates and bulk send
  - name: Analytics
    description: Usage and delivery metrics
paths:
  /v1/opt-outs:
    post:
      tags:
        - Contacts
      summary: Set or clear per-channel WhatsApp opt-out
      description: >-
        `action: set` creates or reactivates an opt-out for the given channel
        and phone. `action: clear` revokes it. Idempotent clears are safe.
      operationId: v1OptOutsMutate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - set
                    whatsappChannelId:
                      type: string
                      format: cuid
                    phone:
                      type: string
                      minLength: 3
                      maxLength: 32
                    reason:
                      type: string
                      maxLength: 500
                  required:
                    - action
                    - whatsappChannelId
                    - phone
                  example:
                    action: set
                    whatsappChannelId: clxxxxxxxxxxxxxxxxxxxxxxxx
                    phone: '+15551234567'
                    reason: User requested via CRM
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - clear
                    whatsappChannelId:
                      type: string
                      format: cuid
                    phone:
                      type: string
                      minLength: 3
                      maxLength: 32
                  required:
                    - action
                    - whatsappChannelId
                    - phone
                  example:
                    action: clear
                    whatsappChannelId: clxxxxxxxxxxxxxxxxxxxxxxxx
                    phone: '+15551234567'
      responses:
        '200':
          description: Current opt-out state
          content:
            application/json:
              schema:
                type: object
                properties:
                  optOutId:
                    type: string
                    nullable: true
                  active:
                    type: boolean
                  revokedAt:
                    type: string
                    nullable: true
                required:
                  - optOutId
                  - active
                  - revokedAt
                example:
                  optOutId: clxxxxxxxxxxxxxxxxxxxxxxxx
                  active: true
                  revokedAt: null
        '400':
          description: Bad body
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
                example:
                  error:
                    code: UNAUTHORIZED
                    message: Invalid API key
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
                example:
                  error:
                    code: UNAUTHORIZED
                    message: Invalid API key
        '402':
          description: Payment required
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
                example:
                  error:
                    code: UNAUTHORIZED
                    message: Invalid API key
        '403':
          description: Forbidden (e.g. integration disabled)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
                example:
                  error:
                    code: UNAUTHORIZED
                    message: Invalid API key
        '404':
          description: Channel not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
                example:
                  error:
                    code: UNAUTHORIZED
                    message: Invalid API key
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - error
                example:
                  error:
                    code: UNAUTHORIZED
                    message: Invalid API key
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Organization API key (`flo_…`). Paste the full key; Scalar sends
        `Authorization: Bearer <key>`.

````