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

# Send event data (single)

> イベントデータの単一インスタンスを指定されたイベントタイプに送信します。

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>;
};

export const SupportedProducts = ({marketing, sales, service, cms, marketingLevel, salesLevel, serviceLevel, cmsLevel}) => {
  const translations = {
    header: "サポートされる製品",
    description: "次のいずれかの製品またはそれ以上が必要です。",
    productNames: {
      marketing: "Marketing Hub",
      sales: "Sales Hub",
      service: "Service Hub",
      cms: "Content Hub"
    },
    tiers: {
      free: "無料ツール",
      starter: "Starter",
      professional: "Professional",
      enterprise: "Enterprise"
    }
  };
  const translateTier = tier => {
    if (!tier) return '';
    const lowerTier = tier.toLowerCase();
    return translations.tiers[lowerTier] || tier;
  };
  const products = [{
    name: marketing ? translations.productNames.marketing : '',
    level: translateTier(marketingLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/marketing-bolt.svg",
    alt: "Marketing Hub"
  }, {
    name: sales ? translations.productNames.sales : '',
    level: translateTier(salesLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/sales-star.svg",
    alt: "Sales Hub"
  }, {
    name: service ? translations.productNames.service : '',
    level: translateTier(serviceLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/service-heart.svg",
    alt: "Service Hub"
  }, {
    name: cms ? translations.productNames.cms : '',
    level: translateTier(cmsLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/content-play.svg",
    alt: "Content Hub"
  }].filter(product => product.name && product.level);
  if (products.length === 0) return null;
  return <div>
      <div className="text-sm mb-2">{translations.description}</div>
      <div className={`grid ${products.length === 1 ? 'grid-cols-1' : 'grid-cols-2'} gap-1.5`}>
        {products.map((product, index) => <div key={index} style={{
    display: 'flex',
    alignItems: 'center'
  }}>
            <img src={product.icon} alt={product.alt} className="w-3.5 h-3.5 mr-1.5 mt-2.5 mb-2.5 flex-shrink-0 align-middle" />
            <span className="font-medium mr-1 text-sm">{product.name} -</span>
            <span className="text-sm">{product.level}</span>
          </div>)}
      </div>
    </div>;
};

<AccordionGroup>
  <Accordion title="Supported products" defaultOpen="true" icon="cubes">
    <SupportedProducts marketing={true} sales={true} service={true} cms={true} marketingLevel="FREE" salesLevel="FREE" serviceLevel="FREE" cmsLevel="FREE" />
  </Accordion>

  <Accordion title="Required Scopes" icon="key">
    <ScopesList
      scopes={[
  'crm.schemas.contacts.write',
  'crm.objects.deals.sensitive.write.v2',
  'tickets',
  'crm.objects.companies.highly_sensitive.write.v2',
  'crm.objects.deals.highly_sensitive.write.v2',
  'tickets.sensitive.v2',
  'crm.objects.deals.write',
  'crm.objects.companies.write',
  'tickets.highly_sensitive.v2',
  'crm.schemas.deals.write',
  'crm.objects.companies.sensitive.write.v2',
  'crm.objects.contacts.write',
  'crm.schemas.companies.write',
  'crm.objects.contacts.highly_sensitive.write.v2',
  'crm.objects.contacts.sensitive.write.v2',
  'timeline'
]}
    />
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml specs/legacy/v3/crm-timeline-v3.json POST /integrators/timeline/v3/events
openapi: 3.0.1
info:
  title: タイムライン
  description: Basepom for all HubSpot Projects
  version: v3
  x-hubspot-product-tier-requirements:
    marketing: FREE
    sales: FREE
    service: FREE
    cms: FREE
    commerce: FREE
    crmHub: FREE
    dataHub: FREE
  x-hubspot-api-use-case: >-
    ウェブサイトで新しい一連の登録フローをセットアップしたら、コンタクトが完了したフローを示すようにコンタクトタイムラインを更新します。各イベントには、イベントに関する追加の外部データを表示するiframeを開くリンクを含めることもできます。
  x-hubspot-related-documentation:
    - name: Timeline Events Guide
      url: https://developers.hubspot.com/docs/guides/api/crm/extensions/timeline
  x-hubspot-introduction: >-
    タイムラインイベントAPIを使用して、カスタムイベント情報をCRMレコードタイムラインに追加します。最初に公開アプリを作成してから、イベントデータを表示するイベントテンプレートを作成する必要があります。
servers:
  - url: https://api.hubapi.com
security: []
tags:
  - name: Advanced
  - name: Basic
  - name: Batch
paths:
  /integrators/timeline/v3/events:
    post:
      tags:
        - Advanced
      summary: イベントデータを送信（単一）
      description: イベントデータの単一インスタンスを指定されたイベントタイプに送信します。
      operationId: post-/integrators/timeline/v3/events_create
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TimelineEvent'
        required: true
      responses:
        '201':
          description: successful operation
          headers:
            Location:
              description: URL of the newly created resource
              style: simple
              explode: false
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimelineEventResponse'
        default:
          $ref: '#/components/responses/Error'
          description: ''
      deprecated: true
      security:
        - oauth2:
            - crm.objects.contacts.highly_sensitive.write.v2
        - oauth2:
            - crm.objects.contacts.write
        - oauth2:
            - crm.objects.contacts.sensitive.write.v2
        - oauth2:
            - crm.schemas.contacts.write
        - oauth2:
            - crm.objects.companies.write
        - oauth2:
            - crm.objects.companies.sensitive.write.v2
        - oauth2:
            - crm.objects.companies.highly_sensitive.write.v2
        - oauth2:
            - crm.schemas.companies.write
        - oauth2:
            - crm.schemas.deals.write
        - oauth2:
            - crm.objects.deals.write
        - oauth2:
            - crm.objects.deals.sensitive.write.v2
        - oauth2:
            - crm.objects.deals.highly_sensitive.write.v2
        - oauth2:
            - tickets
        - oauth2:
            - tickets.sensitive.v2
        - oauth2:
            - tickets.highly_sensitive.v2
        - oauth2:
            - timeline.write
        - oauth2:
            - timeline
components:
  schemas:
    TimelineEvent:
      required:
        - eventTemplateId
        - id
        - tokens
      type: object
      properties:
        customObjectTypeId:
          type: string
        domain:
          type: string
          description: イベントドメイン（UTKとペアになることが多い）。
        email:
          type: string
          description: >-
            コンタクト固有のイベントに使用されるEメールアドレス。既存のコンタクトの特定、新規作成、既存のコンタクトのEメールの変更に使用できます（「objectId」とペアになっている場合）。
        eventTemplateId:
          type: string
          description: イベントテンプレートID。
        extraData:
          type: object
          properties: {}
          description: テンプレートのMarkdownによって解釈可能な追加のイベント固有データ。
        id:
          type: string
          description: >-
            イベントのID。任意であり、渡さないことをお勧めします。省略すると、自動で作成されます。IDの任意の場所で「{{uuid}}」を使用して固有の文字列を生成し、確実に重複させないようにすることもできます。
        objectId:
          type: string
          description: CRMオブジェクトID。コンタクト以外の全てのイベントに必要です（コンタクトの場合は、UTKまたはEメールを使用できます）。
        timelineIFrame:
          $ref: '#/components/schemas/TimelineEventIFrame'
        timestamp:
          type: string
          description: >-
            イベントが発生した日時。渡されなかった場合、現在の時刻であると想定されます。イベントがCRMオブジェクトのタイムラインに表示される場所を決定するために使用されます。
          format: date-time
        tokens:
          type: object
          additionalProperties:
            type: string
          description: テンプレートトークンに関連付けられているトークンキーと値のコレクション。
        utk:
          type: string
          description: >-
            「utk」パラメーターを使用して、「usertoken」によってイベントをコンタクトに関連付けます。ユーザーのEメールアドレスは分からないが、Cookieにユーザーを特定するトークンが含まれている場合にお勧めします。
    TimelineEventResponse:
      required:
        - eventTemplateId
        - id
        - objectType
        - tokens
      type: object
      properties:
        createdAt:
          type: string
          description: 使用されません。
          format: date-time
        customObjectTypeId:
          type: string
        domain:
          type: string
          description: イベントドメイン（UTKとペアになることが多い）。
        email:
          type: string
          description: >-
            コンタクト固有のイベントに使用されるEメールアドレス。既存のコンタクトの特定、新規作成、既存のコンタクトのEメールの変更に使用できます（「objectId」とペアになっている場合）。
        eventTemplateId:
          type: string
          description: イベントテンプレートID。
        extraData:
          type: object
          properties: {}
          description: テンプレートのMarkdownによって解釈可能な追加のイベント固有データ。
        id:
          type: string
          description: >-
            イベントのID。アプリやイベントテンプレートに対して固有である必要があります。異なるCRMオブジェクトに同じIDを使用すると、最後に処理したオブジェクトが残り、最初のオブジェクトにはレコードがなくなります。IDの任意の場所で「{{uuid}}」を使用して固有の文字列を生成し、確実に重複させないようにすることもできます。
        objectId:
          type: string
          description: CRMオブジェクトID。コンタクト以外の全てのイベントに必要です（コンタクトの場合は、UTKまたはEメールを使用できます）。
        objectType:
          type: string
          description: EventTemplateに関連付けられているObjectType。
        timelineIFrame:
          $ref: '#/components/schemas/TimelineEventIFrame'
        timestamp:
          type: string
          description: >-
            イベントが発生した日時。渡されなかった場合、現在の時刻であると想定されます。イベントがCRMオブジェクトのタイムラインに表示される場所を決定するために使用されます。
          format: date-time
        tokens:
          type: object
          additionalProperties:
            type: string
          description: テンプレートトークンに関連付けられているトークンキーと値のコレクション。
        utk:
          type: string
          description: >-
            「utk」パラメーターを使用して、「usertoken」によってイベントをコンタクトに関連付けます。ユーザーのEメールアドレスは分からないが、Cookieにユーザーを特定するトークンが含まれている場合にお勧めします。
    TimelineEventIFrame:
      required:
        - headerLabel
        - height
        - linkLabel
        - url
        - width
      type: object
      properties:
        headerLabel:
          type: string
          description: iframeコンテンツが表示されるモーダルウィンドウのラベル。
        height:
          type: integer
          description: モーダルウィンドウの高さ（ピクセル）。
          format: int32
        linkLabel:
          type: string
          description: iframeが表示されるリンクを表示するテキスト。
        url:
          type: string
          description: iframeコンテンツのURI。
        width:
          type: integer
          description: モーダルウィンドウの幅（ピクセル）。
          format: int32
    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: エラーに関する具体的な詳細が含まれる特定のカテゴリー
      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: エラーに関する具体的な詳細が含まれる特定のカテゴリー
  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:
            crm.objects.companies.highly_sensitive.read.v2: ''
            crm.objects.companies.highly_sensitive.write.v2: ''
            crm.objects.companies.read: ''
            crm.objects.companies.sensitive.read.v2: ''
            crm.objects.companies.sensitive.write.v2: ''
            crm.objects.companies.write: ''
            crm.objects.contacts.highly_sensitive.read.v2: ''
            crm.objects.contacts.highly_sensitive.write.v2: ''
            crm.objects.contacts.read: ''
            crm.objects.contacts.sensitive.read.v2: ''
            crm.objects.contacts.sensitive.write.v2: ''
            crm.objects.contacts.write: ''
            crm.objects.deals.highly_sensitive.read.v2: ''
            crm.objects.deals.highly_sensitive.write.v2: ''
            crm.objects.deals.read: ''
            crm.objects.deals.sensitive.read.v2: ''
            crm.objects.deals.sensitive.write.v2: ''
            crm.objects.deals.write: ''
            crm.schemas.companies.read: ''
            crm.schemas.companies.write: ''
            crm.schemas.contacts.read: ''
            crm.schemas.contacts.write: ''
            crm.schemas.deals.read: ''
            crm.schemas.deals.write: ''
            developers-read: ''
            developers-write: ''
            tickets: ''
            tickets.highly_sensitive.v2: ''
            tickets.sensitive.v2: ''
            timeline: ''
            timeline.read: ''
            timeline.write: ''

````