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

# Aggregate company email touchpoints

> Returns outbound and inbound Exchange email counts, plus the latest outbound and inbound dates, for up to 100 companies over a date range of up to 365 days. Both `start` and `end` are floored to UTC midnight, and the interval is half-open: `start` is inclusive and `end` is exclusive. Results are aggregate numbers only and are scoped to your organization, so they include emails the caller can't open individually. No subjects, bodies, or addresses are returned. Results are cached and can be up to about an hour old. **Outbound** and **inbound** are directional email touchpoints as defined for [company email touchpoints](/help/integrations/exchange#company-email-touchpoints); an inbound count is not a confirmed reply.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/companies/email-touchpoints/aggregate
openapi: 3.1.0
info:
  title: Metal API
  version: 1.0.0
  description: >-
    REST API for Metal, the AI context layer for financial firms. Manage
    companies, deals, people, documents, activities, enrichments, scores,
    screenings, lists, workflows, and more. All endpoints are versioned under
    /v1, return JSON, and are scoped to the organization that owns your API key.
  contact:
    name: Metal Support
    email: support@metal.ai
    url: https://www.metal.ai
servers:
  - url: https://api.metal.ai
    description: Production
security:
  - MetalClientId: []
    MetalApiKey: []
tags:
  - name: API keys
    description: Check which API key a request is using.
  - name: Companies
    description: Manage and enrich companies.
  - name: Deals
    description: Track opportunities through your pipeline.
  - name: People
    description: Manage contacts and relationships.
  - name: Documents
    description: Search and retrieve ingested documents.
  - name: Activities
    description: Log and search meetings, calls, and other interactions.
  - name: Enrichments
    description: Read and write enriched property values on resources.
  - name: Scores
    description: Score companies and deals against scoring frameworks.
  - name: Screenings
    description: Run and manage AI-powered company screenings.
  - name: Lists
    description: Organize and enrich resources in bulk.
  - name: Tags
    description: Label companies, deals, and lists.
  - name: Industries
    description: Manage your organization's industry taxonomy.
  - name: Sectors
    description: Manage sectors within an industry.
  - name: Subsectors
    description: Manage subsectors within a sector.
  - name: Workflows
    description: Run and monitor AI workflows.
  - name: Data
    description: Query time-series metrics and observations.
  - name: Teams
    description: Manage deal teams and their members.
  - name: Workspaces
    description: Organize documents and data by workspace.
  - name: Inference
    description: Run single LLM completions scoped to your organization.
paths:
  /v1/companies/email-touchpoints/aggregate:
    post:
      tags:
        - Companies
      summary: Aggregate company email touchpoints
      description: >-
        Returns outbound and inbound Exchange email counts, plus the latest
        outbound and inbound dates, for up to 100 companies over a date range of
        up to 365 days. Both `start` and `end` are floored to UTC midnight, and
        the interval is half-open: `start` is inclusive and `end` is exclusive.
        Results are aggregate numbers only and are scoped to your organization,
        so they include emails the caller can't open individually. No subjects,
        bodies, or addresses are returned. Results are cached and can be up to
        about an hour old. **Outbound** and **inbound** are directional email
        touchpoints as defined for [company email
        touchpoints](/help/integrations/exchange#company-email-touchpoints); an
        inbound count is not a confirmed reply.
      operationId: aggregateCompanyEmailTouchpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyEmailTouchpointsRequest'
            example:
              companyIds:
                - 665f1c2a9b1e4a0012a3b4c5
              start: '2026-01-01T00:00:00Z'
              end: '2026-04-01T00:00:00Z'
      responses:
        '200':
          description: Email touchpoint counts for each requested company.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyEmailTouchpointsResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    CompanyEmailTouchpointsRequest:
      type: object
      required:
        - companyIds
        - start
        - end
      properties:
        companyIds:
          type: array
          description: IDs of companies in your organization. Duplicate IDs return one row.
          minItems: 1
          maxItems: 100
          items:
            type: string
        start:
          type: string
          format: date-time
          description: >-
            Start of the interval (inclusive), in RFC 3339 format. Floored to
            UTC midnight.
        end:
          type: string
          format: date-time
          description: >-
            End of the interval (exclusive), in RFC 3339 format. Floored to UTC
            midnight. After flooring, it must be later than the floored `start`
            and no more than 365 days after it; equal floored bounds return
            `400`.
    CompanyEmailTouchpointsResult:
      type: object
      properties:
        data:
          type: object
          properties:
            start:
              type: string
              format: date-time
              description: Normalized start of the interval.
            end:
              type: string
              format: date-time
              description: Normalized end of the interval.
            computedAt:
              type: string
              format: date-time
              description: When Metal computed the result.
            companies:
              type: array
              description: >-
                One row per requested company, sorted by ID. Companies with no
                touchpoints return zero counts and null dates.
              items:
                $ref: '#/components/schemas/CompanyEmailTouchpoint'
            totals:
              $ref: '#/components/schemas/CompanyEmailTouchpointTotals'
              description: >-
                Distinct message counts across all requested companies. An email
                linked to several companies counts once here, so totals can be
                lower than the sum of the rows.
    CompanyEmailTouchpoint:
      type: object
      properties:
        companyId:
          type: string
        outboundCount:
          type: integer
        inboundCount:
          type: integer
        lastOutboundAt:
          type:
            - string
            - 'null'
          format: date-time
        lastInboundAt:
          type:
            - string
            - 'null'
          format: date-time
    CompanyEmailTouchpointTotals:
      type: object
      description: >-
        Distinct message counts across all requested companies. An email linked
        to several companies counts once here, so totals can be lower than the
        sum of the rows.
      properties:
        distinctOutboundCount:
          type: integer
        distinctInboundCount:
          type: integer
    Error:
      type: object
      properties:
        error:
          type: string
          description: A human-readable error message.
  responses:
    BadRequest:
      description: The request body or parameters are invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid request body
    Unauthorized:
      description: Missing or invalid API key credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: invalid api key or clientId
    NotFound:
      description: The resource does not exist in your organization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: not found
  securitySchemes:
    MetalClientId:
      type: apiKey
      in: header
      name: x-metal-client-id
      description: The Client ID of your API key.
      x-default: <client-id>
    MetalApiKey:
      type: apiKey
      in: header
      name: x-metal-api-key
      description: The secret value of your API key.
      x-default: <api-key>

````

## Related topics

- [Microsoft Exchange integration: mail, calendar, contacts](https://docs.metal.ai/help/integrations/exchange.md)
- [Changelog](https://docs.metal.ai/help/changelog.md)
- [Investor relations: funds, LPs, fundraising](https://docs.metal.ai/help/investor-relations.md)
- [Create a person](https://docs.metal.ai/api-reference/people/create-a-person.md)
- [Data model](https://docs.metal.ai/concepts/data-model.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.