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

# Get email events

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/email-analytics-v1.json GET /email/public/v1/events
openapi: 3.0.0
info:
  title: Email Analytics API v1
  version: 1.0.0
  description: >-
    Use the email analytics API to fetch events generated by marketing emails,
    such as sends, bounces, and clicks.
servers:
  - url: https://api.hubapi.com
    description: HubSpot API Server
security: []
paths:
  /email/public/v1/events:
    get:
      summary: Get email events
      description: >-
        This endpoint is used to query the event log for events matching
        specified parameters.
      operationId: getEmailEvents
      parameters:
        - name: appId
          in: query
          description: >-
            Only return events which correspond to the given HubSpot Application
            ID.
          schema:
            type: integer
        - name: campaignId
          in: query
          description: Only return events from the given HubSpot Campaign ID.
          schema:
            type: integer
        - name: recipient
          in: query
          description: Only return events related to the given recipient.
          schema:
            type: string
        - name: eventType
          in: query
          description: Only return events of the specified type (case-sensitive).
          schema:
            type: string
        - name: startTimestamp
          in: query
          description: >-
            Only return events which occurred at or after the given timestamp
            (in milliseconds since epoch).
          schema:
            type: integer
            format: int64
        - name: endTimestamp
          in: query
          description: >-
            Only return events which occurred at or before the given timestamp
            (in milliseconds since epoch).
          schema:
            type: integer
            format: int64
        - name: offset
          in: query
          description: An offset token returned by a previous call to this endpoint.
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            The maximum number of events to return. If omitted, the default
            value of 10 is used. The maximum allowed value is 1000.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 10
        - name: excludeFilteredEvents
          in: query
          description: >-
            Only return events that have not been filtered out due to customer
            filtering settings. The default value is false.
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Email events retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailEventsResponse'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    EmailEventsResponse:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/EmailEvent'
        hasMore:
          type: boolean
          description: Whether there are more results available
        offset:
          type: string
          description: Offset token for pagination
      required:
        - events
        - hasMore
        - offset
    Error:
      type: object
      properties:
        category:
          type: string
          description: The error category
        correlationId:
          type: string
          description: A unique identifier for the request
        message:
          type: string
          description: A human readable message describing the error
        subCategory:
          type: string
          description: >-
            A specific category that contains more specific detail about the
            error
        errors:
          type: array
          description: Further information about the error
          items:
            $ref: '#/components/schemas/ErrorDetail'
        context:
          type: object
          description: Context about the error condition
        links:
          type: object
          description: A map of link names to associated URIs
      required:
        - category
        - correlationId
        - message
    EmailEvent:
      type: object
      properties:
        appId:
          type: integer
          description: The application ID
        appName:
          type: string
          description: The application name
        browser:
          $ref: '#/components/schemas/BrowserInfo'
        created:
          type: integer
          format: int64
          description: The creation timestamp
        emailCampaignId:
          type: integer
          description: The email campaign ID
        hmid:
          type: string
          description: The HubSpot message ID
        id:
          type: string
          description: The event ID
        location:
          $ref: '#/components/schemas/LocationInfo'
        portalId:
          type: integer
          description: The portal ID
        recipient:
          type: string
          description: The recipient email address
        response:
          type: string
          description: The response message
        sentBy:
          $ref: '#/components/schemas/SentByInfo'
        sendId:
          type: string
          description: The send ID
        smtpId:
          type: string
          description: The SMTP ID
        subject:
          type: string
          description: The email subject
        type:
          type: string
          description: The event type
        userAgent:
          type: string
          description: The user agent
      required:
        - appId
        - appName
        - created
        - emailCampaignId
        - id
        - portalId
        - recipient
        - type
    ErrorDetail:
      type: object
      properties:
        message:
          type: string
          description: A human readable message describing the error
        in:
          type: string
          description: The name of the field or parameter in which the error was found
        code:
          type: string
          description: The status code associated with the error detail
        subCategory:
          type: string
          description: >-
            A specific category that contains more specific detail about the
            error
        context:
          type: object
          description: Context about the error condition
      required:
        - message
    BrowserInfo:
      type: object
      properties:
        family:
          type: string
          description: The browser family
        name:
          type: string
          description: The browser name
        producer:
          type: string
          description: The browser producer
        producerUrl:
          type: string
          description: The producer URL
        type:
          type: string
          description: The browser type
        url:
          type: string
          description: The browser URL
        version:
          type: array
          items:
            type: string
          description: The browser version
    LocationInfo:
      type: object
      properties:
        city:
          type: string
          description: The city
        country:
          type: string
          description: The country
        state:
          type: string
          description: The state
        latitude:
          type: number
          format: float
          description: The latitude
        longitude:
          type: number
          format: float
          description: The longitude
    SentByInfo:
      type: object
      properties:
        created:
          type: integer
          format: int64
          description: The creation timestamp
        id:
          type: string
          description: The ID
      required:
        - created
        - id

````