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

# Create an opt-out

> Creates an opt-out for a phone number on the active team. Repeated requests for the same identifier and scope are idempotent and return the existing opt-out.



## OpenAPI

````yaml /swagger.yml post /public/v1/opt-outs
openapi: 3.0.0
info:
  title: Public API Docs
  description: Clerk Public API
  version: '1.0'
  contact: {}
servers:
  - url: https://web-api.clerk.chat
    description: Production server
  - url: http://localhost:3000
    description: Production server
security: []
tags: []
paths:
  /public/v1/opt-outs:
    post:
      tags:
        - Opt-outs
      summary: Create an opt-out
      description: >-
        Creates an opt-out for a phone number on the active team. Repeated
        requests for the same identifier and scope are idempotent and return the
        existing opt-out.
      operationId: PublicOptOutsController_create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePublicOptOutRequest'
      responses:
        '201':
          description: The created or existing opt-out
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OptOutResponse'
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized request
        '403':
          description: You do not have permission to access this resource
        '404':
          description: Resource not found
        '422':
          description: Invalid request parameters
        '429':
          description: Too many requests for this resource
        '500':
          description: Internal server error
      security:
        - api_key: []
components:
  schemas:
    CreatePublicOptOutRequest:
      type: object
      required:
        - identifier
      properties:
        identifier:
          type: string
          description: Phone number to opt out, in E.164 format
          example: '+14155550100'
        inboxId:
          type: string
          description: >-
            Optional inbox ID for an inbox-scoped opt-out. When omitted, a
            team-wide opt-out is created. Requires the InboxOptOuts feature.
          example: 00000000-0000-0000-0000-000000000000
        reason:
          type: string
          description: Optional reason for the opt-out
          example: Customer requested via support
    OptOutResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/OptOutObject'
    OptOutObject:
      type: object
      required:
        - id
        - identifier
        - inboxId
        - reason
        - channel
        - createdAt
      properties:
        id:
          type: string
          description: The ID of the resource
          example: 00000000-0000-0000-0000-000000000000
          readOnly: true
        identifier:
          type: string
          description: Opted-out phone number in E.164 format
          example: '+14155550100'
        inboxId:
          type: string
          description: >-
            Inbox ID when the opt-out is inbox-scoped; null for a team-wide
            opt-out
          example: 00000000-0000-0000-0000-000000000000
          readOnly: true
          nullable: true
        reason:
          type: string
          description: Reason for the opt-out, if provided
          example: Customer requested via support
          nullable: true
        channel:
          type: string
          description: Channel that produced the opt-out
          enum:
            - call
            - sms
            - amb
          example: sms
        createdAt:
          type: string
          format: date-time
          example: '2021-01-01T00:00:00.000Z'
          readOnly: true
          description: The date and time the resource was created
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: apiKey

````