openapi: 3.0.1
servers:
  - url: https://api.hubapi.com/
info:
  description: HTTP API for triggering instances of custom behavioral events
  title: Custom Behavioral Events API
  version: v3
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_www.hubspot.com_hubfs_assets_hubspot.com_buzz_HubSpotOpenGraph.png
  x-origin:
    - format: openapi
      url: https://api.hubspot.com/api-catalog-public/v1/apis/events/v3/send
      version: "3.0"
  x-providerName: hubapi.com
  x-serviceName: analytics
tags:
  - name: Behavioral_Events_Tracking
paths:
  /events/v3/send:
    post:
      description: Endpoint to send an instance of a behavioral event
      operationId: post-/events/v3/send
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BehavioralEventHttpCompletionRequest"
        required: true
      responses:
        "204":
          content: {}
          description: No content
        default:
          $ref: "#/components/responses/Error"
      security:
        - hapikey: []
        - private_apps_legacy: []
        - oauth2_legacy:
            - analytics.behavioral_events.send
      summary: Sends Custom Behavioral Event
      tags:
        - Behavioral_Events_Tracking
components:
  responses:
    Error:
      content:
        "*/*":
          schema:
            $ref: "#/components/schemas/Error"
      description: An error occurred.
  schemas:
    BehavioralEventHttpCompletionRequest:
      properties:
        email:
          description: Email of visitor
          type: string
        eventName:
          description: Internal name of the event-type to trigger
          type: string
        objectId:
          description: The object id that this event occurred on. Could be a contact id or a visitor id.
          type: string
        occurredAt:
          description: The time when this event occurred (if any). If this isn't set, the current time will be used
          format: date-time
          type: string
        properties:
          additionalProperties:
            type: string
          description: Map of properties for the event in the format property internal name - property value
          type: object
        utk:
          description: User token
          type: string
      required:
        - eventName
        - properties
      type: object
    Error:
      example:
        category: VALIDATION_ERROR
        correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf
        links:
          knowledge-base: https://www.hubspot.com/products/service/knowledge-base
        message: Invalid input (details will vary based on the error)
      properties:
        category:
          description: The error category
          type: string
        context:
          additionalProperties:
            items:
              type: string
            type: array
          description: Context about the error condition
          example:
            invalidPropertyName:
              - propertyValue
            missingScopes:
              - scope1
              - scope2
          type: object
        correlationId:
          description: A unique identifier for the request. Include this value with any error reports or support tickets
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
          format: uuid
          type: string
        errors:
          description: further information about the error
          items:
            $ref: "#/components/schemas/ErrorDetail"
          type: array
        links:
          additionalProperties:
            type: string
          description: A map of link names to associated URIs containing documentation about the error or recommended remediation steps
          type: object
        message:
          description: A human readable message describing the error along with remediation steps where appropriate
          example: An error occurred
          type: string
        subCategory:
          description: A specific category that contains more specific detail about the error
          type: string
      required:
        - category
        - correlationId
        - message
      type: object
    ErrorDetail:
      properties:
        code:
          description: The status code associated with the error detail
          type: string
        context:
          additionalProperties:
            items:
              type: string
            type: array
          description: Context about the error condition
          example:
            missingScopes:
              - scope1
              - scope2
          type: object
        in:
          description: The name of the field or parameter in which the error was found.
          type: string
        message:
          description: A human readable message describing the error along with remediation steps where appropriate
          type: string
        subCategory:
          description: A specific category that contains more specific detail about the error
          type: string
      required:
        - message
      type: object
  securitySchemes:
    hapikey:
      in: query
      name: hapikey
      type: apiKey
    oauth2_legacy:
      flows:
        authorizationCode:
          authorizationUrl: https://app.hubspot.com/oauth/authorize
          scopes:
            analytics.behavioral_events.send: Send Behavioral Event Completions
          tokenUrl: https://api.hubapi.com/oauth/v1/token
      type: oauth2
    private_apps_legacy:
      in: header
      name: private-app-legacy
      type: apiKey
