> ## 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.

# Generate subscription links

> 登録読者のコミュニケーション設定リンクを生成します。このエンドポイントを使用すると、設定の管理や配信停止のためのURLを作成でき、アプリケーションにコミュニケーション設定を統合する際に役立ちます。[設定ページURLの生成と潜在的な問題のトラブルシューティング]（https://developers.hubspot.com/docs/api-reference/legacy/communication-preferences/generate-url-guide）についてもっと詳しく。

> [accordion] Supported products

> [accordion] Required Scopes


## OpenAPI

````yaml specs/legacy/v4/communication-preferences-subscriptions-v4.json POST /communication-preferences/v4/links/generate
openapi: 3.0.1
info:
  title: Communication Preferences Subscriptions
  description: Basepom for all HubSpot Projects
  version: v4
  x-hubspot-product-tier-requirements:
    marketing: STARTER
    sales: FREE
    service: FREE
    cms: FREE
    commerce: FREE
    crmHub: FREE
    dataHub: FREE
  x-hubspot-related-documentation:
    - name: Subscriptions preferences guide
      url: https://developers.hubspot.com/docs/guides/api/marketing/subscriptions
servers:
  - url: https://api.hubapi.com
security: []
tags:
  - name: Definitions
  - name: Status
paths:
  /communication-preferences/v4/links/generate:
    post:
      tags:
        - Status
      summary: 配信登録リンクを生成
      description: >-
        登録読者のコミュニケーション設定リンクを生成します。このエンドポイントを使用すると、設定の管理や配信停止のためのURLを作成でき、アプリケーションにコミュニケーション設定を統合する際に役立ちます。[設定ページURLの生成と潜在的な問題のトラブルシューティング]（https://developers.hubspot.com/docs/api-reference/legacy/communication-preferences/generate-url-guide）についてもっと詳しく。
      operationId: >-
        post-/communication-preferences/v4/links/generate_/communication-preferences/v4/links/generate
      parameters:
        - name: channel
          in: query
          description: リンクを生成するコミュニケーションチャネル。「EMAIL」である必要があります。
          required: true
          style: form
          explode: true
          schema:
            type: string
            enum:
              - EMAIL
        - name: businessUnitId
          in: query
          description: リンクを生成しているビジネスユニットのID。デフォルトは0です。
          required: false
          style: form
          explode: true
          schema:
            type: integer
            format: int64
            default: 0
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkGenerationRequest'
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkGenerationResponse'
        default:
          $ref: '#/components/responses/Error'
          description: ''
      security:
        - oauth2:
            - communication_preferences.read_write
components:
  schemas:
    LinkGenerationRequest:
      required:
        - subscriberIdString
      type: object
      properties:
        language:
          type: string
          description: コミュニケーション設定リンクを表示する言語で、文字列として表されます。
        subscriberIdString:
          type: string
          description: 登録読者の固有IDで、文字列として表されます。このプロパティーは必須です。
        subscriptionId:
          type: integer
          description: 配信登録の固有IDで、整数として表されます。
          format: int64
    LinkGenerationResponse:
      required:
        - managePreferencesUrl
        - subscriberIdString
        - unsubscribeAllUrl
      type: object
      properties:
        managePreferencesUrl:
          type: string
          description: 購読者がコミュニケーション設定を管理できるページに誘導するURL文字列。
        subscriberIdString:
          type: string
          description: 登録読者の固有IDで、文字列として表されます。
        unsubscribeAllUrl:
          type: string
          description: 登録読者がすべてのコミュニケーションを配信停止できるURL文字列。
        unsubscribeSingleUrl:
          type: string
          description: 登録読者が単一のコミュニケーションタイプを配信停止できるURL文字列。
    Error:
      required:
        - category
        - correlationId
        - message
      type: object
      properties:
        category:
          type: string
          description: エラーカテゴリー
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: エラー条件に関する背景状況
          example: >-
            {invalidPropertyName=[propertyValue], missingScopes=[scope1,
            scope2]}
        correlationId:
          type: string
          description: リクエストの固有ID。エラー報告またはサポートチケットには必ずこの値を含めてください
          format: uuid
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
        errors:
          type: array
          description: エラーに関する詳細情報
          items:
            $ref: '#/components/schemas/ErrorDetail'
        links:
          type: object
          additionalProperties:
            type: string
          description: エラーまたは推奨の修正手順に関するドキュメントが含まれる関連付けられたURIへのリンク名の対応付け
        message:
          type: string
          description: エラーと修正手順（該当する場合）を記した、人が理解できるメッセージ
          example: An error occurred
        subCategory:
          type: string
          description: エラーに関する具体的な詳細が含まれる特定のカテゴリー
      description: >-
        操作が失敗した際にAPIから返されるエラーレスポンスを表します。このコンポーネントは、発生したエラーに関する詳細情報を提供するために、さまざまなエンドポイントで使用されます。
      example:
        message: Invalid input (details will vary based on the error)
        correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf
        category: VALIDATION_ERROR
        links:
          knowledge-base: https://www.hubspot.com/products/service/knowledge-base
    ErrorDetail:
      required:
        - message
      type: object
      properties:
        code:
          type: string
          description: エラーの詳細に関連付けられているステータスコード
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: エラー条件に関する背景状況
          example: '{missingScopes=[scope1, scope2]}'
        in:
          type: string
          description: エラーが見つかったフィールドまたはパラメーターの名前。
        message:
          type: string
          description: エラーと修正手順（該当する場合）を記した、人が理解できるメッセージ
        subCategory:
          type: string
          description: エラーに関する具体的な詳細が含まれる特定のカテゴリー
      description: >-
        APIで発生したエラーに関する詳細情報を表します。このコンポーネントは、通常、エラーレスポンスの一部として、エラーに関する追加の背景情報と詳細を提供するために使用されます。
  responses:
    Error:
      description: An error occurred.
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.hubspot.com/oauth/authorize
          tokenUrl: https://api.hubapi.com/oauth/v1/token
          scopes:
            communication_preferences.read_write: ''
            communication_preferences.statuses.batch.read: ''
            communication_preferences.statuses.batch.write: ''

````