Customer.io Track v2 API

Track API v2 entity and batch endpoints.

OpenAPI Specification

customerio-track-v2-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Customer.io Broadcasts Track v2 API
  description: Specification of the Customer.io APIs for customer messaging and marketing automation. Covers the Track API (track.customer.io - people, events, devices, manual segments, plus the v2 entity/batch endpoints), the App / Transactional API (api.customer.io - transactional send, API-triggered broadcasts, customers, segments, campaigns, newsletters, messages, exports, collections, snippets, sender identities, imports), and the Pipelines / Data Pipelines CDP API (cdp.customer.io - identify, track, page, screen, group, alias, batch). Authentication differs per surface - the Track API uses HTTP Basic auth with site_id:api_key, the App and Pipelines APIs use a Bearer token.
  termsOfService: https://customer.io/legal/terms-of-service/
  contact:
    name: Customer.io Support
    email: win@customer.io
  version: '1.0'
servers:
- url: https://track.customer.io
  description: Track API (US region)
- url: https://track-eu.customer.io
  description: Track API (EU region)
- url: https://api.customer.io
  description: App / Transactional API (US region)
- url: https://api-eu.customer.io
  description: App / Transactional API (EU region)
- url: https://cdp.customer.io
  description: Pipelines / Data Pipelines CDP API (US region)
- url: https://cdp-eu.customer.io
  description: Pipelines / Data Pipelines CDP API (EU region)
security:
- basicAuth: []
- bearerAuth: []
tags:
- name: Track v2
  description: Track API v2 entity and batch endpoints.
paths:
  /api/v2/entity:
    post:
      operationId: trackEntityV2
      tags:
      - Track v2
      summary: Create, update, or delete an entity (v2)
      description: Track API v2 single-payload endpoint for people and objects. The type field selects the entity (person or object) and action selects the operation (identify, delete, add_relationships, etc.).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EntityV2'
      responses:
        '200':
          description: Entity processed.
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
      - basicAuth: []
  /api/v2/batch:
    post:
      operationId: trackBatchV2
      tags:
      - Track v2
      summary: Batch entity operations (v2)
      description: Submit up to 32 KB worth of mixed person/object/event operations in a single request.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchV2'
      responses:
        '200':
          description: Batch accepted.
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
      - basicAuth: []
components:
  schemas:
    Identifiers:
      type: object
      description: One or more identifiers locating a person (id, email, or cio_id).
      properties:
        id:
          type: string
        email:
          type: string
        cio_id:
          type: string
    EntityV2:
      type: object
      required:
      - type
      - identifiers
      - action
      properties:
        type:
          type: string
          enum:
          - person
          - object
        action:
          type: string
          enum:
          - identify
          - delete
          - add_relationships
          - delete_relationships
        identifiers:
          $ref: '#/components/schemas/Identifiers'
        attributes:
          type: object
          additionalProperties: true
    BatchV2:
      type: object
      required:
      - batch
      properties:
        batch:
          type: array
          items:
            $ref: '#/components/schemas/EntityV2'
    Error:
      type: object
      properties:
        meta:
          type: object
          properties:
            error:
              type: string
            errors:
              type: array
              items:
                type: string
  responses:
    Unauthorized:
      description: Authentication failed or credentials missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Track API auth. Base-64 encode site_id:api_key and pass it in the Authorization header (Basic ...).
    bearerAuth:
      type: http
      scheme: bearer
      description: App API and Pipelines API auth. Pass the App API key (or Pipelines source write key) as a Bearer token in the Authorization header.