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

# Update email subscription status for an email address

> Use this endpoint to update an email address' email type subscription status or permanently unsubscribe an email address from all email. Note: If you OPT OUT of all emails or a specific email subscription type for a recipient, there is NO UNDO for this operation.

export const ScopesList = ({scopes = [], description = "この API には、次のいずれかのスコープが必要です。"}) => {
  if (!scopes || scopes.length === 0) {
    return null;
  }
  const sortedScopes = scopes.sort((a, b) => a.localeCompare(b));
  return <div>
      <div className="text-sm mb-2">{description}</div>
      <div>
        {sortedScopes.map((scope, index) => <div key={index}>
            <code>
              <span className="text-xs">{scope}</span>
            </code>
          </div>)}
      </div>
    </div>;
};

<Accordion title="Scope requirements">
  <ScopesList scopes={['content']} />
</Accordion>


## OpenAPI

````yaml specs/legacy/v1/marketing-subscriptions-v1.json PUT /email/public/v1/subscriptions/{email_address}
openapi: 3.0.0
info:
  title: Subscriptions preferences API - V1
  version: 1.0.0
  description: >-
    The subscription preferences APIs allow you to retrieve and manage data on
    the communications that a contact has opted into.
servers:
  - url: https://api.hubapi.com
    description: HubSpot API Server
security: []
paths:
  /email/public/v1/subscriptions/{email_address}:
    put:
      summary: Update email subscription status for an email address
      description: >-
        Use this endpoint to update an email address' email type subscription
        status or permanently unsubscribe an email address from all email. Note:
        If you OPT OUT of all emails or a specific email subscription type for a
        recipient, there is NO UNDO for this operation.
      operationId: updateEmailSubscriptionStatus
      parameters:
        - name: email_address
          in: path
          required: true
          description: The email address for which you are updating subscription status.
          schema:
            type: string
            format: email
      requestBody:
        required: true
        description: Subscription update details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionUpdateRequest'
            examples:
              unsubscribeFromAll:
                summary: Unsubscribe from all emails
                value:
                  unsubscribeFromAll: true
              subscribeSpecific:
                summary: Subscribe to specific email types
                value:
                  subscriptionStatuses:
                    - id: 7
                      subscribed: true
                      optState: OPT_IN
                      legalBasis: PERFORMANCE_OF_CONTRACT
                      legalBasisExplanation: >-
                        We need to send them these emails as part of our
                        agreement with them.
                  portalSubscriptionLegalBasis: LEGITIMATE_INTEREST_CLIENT
                  portalSubscriptionLegalBasisExplanation: >-
                    They told us at a conference that they're interested in
                    receiving communications.
              unsubscribeSpecific:
                summary: Unsubscribe from specific email types
                value:
                  subscriptionStatuses:
                    - id: 7
                      subscribed: false
                      optState: OPT_OUT
      responses:
        '200':
          description: Email subscription status updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionUpdateResponse'
              example:
                status: ok
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SubscriptionUpdateRequest:
      type: object
      properties:
        unsubscribeFromAll:
          type: boolean
          description: Whether to unsubscribe from all emails
        subscriptionStatuses:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionStatusUpdate'
        portalSubscriptionLegalBasis:
          type: string
          enum:
            - LEGITIMATE_INTEREST_PQL
            - LEGITIMATE_INTEREST_CLIENT
            - PERFORMANCE_OF_CONTRACT
            - CONSENT_WITH_NOTICE
            - NON_GDPR
          description: Legal basis for portal-level subscription
        portalSubscriptionLegalBasisExplanation:
          type: string
          description: Explanation for portal-level legal basis
    SubscriptionUpdateResponse:
      type: object
      properties:
        status:
          type: string
          description: Status of the update operation
    Error:
      type: object
      properties:
        status:
          type: string
          description: HTTP status code
        message:
          type: string
          description: Error message
        correlationId:
          type: string
          description: Request correlation ID for debugging
    SubscriptionStatusUpdate:
      type: object
      required:
        - id
        - subscribed
        - optState
      properties:
        id:
          type: integer
          description: Subscription type ID
        subscribed:
          type: boolean
          description: Whether to subscribe to this type
        optState:
          type: string
          enum:
            - OPT_IN
            - OPT_OUT
            - NOT_OPTED
          description: >-
            Determines whether a contact is opted in or out of a given email
            subscription
        legalBasis:
          type: string
          enum:
            - LEGITIMATE_INTEREST_PQL
            - LEGITIMATE_INTEREST_CLIENT
            - PERFORMANCE_OF_CONTRACT
            - CONSENT_WITH_NOTICE
            - NON_GDPR
          description: Legal basis for GDPR compliance
        legalBasisExplanation:
          type: string
          description: Free-form text explaining the legal basis

````