Customer.io Alias API
Merge two user identities by creating an alias linking a new identity to an existing one.
Merge two user identities by creating an alias linking a new identity to an existing one.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/customer-io-alias-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
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. But you can also integrate directly with our REST API if you don''t want to install one of our libraries or you want to support a source that we don''t have a native integration with.
# Server addresses: US and EU
Customer.io hosts services in the United States (US) and European Union. Select the appropriate server address for your region.
| Region | Server Address |
| :-- | :-- |
| US | https://cdp.customer.io |
| EU | https://cdp-eu.customer.io |
If you''re in our EU region, you''ll need to specify the EU URL when you initialize our server-side libraries. If you use our JavaScript client library, we''ll set your region and route data/calls automatically.
# Get an API key
1. Go to the <svg class="icon"><use href="#connection" /></svg> tab and click **Sources**.
1. Click **Add Source**, pick **HTTP**, and click **Next**.
1. Give the source a *Name* and copy your *API Key*. You''ll use this key to authenticate with our API. If you don''t copy the key now, you can always get it later from the *Settings* tab when you''re done setting up your source.
1. (Optional) Test your connection by sending a test call. You can copy your API key into an app like Postman or send a CURL request. If your request is successful, and then you click *Test Connection* we''ll let you know if your request was successful and you''ve set up your HTTP implementation successfully.
1. Click **Submit**.
Now you can use the key as a username with a blank password to authenticate and send requests to our API.
# Authentication & rate limits
Our API uses basic authorization with an API Key provided when you set up a source. If you use Postman or another platform that helps you send API calls, this API key is the *Username*, and the *Password* is blank.
Our sources are all authenticated using a **API Key** that we generate when you create a source.
## Rate and payload limits
A request is limited to 32KB. A batch request is limited to 500KB total and 32KB per call in the request. If a request exceeds these limits, you will receive a 200 response, but the request will not go through.
The Data Pipelines API has a rate limit of 3000 requests per 3 seconds for both active data integrations and historical backfill scripts. This limit applies to both our v1 and v2 APIs.
While this rate is not strictly enforced, consistently exceeding it may lead to throttling or dropped data, especially during periods of high system load. If we detect a sustained high volume that could impact other customers, we may contact you to help adjust your integration or, in rare cases, temporarily block requests.
<div class="fly-panel fly-light regionUS">
<div class="fly-panel-body us-server">
<p class="text--bold">Warning</p>
<p>Rate limits are subject to change. We may adjust these thresholds to ensure stable performance for all customers.</p>
</div></div>
# Try out our postman collection
We''ve generated a Postman collection with all of the endpoints organized as you''ll find them on this page, with a starter environment (mainly to contain your API key). For our API endpoints, **your API key is your username and your password is blank**.
You''ll notice that payloads on this page can contain significantly more information than the payloads that appear in our collection. We''ve limited our collections to the fields that you''ll _typically_ use when you send calls to our APIs and libraries, so it''s easier to get started. But you can add additional fields to payloads—like `context`, `integrations`, and so on—if you want.
If you fork this collection, you might want to disable the *Watch original collection* option. We automatically update our Postman collection whenever we release changes to our documentation, even if we don''t change our APIs—which happens daily! Rather than being flooded with Postman notifications, you can check out our [Release Notes](/release-notes/) for updates to our APIs.
[<img src="https://run.pstmn.io/button.svg" alt="Run In Postman" style="width: 128px; height: 32px;">](https://god.gw.postman.com/run-collection/23697545-287dd370-3d8b-4a71-80fe-75d6b7c7ff61?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D23697545-287dd370-3d8b-4a71-80fe-75d6b7c7ff61%26entityType%3Dcollection%26workspaceId%3D35e4a70d-66bd-4b3e-8a0c-57f9e32080dc#?env%5BCustomer.io%20Data%20Pipelines%20API%20Environment%5D=W3sia2V5IjoiY2RwX2FwaV91cmwiLCJ0eXBlIjoiZGVmYXVsdCIsInZhbHVlIjoiY2RwLmN1c3RvbWVyLmlvIiwiZW5hYmxlZCI6dHJ1ZX0seyJrZXkiOiJ3cml0ZV9rZXkiLCJ0eXBlIjoic2VjcmV0IiwidmFsdWUiOiIiLCJlbmFibGVkIjp0cnVlfV0=)
# Deletions, suppressions, and other semantic events
You''ll notice that this API only contains `POST` calls; we don''t have `DELETE` operations. For delete operations, and other operations that don''t have bespoke endpoints, we use *semantic events*.
When you need to do things like deleting people, removing relationships, and other sorts of things, you''ll send a request to the `/track` endpoint with a specific event `name` parameter. The `name` tells us what to do with the request.
For example, you can send a `track` event with the name `Delete Person` to remove a person from your workspace.
See [Semantic Events](/integrations/data-in/semantic-events/cio-journeys/) to see Customer.io-specific events.
We also support semantic events for other kinds of destinations. See [Semantic Events for other destinations](#semantic-events-for-other-destinations) below for more information.
| Event Name | Description |
|------|--------|
| `Device Created or Updated` | Adds or updates a mobile device (by token), and associates it with a person |
| `Device Deleted` | Deletes a device |
| `User Deleted` | Removes a person from your workspace |
| `User Suppressed` | Removes a person from your workspace and suppresses their identifiers so you can''t add them back to Customer.io. |
| `User Unsuppressed` | Unsuppresses an identifier so you can add someone back to Customer.io and message them again. |
| `Relationship Deleted` | Remove a relationship between a person and an object|
| `Object Deleted` | Remove an object (like an account or company) from your Customer.io workspace|
| `Report Delivery Event` | Report delivery events for messages|
## Semantic events for other destinations
In addition to events that have special meanings [in Customer.io](#customerio-semantic-events), we have a number of other events that we support across different kinds of destinations. These uniform events ensure that we''ll map event data to destinations consistently—so you can move from one provider to another without having to change your event names or payload structures.
For example, our ecommerce events work across any ecommerce platform we integrate with—even if those ecommerce platforms have different APIs or payload structures.
See [Semantic Events](/integrations/data-in/semantic-events/getting-started/) to learn more.
* [A/B Test](/integrations/api/cdp/ab-test/)
* [Ecommerce](/integrations/api/cdp/ecommerce/)
* [Email](/integrations/api/cdp/email/)
* [Live Chat](/integrations/api/cdp/live-chat/)
* [Mobile App](/integrations/api/cdp/mobile-app/)
* [Video](/integrations/api/cdp/video/)
## Backfilling data
By default, Customer.io records a `timestamp` when we receive requests. If you''re sending data to Customer.io in real time, you don''t need to worry about the timestamp.
If you want to backfill requests, you can send a `timestamp`—an ISO 8601 date-time string—telling us when the request occurred. This provides a way to log `track` and `page` calls when the activities _actually_ took place.
'
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](/integrations/data-out/connections/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:`.
'