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

# Unsubscribe

> Clear default routing on this number entirely. Drops both the agent and the webhook.

Sets `defaultRouting` to `null` (no routing) and drops both the connected
agent and the default webhook. Incoming messages are stored on the
conversation but no agent or webhook is invoked.

When `applyToExisting` is `true`, every existing conversation on this
number has its `activeAgent` and in-flight session cleared too. Phone-
number routing changes do **not** dispatch `subscription.activated` /
`subscription.revoked` webhook events.

Sandbox numbers scope the change to the requesting user's own
conversation rather than the shared number's defaults.


## OpenAPI

````yaml api-reference/openapi.json POST /api/v1/phone-numbers/{number}/unsubscribe/
openapi: 3.0.3
info:
  title: Wassist API
  version: 1.0.0
  description: API for building WhatsApp AI agents
servers:
  - url: https://alpha-plagiocephalic-darrell.ngrok-free.dev
    description: Development
security: []
tags:
  - name: Agents
    description: Create and manage AI agents
  - name: Conversations
    description: Chat conversations and messages
  - name: WhatsApp
    description: WhatsApp Business account management
  - name: Contacts
    description: Contact management
  - name: Integrations
    description: Third-party integrations
paths:
  /api/v1/phone-numbers/{number}/unsubscribe/:
    post:
      tags:
        - api
      description: |-
        Clear default routing on this number entirely.

        Sets ``default_routing=NULL`` and drops both the bot and the
        default webhook. Incoming messages are stored on the conversation
        but no agent or webhook is invoked. When ``applyToExisting`` is
        true and the prior mode was webhook, fires ``subscription.revoked``
        on the old webhook for every inheriting conversation.

        For sandbox numbers the change is scoped to the requesting user's
        own conversation rather than the shared number's defaults.
      operationId: api_v1_phone_numbers_unsubscribe_create
      parameters:
        - in: path
          name: number
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhoneNumber'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumber'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PhoneNumber:
      type: object
      description: Serializer for WhatsappNumber model.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        number:
          type: string
          maxLength: 15
        whatsappPhoneNumberId:
          type: string
        whatsappBusinessAccount:
          type: string
          readOnly: true
        activeAgent:
          type: string
          readOnly: true
        defaultRouting:
          type: string
          readOnly: true
        defaultWebhook:
          type: string
          readOnly: true
        isSandbox:
          type: boolean
          readOnly: true
      required:
        - activeAgent
        - defaultRouting
        - defaultWebhook
        - id
        - isSandbox
        - number
        - whatsappBusinessAccount
        - whatsappPhoneNumberId
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key authentication. Pass your API key in the X-API-Key header.

````