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

# Unsubscribe a Recipient

> # Description

Unsubscribe a recipient by its url hash where
`unsubscribeUrlHash` value in url is the `unsubscribeUrlHash` for the campaign recipient that wants to unsubscribe.

# Validations

- If `unsubscribeUrlHash` is not present an error with 400 status code will be returned.
- If the `captchaValue` is not present in request body it will return an error with 400 status code.
- If campaign recipient is not found it will return an error with 404 status code.

# Response

No response with a 204 status.

# Body

The body for the request is an object that contains the properties `captchaValue` that is the token generated by google recaptcha.

# Description

Unsubscribe a recipient by its url hash where
`unsubscribeUrlHash` value in url is the `unsubscribeUrlHash` for the campaign recipient that wants to unsubscribe.

# Validations

* If `unsubscribeUrlHash` is not present an error with 400 status code will be returned.
* If the `captchaValue` is not present in request body it will return an error with 400 status code.
* If campaign recipient is not found it will return an error with 404 status code.

# Response

No response with a 204 status.

# Body

The body for the request is an object that contains the properties `captchaValue` that is the token generated by google recaptcha.


## OpenAPI

````yaml POST /recipients/unsubscribeRecipientByHash/{unsubscribeUrlHash}
openapi: 3.0.3
info:
  title: SightX API
  version: 1.0.0
  description: >-
    SightX REST API documentation. Most responses are JSON; some export
    endpoints return files. API access is a paid add-on — contact
    sales@sightx.io for details.
servers:
  - url: https://auth.admin.sightx.io
    description: Authentication (Production)
  - url: https://auth.staging-admin.sightx.io
    description: Authentication (Staging)
security:
  - AuthorizationHeader: []
paths:
  /recipients/unsubscribeRecipientByHash/{unsubscribeUrlHash}:
    post:
      summary: Unsubscribe a Recipient
      description: >-
        # Description


        Unsubscribe a recipient by its url hash where

        `unsubscribeUrlHash` value in url is the `unsubscribeUrlHash` for the
        campaign recipient that wants to unsubscribe.


        # Validations


        - If `unsubscribeUrlHash` is not present an error with 400 status code
        will be returned.

        - If the `captchaValue` is not present in request body it will return an
        error with 400 status code.

        - If campaign recipient is not found it will return an error with 404
        status code.


        # Response


        No response with a 204 status.


        # Body


        The body for the request is an object that contains the properties
        `captchaValue` that is the token generated by google recaptcha.
      operationId: >-
        unsubscribe-a-recipient-post-recipients-unsubscriberecipientbyhash-unsubscribeurlhash
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
            example:
              captchaValue: token_generated_by_google_recaptcha
      responses:
        '200':
          description: Successful response
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '500':
          description: Internal server error
      servers:
        - url: https://campaigns.sightx.io
components:
  securitySchemes:
    AuthorizationHeader:
      type: apiKey
      in: header
      name: Authorization
      description: Access token obtained from the m2m-token endpoint.

````