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

# Create an opt-out

> Opts a phone number out of receiving messages from a Sender ID, a 10DLC campaign, or all outbound messages.



## OpenAPI

````yaml https://wavix.github.io/wavix-openapi/wavix-api.yaml post /v3/messages/opt-outs
openapi: 3.1.0
info:
  title: Wavix APIs
  description: >-
    Wavix provides robust APIs that let you integrate voice and text messaging
    features directly into your app. Send text, place calls, and access detailed
    reports  programmatically.
  termsOfService: https://wavix.com/terms-and-conditions
  license:
    name: MIT
    identifier: MIT
  contact:
    name: Wavix
    url: https://wavix.com
    email: support@wavix.com
  version: '1.0'
servers:
  - url: https://api.wavix.com
    description: https://api.wavix.com
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: SIP trunks
    description: SIP trunks
  - name: Buy
    description: Numbers
  - name: Cart
    description: Numbers
  - name: My numbers
    description: Numbers
  - name: Billing
    description: Billing, transactions, and invoices
  - name: Profile
    description: Account profile and customer information
  - name: CDRs
    description: Call detail records and call history
  - name: Speech Analytics
    description: Call transcription and speech analytics
  - name: SMS and MMS
    description: Messaging
  - name: Number Validator
    description: Phone number validation
  - name: Link shortener
    description: Short link and click metrics
  - name: 2FA
    description: Two-factor authentication
  - name: 10DLC
    description: 10DLC Campaigns and Brands
  - name: API Keys
    description: API key management
  - name: Call webhooks
    description: Webhook configuration for call events
  - name: Call control
    description: Programmable Voice
  - name: Call streaming
    description: Real-time call audio streaming over WebSocket
  - name: Call recording
    description: Call recording
  - name: Sub-accounts
    description: Sub-account management
  - name: Voice campaigns
    description: Outbound voice campaigns
  - name: Wavix Embeddable
    description: WebRTC embeddable widget
paths:
  /v3/messages/opt-outs:
    post:
      tags:
        - SMS and MMS
      summary: Create an opt-out
      description: >-
        Opts a phone number out of receiving messages from a Sender ID, a 10DLC
        campaign, or all outbound messages.
      operationId: sms_and_mms_opt_outs_create
      parameters: []
      requestBody:
        description: Attributes for the new opt-out.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/OptOutCreateRequest'
        required: true
      responses:
        '201':
          description: Returns a success confirmation. The opt-out is created.
          headers: {}
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - example:
                      success: true
              examples:
                default:
                  value:
                    success: true
        '400':
          $ref: '#/components/responses/BadRequestErrorResponse'
        '403':
          $ref: '#/components/responses/ForbiddenErrorResponse'
        '404':
          $ref: '#/components/responses/NotFoundErrorResponse'
        '422':
          $ref: '#/components/responses/ValidationErrorResponse'
      deprecated: false
      security:
        - bearerAuth:
            - messages:write
components:
  schemas:
    OptOutCreateRequest:
      title: OptOutCreateRequest
      required:
        - opt_out
      type: object
      additionalProperties: false
      properties:
        opt_out:
          $ref: '#/components/schemas/OptOut'
    SuccessResponse:
      title: SuccessResponse
      required:
        - success
      type: object
      properties:
        success:
          type: boolean
          description: Indicates whether the request was successful.
          example: true
    OptOut:
      title: OptOut
      required:
        - number
      type: object
      additionalProperties: false
      properties:
        number:
          type: string
          description: Phone number to opt out.
          example: '16419252149'
        sender_id:
          type: string
          description: >-
            Sender ID. If omitted, the phone number is opted out of all
            messages.
          example: '15072429497'
      example:
        number: '16419252149'
        sender_id: '15072429497'
    ValidationErrorResponse:
      title: ValidationErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: >-
            Human-readable description naming the missing or invalid request
            parameter.
          example: Missing or invalid parameter <param_name>
    ForbiddenErrorResponse:
      title: ForbiddenErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: Human-readable description of why access is forbidden.
          example: The service is not provisioned for your account.
    NotFoundErrorResponse:
      title: NotFoundErrorResponse
      type: object
      properties:
        success:
          type: boolean
          description: >-
            Indicates whether the request was successful. Always `false` for
            this error.
          example: false
        message:
          type: string
          description: >-
            Human-readable description stating that no resource matches the
            given ID.
          example: Record not found
  responses:
    BadRequestErrorResponse:
      description: Request failed. Missing or invalid parameter <param_name>
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
    ForbiddenErrorResponse:
      description: Request failed. The feature is disabled for your account.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenErrorResponse'
    NotFoundErrorResponse:
      description: Request failed. An object with the specified ID is not found.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFoundErrorResponse'
    ValidationErrorResponse:
      description: Validation error
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Wavix API key. Pass as `Authorization: Bearer <api_key>`. Keys support
        per-resource scopes (none / read / write). See [Restricted keys and
        scopes](https://docs.wavix.com/api-reference/authentication#restricted-keys-and-scopes).

````