Customer.io Alias API

Merge two user identities by creating an alias linking a new identity to an existing one.

Business capability
Customer Data Management BC-420.10

Operations 1

POST /alias Merge profiles #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/customer-io-alias-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

customer-io-alias-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 1.0.0
  title: Pipelines Alias API
  description: '# Overview

    In general, you''ll consume this API through one of our source libraries—our JavaScript client library or any of our server packages.'
servers:
- url: https://cdp.customer.io/v1
  description: The base URL for all Data Pipelines calls in our United States (US) region.
- url: https://cdp-eu.customer.io/v1
  description: The base URL for all Data Pipelines calls in our European Union (EU) region.
tags:
- name: Alias
paths:
  /alias:
    post:
      operationId: alias
      summary: Merge profiles
      description: '*You **only** need to use this method to support a few select destinations like Mixpanel.*


        The `alias` method reconciles identifiers in systems that don''t automatically handle identity changes—like when a person graduates from an anonymous user to an identified user.


        For example, a person typically has an `anonymousId` until you identify them by `userId`. Most destinations will automatically associate data from the anonymous ID with the new user ID when you send an `identify` call. But a select few destinations, like Mixpanel, won''t! The `alias` call tells Mixpanel to represent the `anonymousId` with the new `userId`.


        If you need to use the `alias` call, you''ll want to send it before you identify someone with a `userId`.


        If you use our web or server-side libraries, and you''ve already identified someone, we assume that this is the `userId` that you want to keep. Otherwise, you need to pass both the `previousId` and the `userId`.


        **When you use our libraries, you''ll typically only provide the `previousId` and `userId`. The libraries fill in the rest of the payload automatically.**'
      servers:
      - url: https://cdp.customer.io/v1
        description: This is a Data Pipeline API.
      security:
      - Basic-Auth: []
      parameters:
      - name: X-Strict-Mode
        in: header
        description: 'When set to `1`, enables strict validation that returns proper HTTP error codes (400/401) for validation failures. When not set or set to any other value, the API operates in permissive mode, logging errors but returning HTTP 200. [Learn more](/integrations/api/track-vs-cdp-api#pipelines-strict-mode)

          '
        required: false
        schema:
          type: string
          enum:
          - '1'
        example: '1'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/alias'
      x-codeSamples:
      - lang: json
        label: JSON
        source: "{\n  \"previousId\": \"string\",\n  \"userId\": \"string\"\n}"
      - label: Curl
        lang: shell
        source: "curl --request POST \\\n  --url https://cdp.customer.io/v1/alias \\\n  -u api_key: \\\n  -H 'content-type: application/json' \\\n  -d '{\"previousId\":\"23adfd82-aa0f-45a7-a756-24f2a7a4c895\",\"userId\":\"97980cfea0067\"}'\n"
      - label: JavaScript (SDK)
        lang: javascript
        source: 'analytics.alias("old-id","new-id");

          '
      - label: Node.js (SDK)
        lang: javascript
        source: 'analytics.alias({ previousId: ''anonymous_user'', userId: ''identified@example.com'' })

          '
      - label: Python (SDK)
        lang: python
        source: 'analytics.alias(previous_id, user_id)

          '
      - label: Go (SDK)
        lang: go
        source: "client.Enqueue(analytics.Alias{\n  PreviousId: anonymousUser,\n  UserId:     \"019mr8mf4r\",\n})\n"
      responses:
        '200':
          $ref: '#/components/responses/200'
      tags:
      - Alias
components:
  responses:
    '200':
      description: A successful request returns an empty object response.
  schemas:
    alias:
      x-scalar-ignore: true
      type: object
      required:
      - previousId
      - userId
      properties:
        type:
          type: string
          readOnly: true
          enum:
          - alias
          description: The event type. This is set automatically by the request method/endpoint.
        previousId:
          type: string
          description: The anonymousId or userId value that you want to merge into the canonical profile.
        userId:
          type: string
          description: 'The userId that you want to keep. This is required if you haven''t already identified someone with one of our web or server-side libraries.

            '
  securitySchemes:
    Basic-Auth:
      type: http
      scheme: basic
      description: 'The Data Pipelines API uses a basic authentication scheme with your API key. Because basic authorization typically expects a username and password combination, you''ll use the API Key as the username and leave the password blank—base64 encoding your credentials in the format `API_key:`.

        '