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

# Unsubscribe sender

> Unsubscribe from a sender for the scoped inbox. Looks up List-Unsubscribe from that sender's mail when a link is not provided. Check unsubscribe.success: when it is false the sender was left unchanged.



## OpenAPI

````yaml POST /senders/unsubscribe
openapi: 3.1.0
info:
  title: Inbox Zero API
  version: 1.0.0
  description: >-
    Programmatic access to Inbox Zero inbox stats, automation rules, and sender
    unsubscribe. Docs: https://docs.getinboxzero.com/api-reference/introduction
    Machine-readable schema: /openapi.json Authenticate with an account-scoped
    API key via the API-Key header. Errors return JSON with error.code,
    error.message, and error.hint.
servers:
  - url: https://www.getinboxzero.com/api/v1
    description: Primary server
security:
  - ApiKeyAuth: []
paths:
  /senders/unsubscribe:
    post:
      description: >-
        Unsubscribe from a sender for the scoped inbox. Looks up
        List-Unsubscribe from that sender's mail when a link is not provided.
        Check unsubscribe.success: when it is false the sender was left
        unchanged.
      operationId: unsubscribeSender
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                senderEmail:
                  type: string
                  format: email
                unsubscribeLink:
                  type: string
                  format: uri
                listUnsubscribeHeader:
                  type: string
                  minLength: 1
              required:
                - senderEmail
      responses:
        '200':
          description: Unsubscribe attempt completed
          content:
            application/json:
              schema:
                type: object
                properties:
                  senderEmail:
                    type: string
                    format: email
                  status:
                    type:
                      - string
                      - 'null'
                    enum:
                      - UNSUBSCRIBED
                      - null
                  unsubscribe:
                    type: object
                    properties:
                      attempted:
                        type: boolean
                      success:
                        type: boolean
                      method:
                        type: string
                        enum:
                          - post
                          - get
                          - form
                          - browser
                      statusCode:
                        type: integer
                      reason:
                        type: string
                        enum:
                          - no_unsubscribe_url
                          - unsafe_unsubscribe_url
                          - request_timeout
                          - request_failed
                          - needs_user
                          - request_rejected
                    required:
                      - attempted
                      - success
                required:
                  - senderEmail
                  - status
                  - unsubscribe
        '400':
          description: Invalid query, path, or request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '401':
          description: Missing, invalid, or expired API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '403':
          description: API key lacks a required scope or is not account-scoped
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '405':
          description: HTTP method is not supported for this route
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '429':
          description: Rate limited by the API or email provider
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
        '500':
          description: Unexpected server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
      security:
        - ApiKeyAuth:
            - SENDERS_UNSUBSCRIBE
components:
  schemas:
    PublicApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - BAD_REQUEST
                - UNAUTHORIZED
                - FORBIDDEN
                - NOT_FOUND
                - METHOD_NOT_ALLOWED
                - RATE_LIMITED
                - INTERNAL_ERROR
            message:
              type: string
            hint:
              type: string
          required:
            - code
            - message
            - hint
      required:
        - error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: API-Key
      description: >-
        Account-scoped API key created in Settings.

        Operations declare the scopes they require.

        Available scopes:

        - RULES_READ: List and inspect automation rules for this inbox.

        - RULES_WRITE: Create, update, and delete automation rules for this
        inbox.

        - STATS_READ: Read aggregated inbox statistics for this inbox.

        - SENDERS_UNSUBSCRIBE: Unsubscribe from senders for this inbox.
      x-scopes:
        RULES_READ: List and inspect automation rules for this inbox.
        RULES_WRITE: Create, update, and delete automation rules for this inbox.
        STATS_READ: Read aggregated inbox statistics for this inbox.
        SENDERS_UNSUBSCRIBE: Unsubscribe from senders for this inbox.

````