Download OpenAPI specification:Download
Our App API provides ways to trigger messages and retrieve information about people, campaigns, broadcasts, and more.
The App API provides methods to send transactional messages and trigger broadcasts. In both cases, your payload acts as a message "trigger" and can contain data
that you reference in your messages using liquid—{{trigger.<data>}}
.
The other endpoints help you retrieve information about people, segments, campaigns, broadcasts, etc; it also lets you update campaign actions, messages, newsletter variants, etc. Aside from the API-triggered broadcast (1 per 10 seconds) and Transactional (100 per second) endpoints, requests are limited to 10 per second.
You're looking at our US regional endpoints
The only difference in our US and European Union (EU) regions is the subdomain—api-eu
for our EU region as rather than app.customer.io/v1
for the US; there are no other differences between the two regions. If your account is based in the European Union (EU) data center, click here to show EU endpoints in our code samples and documentation below.
If you don't know your region, you can find your account region on your account's privacy page, or get your region using the API.
You're looking at our EU regional endpoints
The only difference in our US and European Union (EU) regions is the subdomain—api
for our US region rather than api-eu.customer.io/v1
for our EU region; there are no other differences between the two regions. If your account is based in the European Union (EU) data center, you can click here to to show US endpoints in our code samples and documentation below.
Note that if your account is based in the United States (US) data center and you send requests to the EU region (the track-eu
subdomain), your requests will fail. If you don't know your region, you can find your account region on your account's privacy page, or get your region using the API.
Customer.io hosts services in the United States (US) and European Union (EU, host subdomains are suffixed with -eu
). Select the appropriate region for server addresses that apply to your region.
Host/Server | Purpose |
---|---|
https://api.customer.io/ | Use the App API to send Transactional messages and API triggered broadcasts. This API uses bearer token authorization, helping you control who uses it. Most requests to this API are limited to 10 pers second. The exceptions are API-triggered broadcasts, which are limited to 1 request every 10 seconds, and Transactional messages which are limited to 100 per second. |
We've generated a Postman collection with all of our APIs—not just the ones on this page—with a starter environment (called "CIO Env") containing variables for authorization and path parameters.
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 for updates to our APIs.
NOTE: Postman endpoints default to our US APIs. If you're in our European (EU) region, you'll need to add -eu
server variables (track_api_url and app_api_url).
All requests to the Customer.io App API use an App API Key.
To authenticate, provide your key as a Bearer token in a HTTP Authorization header. You can create and manage your API keys—including keys with different scopes—in your account settings page. Each operation on this page references the authorization header it requires.
The App API uses a bearer authentication scheme.
You can generate a bearer token, known as an App API Key, with a defined scope in your account settings. Learn more about bearer authorization in Customer.io.
Security Scheme Type | HTTP |
---|---|
HTTP Authorization Scheme | bearer |
Aside from Transactional and Broadcast trigger endpoints, this API is limited to 10 requests per second. The transactional email endpoint is limited to 100 requests per second. The API-triggered broadcast endpoint is limited to 1 request every 10 seconds.
These two endpoints trigger messages to your audience. They use the same authentication method, but have different limits than the rest of the endpoints.
Manually trigger a broadcast, and provide data to populate messages in your trigger. The shape of the request changes based on the type of audience you broadcast to: a segment, a list of emails, a list of customer IDs, a map of users, or a data file. You can reference properties in the data
object from this request using liquid—{{trigger.<property_in_data_obj>}}
.
If your broadcast produces a 422
error, you can get more information about the errors to see what went wrong.
This endpoint is rate-limited to one request every 10 seconds. After exceeding this, you'll receive a status of 429. Broadcasts are optimized to send messages to a large audience and not for one-to-one interactions. Use our transactional API or event-triggered campaigns to respond to your audience on an individual, one-to-one basis.
broadcast_id required | integer The ID of the broadcast that you want to trigger. |
object Contains information you want to use to populate your broadcast. | |
email_add_duplicates | boolean Default: false an email address associated with more than one profile id is an error. |
email_ignore_missing | boolean Default: false If false a missing email address is an error. |
id_ignore_missing | boolean Default: false If false, a missing customer ID is an error. |
{- "data": {
- "headline": "Roadrunner spotted in Albuquerque!",
- "date": 1511315635,
- "text": "We received reports of a roadrunner in your immediate area! Head to your dashboard to view more information!"
}, - "email_add_duplicates": false,
- "email_ignore_missing": false,
- "id_ignore_missing": false
}
{- "id": 3
}
Send a transactional email. You can send a message using a transactional_message_id
or send your own body
, subject
, and from
values at send time. The transactional_message_id
can be either the numerical ID for the template or the Trigger Name that you assigned the template.
If you want to send your own body
, subject
, and from
values to populate your message at send time, we recommend that you pass a transactional_message_id
anyway; the values you pass in the request will override the template.
You can find your transactional_message_id
from the code sample in the Overview tab for your transactional message in the user interface, or you can look up a list of your transactional messages through the App API.
Customer.io attributes metrics to a transactional_message_id
; if you don't provide a transactional_message_id
, we attribute metrics to "transactional_message_id": 1
. You can create empty transactional messages in the UI and override the body
, subject
, and from
values at send time. This provides flexibility in your integration and lets you organize metrics (rather than gathering metrics for all of your transactional messages against a single ID).
required | integer or string The transactional message template that you want to use for your message. You can call the template by its numerical ID or by the Trigger Name that you assigned the template (case insensitive). |
to required | string The message recipient(s). Supports multiple addresses separated by commas. Your request can contain up to 15 total recipients between the You can include a display or "friendly" name in "to" address, but we recommend that you use quotation marks around the friendly name to avoid potential issues with special characters, e.g. |
required | object Identifies the person represented by your transactional message by one of, and only one of, |
body | string The HTML body of your message. This overrides the body of the transactional template (referenced by |
body_amp | string If your message is an email, this is the AMP-enabled body of your message. If your recipient's email client doesn't support AMP, the |
body_plain | string The plaintext body of your message. This overrides the body of your transactional template (referenced by |
subject | string The subject line for your message. This overrides the subject of the transactional template (referenced by |
from | string The address that your email is from. This address must be verified by Customer.io. This overrides the from address set within the transactional template (referenced by |
language | string Overrides language preferences for the person you want to send your transactional message to. Use one of our supported two- or four-letter language codes. |
object An object containing the key-value pairs referenced using liquid in your message. | |
send_at | integer A unix timestamp (seconds since epoch) determining when the message will be sent. The timestamp can be up to 90 days in the future. If this value is in the past, your message is sent immediately. |
disable_message_retention | boolean Default: false If true, the message body is not retained in delivery history. Setting this value overrides the value set in the settings of your |
send_to_unsubscribed | boolean Default: true If false, your message is not sent to unsubscribed recipients. Setting this value overrides the value set in the settings of your |
queue_draft | boolean Default: false If true, your transactional message is held as a draft in Customer.io and not sent directly to your audience. You must go to the Deliveries and Drafts page to send your message. |
bcc | string Blind copy message recipients. Supports multiple addresses separated by commas. Your request can contain up to 15 total recipients between the |
fake_bcc | boolean If true, rather than sending true copies to BCC addresses, Customer.io sends a copy of the message with the subject line containing the recipient address(es). |
reply_to | string The address that recipients can reply to, if different from the |
preheader | string Also known as "preview text", this is the block block of text that users see next to, or underneath, the subject line in their inbox. |
Array of objects A dictionary of attachments where the filename is the key and the value is the base64-encoded contents. The total size of all attachments must be less than 2 MB. Some filetype extensions are restricted. | |
Array of objects Headers must be strings and cannot contain any non-ASCII characters or empty spaces. Some headers are reserved and cannot be overwritten. | |
disable_css_preprocessing | boolean Default: false Set to |
tracked | boolean Default: true If true, Customer.io tracks opens and link clicks in your message. |
{- "transactional_message_id": 44,
- "to": "cool.person@example.com",
- "from": "override-templated-address@example.com",
- "subject": "Did you really login from a new location?",
- "identifiers": {
- "email": "cool.person@example.com"
}, - "message_data": {
- "password_reset_token": "abcde-12345-fghij-d888",
- "account_id": "123dj"
}, - "bcc": "bcc@example.com",
- "disable_message_retention": false,
- "send_to_unsubscribed": true,
- "tracked": true,
- "queue_draft": false,
- "disable_css_preprocessing": true
}
{- "delivery_id": "string",
- "queued_at": 0
}
Send a transactional push. You send a message using a transactional_message_id
for a transactional push message template composed in the user interface. You can optionally override any of the template values at send time. The transactional_message_id
can be either the numerical ID for the template or the Trigger Name that you assigned the template.
You can find your transactional_message_id
from the code sample in the Overview tab for your transactional message in the user interface, or you can look up a list of your transactional messages through the App API.
required | integer or string The transactional message template that you want to use for your message. You can call the template by its numerical ID or by the Trigger Name that you assigned the template (case insensitive). |
to required | string Default: "all" Enum: "all" "last_used" "$device_token" The person's device(s) you want to send this push to. One of |
required | object Identifies the person represented by your transactional message by one of, and only one of, |
title | string The title for your notification. This overrides the title of the transactional template (referenced by |
message | string The message body for your notification. This overrides the notification body of the transactional template (referenced by |
image_url | string An image URL to show in the push. This overrides Image from the transactional template (referenced by |
link | string A deep link to open when the push is tapped. This overrides Link from the transactional template (referenced by |
sound | string Default: "default" Enum: "default" "none" For iOS Only: your notification can alert users with the device's default notification sound or play no sound at all. |
custom_data | object An optional list of key/value pairs to attach to the push payload. Due to a Firebase limitation we only support sending string key value pairs. This overrides Custom Data from the transactional template (referenced by |
object A device to perform an upsert operation at the time of send. The device will be added/updated on the profile from the Identifiers block. | |
object An optional list of key/value pairs to attach to the push payload. Due to a Firebase limitation we only support sending string key value pairs. This overrides every other parameter, including any Custom Payload from the transactional template (referenced by | |
language | string Overrides language preferences for the person you want to send your transactional message to. Use one of our supported two- or four-letter language codes. |
object An object containing the key-value pairs referenced using liquid in your message. | |
send_at | integer A unix timestamp (seconds since epoch) determining when the message will be sent. The timestamp can be up to 90 days in the future. If this value is in the past, your message is sent immediately. |
disable_message_retention | boolean Default: false If true, the message body is not retained in delivery history. Setting this value overrides the value set in the settings of your |
send_to_unsubscribed | boolean Default: true If false, your message is not sent to unsubscribed recipients. Setting this value overrides the value set in the settings of your |
queue_draft | boolean Default: false If true, your transactional message is held as a draft in Customer.io and not sent directly to your audience. You must go to the Deliveries and Drafts page to send your message. |
{- "transactional_message_id": 44,
- "title": "Did you really login from a new location?",
- "identifiers": {
- "id": 12345
}, - "message_data": {
- "password_reset_token": "abcde-12345-fghij-d888",
- "account_id": "123dj"
}
}
{- "delivery_id": "string",
- "queued_at": 0
}
API triggered broadcast limits
While API triggered broadcasts are limited to 1 request every 10 seconds, they're also limited by the number of triggers you can have queued at a time, as shown in the table below.
Data Type | Limit | Description |
---|---|---|
Trigger Payload | 25MB | Max length of the entire Trigger call, larger calls are typically to support per_user_data |
Trigger Data | 50000 bytes | Max length of the data section in the Trigger call |
Recipient List1 | 10000 recipients | Max number of ids or emails included in the Trigger call |
Custom Per User Data1 | 10000 entries | Max number of entries in per_user_data |
Custom Per User Data1 | 2MB | Max length per user in the file referenced by data_file_url . |
Custom Per User Data1 | 10GB | Max length of the entire size of the file referenced by data_file_url |
Trigger Queue | 5 triggers | Max number of triggers waiting to be processed consecutively |
1For larger data sets, use data_file_url
to supply a link to a file that contains your merge data. Attempting to send too much data in a single API call will fail.
Transactional Message Limits
The /send-email
(transactional email) endpoint is limited to 100 requests per second.
Data Type | Limit | Description |
---|---|---|
Payload | 1MB | Max length of the payload, excepting attachments |
Attachments | 2MB | Maximum size of attachments |
Recipients | 15 | Total number of recipients across the to and bcc fields. |
Return information about activities. Activities are cards in campaigns, broadcasts, etc. They might be messages, webhooks, attribute changes, etc.
This endpoint returns a list of "activities" for people, similar to your workspace's Activity Logs. This endpoint is guaranteed to return activity history within the past 30 days. It might return data older than 30 days in some circumstances, but activites older than 30 days are not guaranteed.
start | string The token for the page of results you want to return. Responses contain a |
type | string Enum: "attempted_action" "attribute_change" "failed_attribute_change" "failed_batch_update" "skipped_update" "failed_query_collection" … 48 more Example: type=sent_email The type of activity you want to search for. Types with |
name | string Example: name=something_happened The name of the event or attribute you want to return. |
deleted | boolean Default: false If true, return results for deleted people. |
customer_id | string The If you use a person's |
id_type | string Enum: "id" "email" "cio_id" The type of |
limit | integer <= 100 Default: 10 The maximum number of results you want to retrieve per page. |
curl --request GET \ --url 'https://api.customer.io/v1/activities?start=SOME_STRING_VALUE&type=sent_email&name=something_happened&deleted=SOME_BOOLEAN_VALUE&customer_id=SOME_STRING_VALUE&id_type=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE'
{- "activities": [
- {
- "customer_id": "42",
- "customer_identifiers": {
- "email": "test@example.com",
- "id": 2,
- "cio_id": "a3000001"
}, - "data": {
- "delivery_id": "ZAIAAVTJVG0QcCok0-0ZKj6yiQ==",
- "opened": null,
- "delivered": null
}, - "delivery_id": "ZAIAAVTJVG0QcCok0-0ZKj6yiQ==",
- "delivery_type": "email",
- "id": "01AK4N8V8G8KVA4HN8Y50CCZ59",
- "timestamp": 1397566226,
- "type": "sent_email"
}
], - "next": "string"
}
In the UI, we frequently refer to broadcasts that you trigger through these endpoints as "API triggered" broadcasts. Use these endpoints to trigger a broadcast and retrieve information about broadcast triggers. When you trigger a broadcast, you can include data
that you reference in your message (using a liquid {{trigger.<property>}}
filter).
While you can trigger and look up information about broadcasts using the API, you must perform all other create, update, and/or delete operations through the UI.
If your broadcast produced validation errors, this endpoint can help you better understand what went wrong. Broadcast errors are generally issues in your broadcast audience and associated.
broadcast_id required | integer The ID of the broadcast that you want to return information about. |
trigger_id required | integer Example: 3 The ID of the campaign trigger that you want to return information for. |
start | string The token for the page of results you want to return. Responses contain a |
limit | integer The maximum number of results you want to retrieve per page. |
curl --request GET \ --url https://api.customer.io/v1/campaigns/{broadcast_id}/triggers/{trigger_id}/errors
{- "errors": [
- "string"
], - "next": "string"
}
Returns a list of your API-triggered broadcasts and associated metadata.
curl --request GET \ --url https://api.customer.io/v1/broadcasts
{- "broadcasts": [
- {
- "id": 2,
- "deduplicate_id": "2:1520467200",
- "created": 1520467200,
- "type": "triggered_broadcast",
- "updated": 1520467200,
- "name": "basic",
- "active": true,
- "state": "running",
- "actions": [
- {
- "id": 3,
- "type": "email"
}, - {
- "id": 4
}, - {
- "type": "webhook"
}
], - "tags": "nil",
- "first_started": 1520467200,
- "created_by": "ExamplePerson"
}
]
}
Returns metadata for an individual broadcast.
broadcast_id required | integer The identifier of a broadcast. |
curl --request GET \ --url https://api.customer.io/v1/broadcasts/{broadcast_id}
{- "broadcast": {
- "id": 2,
- "deduplicate_id": "2:1520467200",
- "created": 1520467200,
- "type": "triggered_broadcast",
- "updated": 1520467200,
- "name": "basic",
- "active": true,
- "state": "running",
- "actions": [
- {
- "id": 3,
- "type": "email"
}, - {
- "id": 4
}, - {
- "type": "webhook"
}
], - "tags": "nil",
- "first_started": 1520467200,
- "created_by": "ExamplePerson"
}
}
After triggering a broadcast you can retrieve the status of that broadcast using a GET of the trigger_id
. You can retrieve the trigger_id
from Get broadcast triggers.
broadcast_id required | integer The ID of the broadcast that you want to return information about. |
trigger_id required | integer Example: 3 The ID of the campaign trigger that you want to return information for. |
curl --request GET \ --url https://api.customer.io/v1/campaigns/{broadcast_id}/triggers/{trigger_id}
{- "id": 0,
- "broadcast_id": 2,
- "created_at": 1552341937,
- "processed_at": 0
}
Returns a list of metrics for an individual broadcast in steps
(days, weeks, etc). We return metrics from oldest to newest (i.e. the 0-index for any result is the oldest step/period).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
broadcast_id required | integer The identifier of a broadcast. |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
type | string Enum: "email" "webhook" "twilio" "slack" "push" "in_app" The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. |
curl --request GET \ --url https://api.customer.io/v1/broadcasts/{broadcast_id}/metrics
{- "metric": {
- "series": {
- "2xx": [
- 0
], - "3xx": [
- 0
], - "4xx": [
- 0
], - "5xx": [
- 0
], - "attempted": [
- 0
], - "bounced": [
- 0
], - "clicked": [
- 0
], - "converted": [
- 0
], - "created": [
- 0
], - "deferred": [
- 0
], - "delivered": [
- 0
], - "drafted": [
- 0
], - "failed": [
- 0
], - "opened": [
- 0
], - "sent": [
- 0
], - "spammed": [
- 0
], - "suppressed": [
- 0
], - "undeliverable": [
- 0
], - "topic_unsubscribed": [
- 0
], - "unsubscribed": [
- 0
]
}
}
}
Returns metrics for link clicks within a broadcast, both in total and in series
periods (days, weeks, etc). series
metrics are ordered oldest to newest (i.e. the 0-index for any result is the oldest step/period).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
broadcast_id required | integer The identifier of a broadcast. |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
unique | boolean Default: false If true, the response contains only unique customer results, i.e. a customer who clicks a link twice is only counted once. If false, the response contains the total number of results without regard to uniqueness. |
curl --request GET \ --url https://api.customer.io/v1/broadcasts/{broadcast_id}/metrics/links
{- "links": [
- {
- "metric": {
- "series": {
- "clicked": [
- 1,
- 3,
- 5,
- 7
]
}
}
}
]
}
Returns the actions that occur as a part of a broadcast.
broadcast_id required | integer The identifier of a broadcast. |
curl --request GET \ --url https://api.customer.io/v1/broadcasts/{broadcast_id}/actions
{- "actions": [
- {
- "id": 96,
- "broadcast_id": 2,
- "deduplicate_id": "15:1492548073",
- "name": "Opening Message",
- "layout": "string",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "type": "email",
- "sending_state": "automatic",
- "language": "fr",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
]
}
Returns information about the deliveries (instances of messages sent to individual people) sent from an API-triggered broadcast. Provide query parameters to refine the metrics you want to return.
Use the start_ts
and end_ts
to find messages within a time range. If your request doesn't include start_ts
and end_ts
parameters, we'll return results for the 1 month period after the first trigger. If your start_ts
and end_ts
range is more than 12 months, we'll return 12 months of data from the most recent timestamp in your request.
broadcast_id required | integer The identifier of a broadcast. |
start | string The token for the page of results you want to return. Responses contain a |
limit | integer The maximum number of results you want to retrieve per page. |
metric | string Enum: "attempted" "sent" "delivered" "opened" "clicked" "converted" … 6 more Determines the metric(s) you want to return. |
state | string Enum: "failed" "sent" "drafted" "attempted" The state of a broadcast. |
type | string Enum: "email" "webhook" "twilio" "slack" "push" "in_app" The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. |
start_ts | integer <unix timestamp> The beginning timestamp for your query. |
end_ts | integer <unix timestamp> The ending timestamp for your query. |
curl --request GET \ --url https://api.customer.io/v1/broadcasts/{broadcast_id}/messages
{- "messages": [
- {
- "id": "dgOq6QWq6QUDAAF22PaOyFVqVxHY3rI5fsg=",
- "deduplicate_id": "dgOq6QWq6QUDAAF22PaOyFVqVxHY3rI5fsg=:1609957872",
- "msg_template_id": 0,
- "action_id": 196,
- "customer_id": "1a55d8d1-b13d-4f1f-858f-a93ef21e3a7d",
- "customer_identifiers": {
- "id": "1a55d8d1-b13d-4f1f-858f-a93ef21e3a7d",
- "email": "person@example.com",
- "cio_id": 786433
}, - "recipient": "person@example.com",
- "subject": "Did you get that thing I sent you?",
- "metrics": {
- "delivered": 1609957872,
- "sent": 1609957832
}, - "created": 1609957805,
- "failure_message": null,
- "newsletter_id": null,
- "content_id": null,
- "campaign_id": null,
- "broadcast_id": 94,
- "type": "email",
- "forgotten": false
}
]
}
Returns information about a specific action within a broadcast.
broadcast_id required | integer The identifier of a broadcast. |
action_id required | integer The action you want to lookup or act on. |
curl --request GET \ --url https://api.customer.io/v1/broadcasts/{broadcast_id}/actions/{action_id}
{- "action": {
- "id": 96,
- "broadcast_id": 2,
- "deduplicate_id": "15:1492548073",
- "name": "Opening Message",
- "layout": "string",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "type": "email",
- "sending_state": "automatic",
- "language": "fr",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
}
Update the contents of a broadcast action, including the body of messages or HTTP requests.
broadcast_id required | integer The identifier of a broadcast. |
action_id required | integer The action you want to lookup or act on. |
body | string The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. |
sending_state | string Enum: "automatic" "draft" "off" Determines the sending behavior for the action. |
from_id | integer The identifier of the |
reply_to_id | integer Nullable The identifier for the |
recipient | string The recipient address for an action. |
subject | string The subject line for an |
preheader_text | string Also known as "preview text", this specifies the small block of text shown in an end-user's email inbox, next to, or underneath, the subject line. |
Array of objects Headers must be strings and cannot contain any non-ASCII characters or empty spaces. Some headers are reserved and cannot be overwritten. | |
body_amp | string If your message is an email, this is the AMP-enabled body of your message. If your recipient's email client doesn't support AMP, the |
{- "body": "string",
- "sending_state": "automatic",
- "from_id": 1,
- "reply_to_id": 38,
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
{- "action": {
- "id": 96,
- "broadcast_id": 2,
- "deduplicate_id": "15:1492548073",
- "name": "Opening Message",
- "layout": "string",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "type": "email",
- "sending_state": "automatic",
- "language": "fr",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
}
Returns information about a translation of message in a broadcast. The message is identified by the action_id
.
broadcast_id required | integer The identifier of a broadcast. |
action_id required | integer The action you want to lookup or act on. |
language | string A language tag of a language variant. If you don't provide a language, we target your default template. If the language variant does not exist, we throw an error. |
curl --request GET \ --url https://api.customer.io/v1/broadcasts/{broadcast_id}/actions/{action_id}/language/{language}
{- "action": {
- "id": 96,
- "broadcast_id": 2,
- "deduplicate_id": "15:1492548073",
- "name": "Opening Message",
- "layout": "string",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "type": "email",
- "sending_state": "automatic",
- "language": "fr",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
}
Update a translation of a specific broadcast action, including the body of messages or HTTP requests.
broadcast_id required | integer The identifier of a broadcast. |
action_id required | integer The action you want to lookup or act on. |
language | string A language tag of a language variant. If you don't provide a language, we target your default template. If the language variant does not exist, we throw an error. |
body | string The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. |
sending_state | string Enum: "automatic" "draft" "off" Determines the sending behavior for the action. |
from_id | integer The identifier of the |
reply_to_id | integer Nullable The identifier for the |
recipient | string The recipient address for an action. |
subject | string The subject line for an |
preheader_text | string Also known as "preview text", this specifies the small block of text shown in an end-user's email inbox, next to, or underneath, the subject line. |
Array of objects Headers must be strings and cannot contain any non-ASCII characters or empty spaces. Some headers are reserved and cannot be overwritten. | |
body_amp | string If your message is an email, this is the AMP-enabled body of your message. If your recipient's email client doesn't support AMP, the |
{- "body": "string",
- "sending_state": "automatic",
- "from_id": 1,
- "reply_to_id": 38,
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
{- "action": {
- "id": 96,
- "broadcast_id": 2,
- "deduplicate_id": "15:1492548073",
- "name": "Opening Message",
- "layout": "string",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "type": "email",
- "sending_state": "automatic",
- "language": "fr",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
}
Returns a list of metrics for an individual action both in total and in steps
(days, weeks, etc) over a period of time. Stepped series
metrics return from oldest to newest (i.e. the 0-index for any result is the oldest step/period).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
broadcast_id required | integer The identifier of a broadcast. |
action_id required | integer The action you want to lookup or act on. |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
type | string Enum: "email" "webhook" "twilio" "slack" "push" "in_app" The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. |
curl --request GET \ --url https://api.customer.io/v1/broadcasts/{broadcast_id}/actions/{action_id}/metrics
{- "metric": {
- "series": {
- "2xx": [
- 0
], - "3xx": [
- 0
], - "4xx": [
- 0
], - "5xx": [
- 0
], - "attempted": [
- 0
], - "bounced": [
- 0
], - "clicked": [
- 0
], - "converted": [
- 0
], - "created": [
- 0
], - "deferred": [
- 0
], - "delivered": [
- 0
], - "drafted": [
- 0
], - "failed": [
- 0
], - "opened": [
- 0
], - "sent": [
- 0
], - "spammed": [
- 0
], - "suppressed": [
- 0
], - "undeliverable": [
- 0
], - "topic_unsubscribed": [
- 0
], - "unsubscribed": [
- 0
]
}
}
}
Returns link click metrics for an individual broadcast action. Unless you specify otherwise, the response contains data for the maximum period by days (45 days).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
broadcast_id required | integer The identifier of a broadcast. |
action_id required | integer The action you want to lookup or act on. |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
type | string Enum: "email" "webhook" "twilio" "slack" "push" "in_app" The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. |
curl --request GET \ --url https://api.customer.io/v1/broadcasts/{broadcast_id}/actions/{action_id}/metrics/links
{- "links": [
- {
- "metric": {
- "series": {
- "clicked": [
- 1,
- 3,
- 5,
- 7
]
}
}
}
]
}
Returns a list of the triggers
for a broadcast.
broadcast_id required | integer The identifier of a broadcast. |
curl --request GET \ --url https://api.customer.io/v1/broadcasts/{broadcast_id}/triggers
{- "triggers": [
- {
- "id": 0,
- "broadcast_id": 2,
- "created_at": 1552341937,
- "processed_at": 0
}
]
}
A campaign is a workflow that people in your audience trigger and traverse. The items that happen within the workflow—messages, attribute changes, webhooks, etc that your audience triggers—are called actions.
These endpoints return information about campaigns including metrics and the actions included in campaigns. You can update individual campaign actions from these endpoints, but you must perform all other create, update, and/or delete operations through the UI.
curl --request GET \ --url https://api.customer.io/v1/campaigns
{- "campaigns": [
- {
- "id": 5,
- "deduplicate_id": "15:1492548073",
- "name": "string",
- "type": "segment",
- "created": 1552341937,
- "updated": 1552341937,
- "active": true,
- "state": "running",
- "actions": [
- {
- "type": "email",
- "id": 259
}
], - "first_started": 1552341937,
- "tags": [
- "new",
- "welcome"
], - "trigger_segment_ids": [
- 90
], - "filter_segment_ids": [
- 21,
- 42
], - "msg_templates": [
- {
- "type": "email",
- "id": 0
}
]
}
]
}
Returns metadata for an individual campaign.
campaign_id required | integer Example: 2 The ID of the campaign that you want to trigger or return information about. |
curl --request GET \ --url https://api.customer.io/v1/campaigns/{campaign_id}
{- "campaign": {
- "id": 5,
- "deduplicate_id": "15:1492548073",
- "name": "string",
- "type": "segment",
- "created": 1552341937,
- "updated": 1552341937,
- "active": true,
- "state": "running",
- "actions": [
- {
- "type": "email",
- "id": 259
}
], - "first_started": 1552341937,
- "tags": [
- "new",
- "welcome"
], - "trigger_segment_ids": [
- 90
], - "filter_segment_ids": [
- 21,
- 42
], - "msg_templates": [
- {
- "type": "email",
- "id": 0
}
]
}
}
Returns a list of metrics for an individual campaign in steps
(days, weeks, etc). We return metrics from oldest to newest (i.e. the 0-index for any result is the oldest step/period).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
campaign_id required | integer Example: 2 The ID of the campaign that you want to trigger or return information about. |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
type | string Enum: "email" "webhook" "twilio" "slack" "push" "in_app" The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. |
curl --request GET \ --url https://api.customer.io/v1/campaigns/{campaign_id}/metrics
{- "metric": {
- "series": {
- "2xx": [
- 0
], - "3xx": [
- 0
], - "4xx": [
- 0
], - "5xx": [
- 0
], - "attempted": [
- 0
], - "bounced": [
- 0
], - "clicked": [
- 0
], - "converted": [
- 0
], - "created": [
- 0
], - "deferred": [
- 0
], - "delivered": [
- 0
], - "drafted": [
- 0
], - "failed": [
- 0
], - "opened": [
- 0
], - "sent": [
- 0
], - "spammed": [
- 0
], - "suppressed": [
- 0
], - "undeliverable": [
- 0
], - "topic_unsubscribed": [
- 0
], - "unsubscribed": [
- 0
]
}
}
}
Returns metrics for link clicks within a campaign, both in total and in series
periods (days, weeks, etc). series
metrics are ordered oldest to newest (i.e. the 0-index for any result is the oldest step/period).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
campaign_id required | integer Example: 2 The ID of the campaign that you want to trigger or return information about. |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
unique | boolean Default: false If true, the response contains only unique customer results, i.e. a customer who clicks a link twice is only counted once. If false, the response contains the total number of results without regard to uniqueness. |
curl --request GET \ --url https://api.customer.io/v1/campaigns/{campaign_id}/metrics/links
{- "links": [
- {
- "metric": {
- "series": {
- "clicked": [
- 1,
- 3,
- 5,
- 7
]
}
}
}
]
}
Returns the operations in a campaign workflow. Each object in the response represents an action or 'tile' in the campaign builder.
This endpoint returns up to 10 actions
at a time. If there is another page of results, the response will include a next
string. Pass this string as the start
parameter to get the next page of results.
campaign_id required | integer Example: 2 The ID of the campaign that you want to trigger or return information about. |
start | string The token for the page of results you want to return. Responses contain a |
curl --request GET \ --url https://api.customer.io/v1/campaigns/{campaign_id}/actions
{- "actions": [
- {
- "id": 96,
- "campaign_id": 5,
- "parent_action_id": 1,
- "deduplicate_id": "15:1492548073",
- "name": "Opening Message",
- "layout": "string",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "body_amp": "string",
- "language": "fr",
- "type": "email",
- "sending_state": "automatic",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
], - "next": "string"
}
Returns information about the deliveries (instances of messages sent to individual people) sent from a campaign. Provide query parameters to refine the metrics you want to return.
Use the start_ts
and end_ts
to find messages within a time range. If your request doesn't include start_ts
and end_ts
parameters, we'll return the most recent 6 months of messages. If your start_ts
and end_ts
range is more than 12 months, we'll return 12 months of data from the most recent timestamp in your request.
campaign_id required | integer Example: 2 The ID of the campaign that you want to trigger or return information about. |
start | string The token for the page of results you want to return. Responses contain a |
limit | integer <= 1000 Default: 50 The maximum number of results you want to retrieve per page. |
type | string Enum: "email" "webhook" "twilio" "slack" "push" "in_app" The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. |
metric | string Enum: "attempted" "sent" "delivered" "opened" "clicked" "converted" … 6 more Determines the metric(s) you want to return. |
drafts | boolean If true, your request returns drafts rather than active/sent messages. |
start_ts | integer <unix timestamp> The beginning timestamp for your query. |
end_ts | integer <unix timestamp> The ending timestamp for your query. |
curl --request GET \ --url https://api.customer.io/v1/campaigns/{campaign_id}/messages
{- "messages": [
- {
- "id": "dgOq6QWq6QUDAAF22PaOyFVqVxHY3rI5fsg=",
- "deduplicate_id": "dgOq6QWq6QUDAAF22PaOyFVqVxHY3rI5fsg=:1609957872",
- "msg_template_id": 0,
- "action_id": 196,
- "customer_id": "1a55d8d1-b13d-4f1f-858f-a93ef21e3a7d",
- "customer_identifiers": {
- "id": "1a55d8d1-b13d-4f1f-858f-a93ef21e3a7d",
- "email": "person@example.com",
- "cio_id": 786433
}, - "recipient": "person@email.com",
- "subject": "Did you get that thing I sent you?",
- "metrics": {
- "delivered": 1609957872,
- "sent": 1609957832
}, - "created": 1609957805,
- "failure_message": null,
- "newsletter_id": null,
- "content_id": null,
- "campaign_id": 89,
- "broadcast_id": null,
- "type": "email",
- "forgotten": false
}
]
}
Returns information about a specific action in a campaign.
campaign_id required | integer Example: 2 The ID of the campaign that you want to trigger or return information about. |
action_id required | integer The action you want to lookup or act on. |
curl --request GET \ --url https://api.customer.io/v1/campaigns/{campaign_id}/actions/{action_id}
{- "action": {
- "id": 96,
- "campaign_id": 5,
- "parent_action_id": 1,
- "deduplicate_id": "15:1492548073",
- "name": "Opening Message",
- "layout": "string",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "body_amp": "string",
- "language": "fr",
- "type": "email",
- "sending_state": "automatic",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
}
Update the contents of a campaign action, including the body of messages and HTTP requests.
campaign_id required | integer Example: 2 The ID of the campaign that you want to trigger or return information about. |
action_id required | integer The action you want to lookup or act on. |
body | string The body of the action. For emails, this is the HTML-body of a message. You cannot modify the body if you created it with our drag-and-drop editor. |
body_amp | string If your message is an email, this is the AMP-enabled body of your message. If your recipient's email client doesn't support AMP, the |
sending_state | string Enum: "automatic" "draft" "off" Determines the sending behavior for the action. |
from_id | integer The identifier of the |
reply_to_id | integer Nullable The identifier for the |
recipient | string The recipient address for an action. |
subject | string The subject line for an |
preheader_text | string Also known as "preview text", this specifies the small block of text shown in an end-user's email inbox, next to, or underneath, the subject line. |
Array of objects Headers must be strings and cannot contain any non-ASCII characters or empty spaces. Some headers are reserved and cannot be overwritten. |
{- "body": "string",
- "body_amp": "string",
- "sending_state": "automatic",
- "from_id": 1,
- "reply_to_id": 38,
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
{- "action": {
- "id": 96,
- "campaign_id": 5,
- "parent_action_id": 1,
- "deduplicate_id": "15:1492548073",
- "name": "Opening Message",
- "layout": "string",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "body_amp": "string",
- "language": "fr",
- "type": "email",
- "sending_state": "automatic",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
}
Returns a translated version of a message in a campaign. The message is identified by the action_id
.
campaign_id required | integer Example: 2 The ID of the campaign that you want to trigger or return information about. |
action_id required | integer The action you want to lookup or act on. |
language | string A language tag of a language variant. If you don't provide a language, we target your default template. If the language variant does not exist, we throw an error. |
curl --request GET \ --url https://api.customer.io/v1/campaigns/{campaign_id}/actions/{action_id}/language/{language}
{- "action": {
- "id": 96,
- "campaign_id": 5,
- "parent_action_id": 1,
- "deduplicate_id": "15:1492548073",
- "name": "Opening Message",
- "layout": "string",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "body_amp": "string",
- "language": "fr",
- "type": "email",
- "sending_state": "automatic",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
}
Update the contents of a language variant of a campaign action, including the body of the messages and HTTP requests.
campaign_id required | integer Example: 2 The ID of the campaign that you want to trigger or return information about. |
action_id required | integer The action you want to lookup or act on. |
language | string A language tag of a language variant. If you don't provide a language, we target your default template. If the language variant does not exist, we throw an error. |
body | string The body of the action. For emails, this is the HTML-body of a message. You cannot modify the body if you created it with our drag-and-drop editor. |
body_amp | string If your message is an email, this is the AMP-enabled body of your message. If your recipient's email client doesn't support AMP, the |
sending_state | string Enum: "automatic" "draft" "off" Determines the sending behavior for the action. |
from_id | integer The identifier of the |
reply_to_id | integer Nullable The identifier for the |
recipient | string The recipient address for an action. |
subject | string The subject line for an |
preheader_text | string Also known as "preview text", this specifies the small block of text shown in an end-user's email inbox, next to, or underneath, the subject line. |
Array of objects Headers must be strings and cannot contain any non-ASCII characters or empty spaces. Some headers are reserved and cannot be overwritten. |
{- "body": "string",
- "body_amp": "string",
- "sending_state": "automatic",
- "from_id": 1,
- "reply_to_id": 38,
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
{- "action": {
- "id": 96,
- "campaign_id": 5,
- "parent_action_id": 1,
- "deduplicate_id": "15:1492548073",
- "name": "Opening Message",
- "layout": "string",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "body_amp": "string",
- "language": "fr",
- "type": "email",
- "sending_state": "automatic",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
}
Returns a list of metrics for an individual action both in total and in steps
(days, weeks, etc) over a period of time. Stepped series
metrics return from oldest to newest (i.e. the 0-index for any result is the oldest step/period).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
campaign_id required | integer Example: 2 The ID of the campaign that you want to trigger or return information about. |
action_id required | integer The action you want to lookup or act on. |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
type | string Enum: "email" "webhook" "twilio" "slack" "push" "in_app" The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. |
curl --request GET \ --url https://api.customer.io/v1/campaigns/{campaign_id}/actions/{action_id}/metrics
{- "metric": {
- "series": {
- "2xx": [
- 0
], - "3xx": [
- 0
], - "4xx": [
- 0
], - "5xx": [
- 0
], - "attempted": [
- 0
], - "bounced": [
- 0
], - "clicked": [
- 0
], - "converted": [
- 0
], - "created": [
- 0
], - "deferred": [
- 0
], - "delivered": [
- 0
], - "drafted": [
- 0
], - "failed": [
- 0
], - "opened": [
- 0
], - "sent": [
- 0
], - "spammed": [
- 0
], - "suppressed": [
- 0
], - "undeliverable": [
- 0
], - "topic_unsubscribed": [
- 0
], - "unsubscribed": [
- 0
]
}
}
}
Returns link click metrics for an individual action. Unless you specify otherwise, the response contains data for the maximum period by days (45 days).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
campaign_id required | integer Example: 2 The ID of the campaign that you want to trigger or return information about. |
action_id required | integer The action you want to lookup or act on. |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
type | string Enum: "email" "webhook" "twilio" "slack" "push" "in_app" The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. |
curl --request GET \ --url https://api.customer.io/v1/campaigns/{campaign_id}/actions/{action_id}/metrics/links
{- "links": [
- {
- "metric": {
- "series": {
- "clicked": [
- 1,
- 3,
- 5,
- 7
]
}
}
}
]
}
Returns a list of Journey Metrics for your campaign. These metrics show how many people triggered your campaign, were messaged, etc for the time period and "resolution" you set. You must provide the start
, end
, and resolution
parameters or your request will return 400
.
Metrics in the response are arrays, and each index in the array corresponds to the resolution
in your request. If you request metrics in days
, the first result in each metric array is the first day of results and each successive increment represents another day.
Each increment represents the number of journeys that started within a time period and eventually achieved a particular metric. For example, array index 0 for the converted
metric represents the number of journeys that started on the first day/month of results that achieved a conversion.
campaign_id required | integer Example: 2 The ID of the campaign that you want to trigger or return information about. |
start required | integer <unix timestamp> Example: start=1652718066 The unix timestamp for the beginning of your journey metrics report. |
end required | integer <unix timestamp> The unix timestamp for the end of your journey metrics report. |
resolution required | string Enum: "hours" "hourly" "days" "daily" "weeks" "weekly" … 2 more Determines increment for journey metrics—hourly, daily, weekly, or monthly. |
curl --request GET \ --url 'https://api.customer.io/v1/campaigns/{campaign_id}/journey_metrics?start=1650151266&end=1652052066&resolution=weeks' \ --header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
{- "journey_metric": {
- "started": [
- 0
], - "activated": [
- 0
], - "exited_early": [
- 0
], - "finished": [
- 0
], - "converted": [
- 0
], - "never_activated": [
- 0
], - "messaged": [
- 0
]
}
}
Collections are arbitrary sets of data that you want to use in campaign messages or workflows independent of attributes or events. They might represent things like upcoming events, coupons/promotions, etc.
Create a new collection and provide the data
that you'll access from the collection or the url
that you'll download CSV or JSON data from.
Note: A collection cannot be more than 10 MB in size. No individual row in the collection can be more than 10 KB.
name required | string The name of the collection. This is how you'll reference your collection in messages— |
required | Array of objects An array of data objects that you want to reference in this collection. |
{- "name": "events",
- "data": [
- {
- "eventName": "christmas",
- "eventDate": "2021-12-25T12:00:00.000Z",
- "presents": {
- "something_you_want": "toys",
- "something_you_need": "socks",
- "total": 2
}
}, - {
- "eventName": "birthday",
- "eventDate": "2021-03-15T12:00:00.000Z",
- "presents": {
- "something_you_want": "video games",
- "something_you_need": "books",
- "total": 2
}
}
]
}
{- "collection": {
- "bytes": 296,
- "created_at": 1552341937,
- "updated_at": 1552341937,
- "id": 1,
- "name": "upcoming events",
- "rows": 2,
- "schema": [
- "eventDate",
- "eventName",
- "presents"
]
}
}
Returns a list of all of your collections, including the name
and schema
for each collection.
curl --request GET \ --url https://api.customer.io/v1/collections
{- "collections": [
- {
- "bytes": 296,
- "created_at": 1552341937,
- "updated_at": 1552341937,
- "id": 1,
- "name": "upcoming events",
- "rows": 2,
- "schema": [
- "eventDate",
- "eventName",
- "presents"
]
}
]
}
Retrieves details about a collection, including the schema
and name
. This request does not include the content
of the collection (the values associated with keys in the schema).
collection_id required | integer The identifier for a collection. |
curl --request GET \ --url https://api.customer.io/v1/collections/{collection_id}
{- "collection": {
- "bytes": 296,
- "created_at": 1552341937,
- "updated_at": 1552341937,
- "id": 1,
- "name": "upcoming events",
- "rows": 2,
- "schema": [
- "eventDate",
- "eventName",
- "presents"
]
}
}
Remove a collection and associated contents. Before you delete a collection, make sure that you aren't referencing it in active campaign messages or broadcasts; references to a deleted collection will appear empty and may prevent your messages from making sense to your audience.
collection_id required | integer The identifier for a collection. |
curl --request DELETE \ --url https://api.customer.io/v1/collections/{collection_id}
Update the name
or replace the contents of a collection. Updating the data
or url
for your collection fully replaces the contents of the collection.
Note:
collection_id required | integer The identifier for a collection. |
name | string The name of the collection. This is how you'll reference your collection in messages— |
Array of objects An array of data objects that you want to reference in this collection. |
{- "name": "events",
- "data": [
- {
- "eventName": "christmas",
- "eventDate": "2021-12-25T12:00:00.000Z",
- "presents": {
- "something_you_want": "toys",
- "something_you_need": "socks",
- "total": 2
}
}, - {
- "eventName": "birthday",
- "eventDate": "2021-03-15T12:00:00.000Z",
- "presents": {
- "something_you_want": "video games",
- "something_you_need": "books",
- "total": 2
}
}
]
}
{- "collection": {
- "bytes": 296,
- "created_at": 1552341937,
- "updated_at": 1552341937,
- "id": 1,
- "name": "upcoming events",
- "rows": 2,
- "schema": [
- "eventDate",
- "eventName",
- "presents"
]
}
}
Retrieve the contents of a collection (the data
from when you created or updated a collection). Each row
in the collection is represented as a JSON blob in the response.
collection_id required | integer The identifier for a collection. |
curl --request GET \ --url https://api.customer.io/v1/collections/{collection_id}/content
{- "eventName": "christmas",
- "eventDate": "2021-12-25T12:00:00.000Z",
- "presents": {
- "something_you_want": "toys",
- "something_you_need": "socks",
- "total": 2
}
}
Replace the contents of a collection (the data
from when you created or updated a collection). The request is a free-form object containing the keys you want to reference from the collection and the corresponding values. This request replaces the current contents of the collection entirely.
If you don't want to update the contents directly—you want to change the name
or data url
for your collection, use the update a collection endpoint.
Note: A collection cannot be more than 10 MB in size. No individual row in the collection can be more than 10 KB.
collection_id required | integer The identifier for a collection. |
Your request is a free form object representing the contents of your collection. This request replaces the contents of the collection entirely, so include all contents that you want to remain in the collection—whether they change or not.
collection contents* | any |
{- "eventName": "christmas",
- "eventDate": "2021-12-25T12:00:00.000Z",
- "presents": {
- "something_you_want": "toys",
- "something_you_need": "socks",
- "total": 2
}
}
{- "collection": {
- "bytes": 296,
- "created_at": 1552341937,
- "updated_at": 1552341937,
- "id": 1,
- "name": "upcoming events",
- "rows": 2,
- "schema": [
- "eventDate",
- "eventName",
- "presents"
]
}
}
Find people (referred to as "customers" in our APIs), their attributes, the segments they belong to, etc. Use the track API to add people to your workspace and assign their attributes.
Return a list of people in your workspace matching an email address.
email required | string <email> The email address you want to search for. |
curl --request GET \ --url 'https://api.customer.io/v1/customers?email=SOME_STRING_VALUE'
{- "results": [
- {
- "email": "hugh.mann@example.com",
- "id": 2,
- "cio_id": "a3000001"
}
]
}
Provide a filter to search for people in your workspace. Your filter can filter people by segment (using the Segment ID) and attribute values; when you filter by attributes, you can use eq
(matching an attribute value) or exists
(matching when a person has the attribute). Use the and
array, or
array, and not
object to create a complex filter. The not
selector is an object that takes a single filter.
Returns arrays of identifiers
and ids
. In general, you should rely on the newer identifiers
array, which contains more complete information about each person captured by the filter in your request, than the ids
array, which only contains id
values.
You can return up to 1000 people per request. If you want to return a larger set of people in a single request, you may want to use the /exports
API instead.
start | string The token for the page of results you want to return. Responses contain a |
limit | integer <= 1000 Default: 50 The maximum number of results you want to retrieve per page. |
required | object Describe the customers you want to return. Use |
{- "filter": {
- "and": [
- {
- "segment": {
- "id": 4
}
}, - {
- "attribute": {
- "field": "likes_pizza",
- "operator": "eq",
- "value": true
}
}
]
}
}
{- "identifiers": [
- {
- "id": 1,
- "email": "person@example.com",
- "cio_id": 3000001
}, - {
- "id": 2,
- "email": "second.person@exapmle.com",
- "cio_id": 3000002
}
], - "ids": [
- 1,
- 2
], - "next": "MDox"
}
Return a list of attributes for a customer profile. You can use attributes to fashion segments or as liquid merge fields in your messages.
customer_id required | string Example: 12345 The ID of the customer you want to perform an operation against. |
id_type | string Enum: "id" "email" "cio_id" The type of |
curl --request GET \ --url https://api.customer.io/v1/customers/{customer_id}/attributes
{- "customer": {
- "id": "1",
- "attributes": {
- "_last_emailed": "1528932553",
- "created_at": "1489014595",
- "email": "test@example.com",
- "title": "tester",
- "department": "qa",
- "id": "1",
- "cio_id": "03000001",
- "cio_subscription_preferences": "{\"topics\":{\"topic_7\":false,\"topic_8\":false}}",
- "_cio_subscription_preferences_computed": "{\"topics\":{\"topic_6\":false,\"topic_7\":false,\"topic_8\":false}}"
}, - "timestamps": {
- "cio_id": 1489014595,
- "_last_emailed": 1528932553,
- "created_at": 1489014595,
- "email": 1508932553,
- "id": 1489014595,
- "department": 1508932553,
- "title": 1508932553,
- "_cio_subscription_preferences_computed": 0,
- "cio_subscription_preferences": 1673987303
}, - "unsubscribed": false,
- "devices": [
- {
- "id": "my_android_device_id",
- "last_used": 1514764800,
- "platform": "android"
}, - {
- "id": "my_ios_device_id",
- "last_used": 1514764800,
- "platform": "ios"
}
]
}
}
Return a list of objects that a person is related to.
You can use the start
parameter with the next
property in responses to return pages of results. However, it's possible that you'll see duplicate entries across pages. If you want to export objects or relationships, you may want to use the export feature in our UI to return complete results.
customer_id required | string Example: 12345 The ID of the customer you want to perform an operation against. |
start | string The token for the page of results you want to return. Responses contain a |
limit | integer The maximum number of results you want to retrieve per page. |
curl --request GET \ --url https://api.customer.io/v1/customers/{customer_id}/relationships
{- "cio_relationships": [
- {
- "object_type_id": 0,
- "identifiers": {
- "object_id": "string",
- "cio_object_id": "string"
}, - "attributes": {
- "Object Attributes1": null,
- "Object Attributes2": null
}, - "timestamps": {
- "Object Attribute Timestamps1": 0,
- "Object Attribute Timestamps2": 0
}
}
], - "next": "string"
}
Return attributes and devices for up to 100 customers by ID. If an ID in the request does not exist, the response omits it.
ids required | Array of strings [ 1 .. 100 ] items An array of up to 100 customer IDs. |
{- "ids": [
- "string"
]
}
{- "customers": [
- {
- "customer": {
- "id": "1",
- "attributes": {
- "_last_emailed": "1528932553",
- "created_at": "1489014595",
- "email": "test@example.com",
- "title": "tester",
- "department": "qa",
- "id": "1",
- "cio_id": "03000001",
- "cio_subscription_preferences": "{\"topics\":{\"topic_7\":false,\"topic_8\":false}}",
- "_cio_subscription_preferences_computed": "{\"topics\":{\"topic_6\":false,\"topic_7\":false,\"topic_8\":false}}"
}, - "timestamps": {
- "cio_id": 1489014595,
- "_last_emailed": 1528932553,
- "created_at": 1489014595,
- "email": 1508932553,
- "id": 1489014595,
- "department": 1508932553,
- "title": 1508932553,
- "_cio_subscription_preferences_computed": 0,
- "cio_subscription_preferences": 1673987303
}, - "unsubscribed": false,
- "devices": [
- {
- "id": "my_android_device_id",
- "last_used": 1514764800,
- "platform": "android"
}, - {
- "id": "my_ios_device_id",
- "last_used": 1514764800,
- "platform": "ios"
}
]
}
}
]
}
Returns a list of segments that a customer profile belongs to.
customer_id required | string Example: 12345 The ID of the customer you want to perform an operation against. |
id_type | string Enum: "id" "email" "cio_id" The type of |
curl --request GET \ --url https://api.customer.io/v1/customers/{customer_id}/segments
{- "segments": [
- {
- "id": "string",
- "name": "string",
- "description": "string"
}
]
}
Returns information about the deliveries sent to a person. Provide query parameters to refine the data you want to return.
Use the start_ts
and end_ts
to find messages within a time range. If your request doesn't include start_ts
and end_ts
parameters, we'll return the most recent 6 months of messages. If your start_ts
and end_ts
range is more than 6 months, we'll return 6 months of data from the most recent timestamp in your request.
customer_id required | string Example: 12345 The ID of the customer you want to perform an operation against. |
id_type | string Enum: "id" "email" "cio_id" The type of |
start | string The token for the page of results you want to return. Responses contain a |
limit | integer <= 1000 Default: 50 The maximum number of results you want to retrieve per page. |
start_ts | integer <unix timestamp> The beginning timestamp for your query. |
end_ts | integer <unix timestamp> The ending timestamp for your query. |
curl --request GET \ --url https://api.customer.io/v1/customers/{customer_id}/messages
{- "messages": [
- {
- "id": "string",
- "deduplicate_id": "string",
- "msg_template_id": "string",
- "customer_id": "string",
- "campaign_id": 0,
- "action_id": 0,
- "recipient": "string",
- "subject": "string",
- "metrics": {
- "delivered": 0,
- "sent": 0
}, - "created": 0,
- "failure_message": "string",
- "newsletter_id": 0,
- "content_id": 0,
- "broadcast_id": 0,
- "type": "email",
- "forgotten": true
}
]
}
Return a list of activities performed by, or for, a customer. Activities are things like attribute changes and message sends.
This endpoint is guaranteed to return activity history within the past 30 days. It might return data older than 30 days in some circumstances, but activites older than 30 days are not guaranteed.
customer_id required | string Example: 12345 The ID of the customer you want to perform an operation against. |
id_type | string Enum: "id" "email" "cio_id" The type of |
start | string The token for the page of results you want to return. Responses contain a |
limit | integer <= 100 Default: 10 The maximum number of results you want to retrieve per page. |
type | string Enum: "attempted_action" "attribute_change" "failed_attribute_change" "failed_batch_update" "skipped_update" "failed_query_collection" … 48 more Example: type=sent_email The type of activity you want to search for. Types with |
name | string For |
curl --request GET \ --url https://api.customer.io/v1/customers/{customer_id}/activities
{- "activities": [
- {
- "customer_id": "42",
- "customer_identifiers": {
- "email": "test@example.com",
- "id": 2,
- "cio_id": "a3000001"
}, - "data": {
- "delivery_id": "ZAIAAVTJVG0QcCok0-0ZKj6yiQ==",
- "opened": null,
- "delivered": null
}, - "delivery_id": "ZAIAAVTJVG0QcCok0-0ZKj6yiQ==",
- "delivery_type": "email",
- "id": "01AK4N8V8G8KVA4HN8Y50CCZ59",
- "timestamp": 1397566226,
- "type": "sent_email"
}
]
}
Returns a list of subscription preferences for a person, including the custom header of the subscription preferences page, topic names, and topic descriptions. Returns translated data when you send a language in the query.
customer_id required | string Example: 12345 The ID of the customer you want to perform an operation against. |
id_type | string Enum: "id" "email" "cio_id" The type of |
language | string A language tag you want the content translated in. If none is provided, the content will be sent in the default language of your subscription center. |
Accept-Language | string <string> The language tag you want the content translated in. If none is provided, the content will be sent in the default lanauge of your subscription center. |
curl --request GET \ --url https://api.customer.io/v1/customers/{customer_id}/subscription_preferences
{- "customer": {
- "id": "1",
- "identifiers": {
- "cio_id": "01000001",
- "email": "me@example.com",
- "id": "1"
}, - "topics": [
- {
- "id": 1,
- "subscribed": true,
- "name": "Offers",
- "description": "Description for topic 1, if any"
}, - {
- "id": 2,
- "subscribed": true,
- "name": "News and Programs",
- "description": "Description for topic 2, if any"
}, - {
- "id": 3,
- "subscribed": false,
- "name": "Feedback",
- "description": "Description for topic 3, if any"
}
], - "unsubscribed": false,
- "header": {
- "title": "Manage your subscription preferences",
- "subtitle": "Check the box next to each topic you'd like to subscribe to."
}
}
}
If you use Customer.io as your email service provider (ESP), these endpoints help you retrieve information about email addresses suppressed directly by the ESP. ESP-based suppressions are different from suppression in Customer.io: these are addresses that the ESP suppressed automatically because a message bounced, a customer requested they not be contacted again, etc. These are not addresses that you deleted and suppressed either in our UI or through the API.
Look up an email address to learn if, and why, it was suppressed by the email service provider (ESP).
email_address required | string The email address of the person you want to look up. |
curl --request GET \ --url https://api.customer.io/v1/esp/search_suppression/{email_address}
{- "category": "bounces",
- "suppressions": [
- {
- "created": 1650895738,
- "email": "bounced.person@example.com",
- "reason": "Uploaded manually via api.customer.io",
- "status": "550"
}
]
}
Find addresses suppressed by the Email Service Provider (ESP) for a particular reason—bounces, blocks, spam reports, or invalid email addresses.
You can get up to 1000 addresses per request. Use the offset
parameter to get addresses beyond the first 1000.
suppression_type required | string Enum: "bounces" "spam_reports" The reason a person's email address was suppressed by the email service provider (ESP). |
limit | integer <= 1000 Default: 100 The maximum number of results you want to retrieve per page. |
offset | integer Default: 0 The number of records to skip before retrieving results. |
curl --request GET \ --url https://api.customer.io/v1/esp/suppression/{suppression_type}
{- "category": "bounces",
- "suppressions": [
- {
- "created": 1650895738,
- "email": "bounced.person@example.com",
- "reason": "Uploaded manually via api.customer.io",
- "status": "550"
}
]
}
Remove an address from the ESP's suppression list.
suppression_type required | string Enum: "bounces" "spam_reports" The reason a person's email address was suppressed by the email service provider (ESP). |
email_address required | string The email address of the person you want to look up. |
curl --request DELETE \ --url https://api.customer.io/v1/esp/suppression/{suppression_type}/{email_address}
Suppress an email address at the email service provider (ESP). Addresses suppressed this way are only suppressed through the ESP; these adresses are not suppressed in Customer.io, so the person can remain in your workspace (though emails to the address would be blocked at the ESP).
suppression_type required | string Enum: "bounces" "spam_reports" The reason a person's email address was suppressed by the email service provider (ESP). |
email_address required | string The email address of the person you want to look up. |
curl --request POST \ --url https://api.customer.io/v1/esp/suppression/{suppression_type}/{email_address}
{ }
Export information about people, deliveries, etc. You can also download existing exports from these endpoints.
Return a list of your exports. Exports are point-in-time people or campaign metrics.
curl --request GET \ --url https://api.customer.io/v1/exports
{- "exports": [
- {
- "id": 110,
- "user_id": 0,
- "user_email": "person@email.com",
- "total": 1234,
- "deduplicate_id": "110:1530296738",
- "type": "customers",
- "failed": false,
- "status": "done",
- "description": "Customers with segment filters—in \\Purchased Flowers\\",
- "downloads": 2,
- "created_at": 1530296738,
- "updated_at": 1530296738
}
]
}
Return information about a specific export.
export_id required | integer The export_id you want to access. |
curl --request GET \ --url https://api.customer.io/v1/exports/{export_id}
{- "export": {
- "id": 110,
- "user_id": 0,
- "user_email": "person@email.com",
- "total": 1234,
- "deduplicate_id": "110:1530296738",
- "type": "customers",
- "failed": false,
- "status": "done",
- "description": "Customers with segment filters—in \\Purchased Flowers\\",
- "downloads": 2,
- "created_at": 1530296738,
- "updated_at": 1530296738
}
}
This endpoint returns a signed link to download an export. The link expires after 15 minutes.
export_id required | integer The export_id you want to access. |
curl --request GET \ --url https://api.customer.io/v1/exports/{export_id}/download
{- "url": "string"
}
Provide filters and attributes describing the customers you want to export. This endpoint returns export metadata; use the /exports/{export_id}/endpoint
to download your export.
required | object When filtering for people, you can use The top level of this object can only contain a single property, but you can nest |
{- "filters": {
- "and": [
- {
- "segment": {
- "id": 3
}
}, - {
- "or": [
- {
- "attribute": {
- "field": "interest",
- "operator": "eq",
- "value": "roadrunners"
}
}, - {
- "attribute": {
- "field": "state",
- "operator": "eq",
- "value": "NM"
}
}, - {
- "not": {
- "attribute": {
- "field": "species",
- "operator": "eq",
- "value": "roadrunners"
}
}
}
]
}
]
}
}
{- "export": {
- "id": 110,
- "user_id": 0,
- "user_email": "person@email.com",
- "total": 1234,
- "deduplicate_id": "110:1530296738",
- "type": "customers",
- "failed": false,
- "status": "done",
- "description": "Customers with segment filters—in \\Purchased Flowers\\",
- "downloads": 2,
- "created_at": 1530296738,
- "updated_at": 1530296738
}
}
Provide filters for the newsletter, campaign, or action you want to return delivery information from. This endpoint starts an export, but you cannot download your export from this endpoint. Use the /exports/{export_id}
endpoint to download your export.
Use the start
and end
to find messages within a time range. If your request doesn't include start
and end
parameters, we'll return the most recent 6 months of messages. If your start
and end
range is more than 12 months, we'll return 12 months of data from the most recent timestamp in your request.
newsletter_id required | integer The ID of a newsletter you want to export information from. |
start | integer <unix timestamp> The unix timestamp representing the beginning of the export. |
end | integer <unix timestamp> The unix timestamp representing the end of the export. |
attributes | Array of strings The names of attributes you want to include in your export; each attribute name is an additional column in the export. If your message included liquid, you may add the attribute names used in your message so you can see the values populated for each delivery. |
metric | string Enum: "created" "attempted" "sent" "delivered" "opened" "clicked" … 7 more Determines the metric(s) you want to return. |
drafts | boolean If true, your request returns both drafts and active/sent messages. |
{- "newsletter_id": 999,
- "start": 1517529600,
- "end": 1517702400,
- "attributes": [
- "string"
], - "metric": "created",
- "drafts": true
}
{- "export": {
- "id": "111,",
- "deduplicate_id": "110:1530296738",
- "type": "deliveries",
- "failed": false,
- "description": "Full deliveries export (created via the api)",
- "downloads": 0,
- "created_at": 1530296742,
- "updated_at": 1530296742
}
}
APIs to upload CSV files containing lists of people. These endpoints provide a convenient way to add and update people without having to make an identify
call for each individual person.
This endpoint lets you upload a CSV file containing people, events, objects, or relationships. It provides a handy way of adding and updating them in bulk. Uploading people, objects, or relationships is like performing an identify
call for each row in your CSV; uploading events is like performing a track
call.
You'll need to provide us the public URL of your CSV as a part of this operation. We recommend that you host your CSVs from short-lived URLs. Ideally, your URLs will expire 2 hours after you initiate an import so that your customers' information doesn't remain publicly available after you've uploaded it to us.
Check out the CSV requirements based on what you're importing: people, events, and objects or relationships.
This endpoint performs some basic validation on the request and then queues the import for processing. The import happens in multiple stages after your request, and may even fail. You'll need to lookup the status of the import to check on its progress.
Records in your CSV might result in errors or warnings during the import. We make the errors and warnings available in CSV files that you can download via our export endpoints. Lookup your import to get download URLs for error and warning reports.
required | object |
{- "import": {
- "name": "string",
- "data_file_url": "string",
- "type": "people",
- "identifier": "id",
- "data_to_process": "all",
- "description": "string"
}
}
{- "import": {
- "id": 30,
- "name": "account-object-import",
- "description": "importing accounts",
- "created_at": 1706081641,
- "updated_at": 1706081645,
- "rows_to_import": 3,
- "rows_imported": 3,
- "state": "imported",
- "type": "object",
- "data_to_process": "all",
- "people_to_process": "all",
- "object_type_id": 1,
- "error": "possible error - The specified Object Type does not exist."
}
}
This endpoint returns information about an "import"—a CSV file containing a group of people or events you uploaded to using v1/imports
endpoint. You can use this endpoint to check to status of imports, or find out how many rows you successfully imported from a CSV file.
import_id required | integer The |
curl --request GET \ --url https://api.customer.io/v1/imports/{import_id}
{- "import": {
- "id": 30,
- "name": "account-object-import",
- "description": "importing accounts",
- "created_at": 1706081641,
- "updated_at": 1706081645,
- "rows_to_import": 3,
- "rows_imported": 3,
- "state": "imported",
- "type": "object",
- "data_to_process": "all",
- "people_to_process": "all",
- "object_type_id": 1,
- "error": "possible error - The specified Object Type does not exist.",
- "error_export_id": 2,
- "warning_export_id": 1,
}
}
Returns the list of addresses used by Customer.io. You must add add these addresses to your allowlist when using a custom SMTP provider and blocking unknown IP addresses.
Returns a list of IP addresses that you need to allowlist if you're using a firewall or Custom SMTP provider's IP access management settings to deny access to unknown IP addresses.
These addresses apply to all message types and webhooks, except push notifications.
curl --request GET \ --url https://api.customer.io/v1/info/ip_addresses
{- "ip_addresses": [
- "35.188.196.183",
- "104.198.177.219",
- "104.154.232.87",
- "130.211.229.195",
- "104.198.221.24",
- "104.197.27.15",
- "35.194.9.154",
- "104.154.144.51",
- "104.197.210.12",
- "35.225.6.73"
]
}
Return information about message and webhook "deliveries"—the instance of a message or webhook intended for an individual recipient.
Return a list of deliveries, including metrics for each delivery, for messages in your workspace. The request body contains filters determining the deliveries you want to return information about.
Use the start_ts
and end_ts
parameters to find messages within a time range. We limit your requests to 6 months. If your request doesn't include start_ts
and end_ts
parameters, we'll return the most recent 6 months of deliveries. If start_ts
is greater than 6-months before end_ts
, we only send back 6 months of data. If only end_ts
is specified, we return 6 months of data before this timestamp. If only start_ts
is specified, we then set the end_ts
to the current time and deliver 6 months of data prior to this timestamp.
start | string The token for the page of results you want to return. Responses contain a |
limit | integer <= 1000 Default: 50 The maximum number of results you want to retrieve per page. |
type | string Enum: "email" "webhook" "twilio" "slack" "push" "in_app" The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. |
metric | string Enum: "attempted" "sent" "delivered" "opened" "clicked" "converted" … 6 more Determines the metric(s) you want to return. |
drafts | boolean If true, your request returns drafts rather than active/sent messages. |
campaign_id | integer The campaign you want to filter for. |
newsletter_id | integer The newsletter you want to filter for. |
action_id | integer The action you want to filter for. |
start_ts | integer <unix timestamp> The beginning timestamp for your query. |
end_ts | integer <unix timestamp> The ending timestamp for your query. |
curl --request GET \ --url https://api.customer.io/v1/messages
{- "messages": [
- {
- "id": "ag1q6QWq6QUBAAF4_CGoeVX7mFkDbRFu7ek=",
- "deduplicate_id": "ag1q6QWq6QUBAAF4_CGoeVX7mFkDbRFu7ek=:1619137768",
- "msg_template_id": 43,
- "action_id": 215,
- "parent_action_id": null,
- "customer_id": null,
- "recipient": "person@example.com",
- "subject": "Did you get that thing I sent you?",
- "metrics": {
- "delivered": 1619137768,
- "sent": 1619137768
}, - "created": 1619137767,
- "failure_message": null,
- "newsletter_id": null,
- "content_id": null,
- "campaign_id": 23,
- "broadcast_id": null,
- "trigger_event_id": null,
- "type": "email",
- "forgotten": false
}
]
}
Return a information about, and metrics for, a delivery—the instance of a message intended for an individual recipient person.
message_id required | string The identifier of a message. |
curl --request GET \ --url https://api.customer.io/v1/messages/{message_id}
{- "message": {
- "id": "ag1q6QWq6QUBAAF4_CGoeVX7mFkDbRFu7ek=",
- "deduplicate_id": "ag1q6QWq6QUBAAF4_CGoeVX7mFkDbRFu7ek=:1619137768",
- "msg_template_id": 43,
- "action_id": 215,
- "parent_action_id": null,
- "customer_id": null,
- "recipient": "person@example.com",
- "subject": "Did you get that thing I sent you?",
- "metrics": {
- "delivered": 1619137768,
- "sent": 1619137768
}, - "created": 1619137767,
- "failure_message": null,
- "newsletter_id": null,
- "content_id": null,
- "campaign_id": 23,
- "broadcast_id": null,
- "trigger_event_id": null,
- "type": "email",
- "forgotten": false
}
}
Returns the archived copy of a delivery, including the message body, recipient, and metrics. This endpoint is limited to 100 requests per day.
message_id required | string The identifier of a message. |
curl --request GET \ --url https://api.customer.io/v1/messages/{message_id}/archived_message
{- "archived_message": {
- "id": "dgOq6QWq6QUBAAF4_CGoeVX7mFkDbRFu7ek=",
- "body": "<!DOCTYPE html><html><head>\\n<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=UTF-8\\\"/><h1>Hello World</h1>\\n\\n</body></html>",
- "from": "sentFrom@example.com",
- "reply_to": "replyto@example.com",
- "recipient": "person@example.com",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "request_method": "POST",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "forgotten": false
}
}
A newsletter is a type of broadcast in Customer.io—a one-time, single message that you send to a group of people. You can also set your newsletter up with A/B test variants.
These endpoints return information about newsletters including metrics and A/B test variants. You can update variants in newsletters from these endpoints, but you must perform all other create, update, and/or delete operations through the UI.
Returns a list of your newsletters and associated metadata.
limit | integer The maximum number of results you want to retrieve per page. The maximum value is 100. |
sort | string Enum: "asc" "desc" Determine how you want to sort results, |
start | string The token for the page of results you want to return. Responses contain a |
curl --request GET \ --url https://api.customer.io/v1/newsletters
{- "newsletters": [
- {
- "id": 128275,
- "deduplicate_id": "128275:1484870424",
- "type": "email",
- "content_ids": [
- 45,
- 90
], - "name": "Example Newsletter",
- "sent_at": null,
- "created": 1481653929,
- "updated": 1484870424,
- "tags": [
- "Example Tag"
], - "recipient_segment_ids": [
- 10
], - "subscription_topic_id": 1
}
], - "next": "string"
}
Returns metadata for an individual newsletter.
newsletter_id required | integer The identifier of a newsletter. |
curl --request GET \ --url https://api.customer.io/v1/newsletters/{newsletter_id}
{- "newsletter": {
- "id": 128275,
- "deduplicate_id": "128275:1484870424",
- "type": "email",
- "content_ids": [
- 45,
- 90
], - "name": "Example Newsletter",
- "sent_at": null,
- "created": 1481653929,
- "updated": 1484870424,
- "tags": [
- "Example Tag"
], - "recipient_segment_ids": [
- 10
], - "subscription_topic_id": 1
}
}
Deletes an individual newsletter, including content, settings, and metrics. It will be removed from segments, and its templates will no longer show in the Message Library.
If the newsletter is an in-app message, this cancels any undelivered, in-app message, too.
newsletter_id required | integer The identifier of a newsletter. |
curl --request DELETE \ --url https://api.customer.io/v1/newsletters/{newsletter_id}
Returns a list of metrics for an individual newsletter in steps
(days, weeks, etc). We return metrics from oldest to newest (i.e. the 0-index for any result is the oldest step/period).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
newsletter_id required | integer The identifier of a newsletter. |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
type | string Enum: "email" "webhook" "twilio" "slack" "push" "in_app" The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. |
curl --request GET \ --url https://api.customer.io/v1/newsletters/{newsletter_id}/metrics
{- "metric": {
- "series": {
- "2xx": [
- 0
], - "3xx": [
- 0
], - "4xx": [
- 0
], - "5xx": [
- 0
], - "attempted": [
- 0
], - "bounced": [
- 0
], - "clicked": [
- 0
], - "converted": [
- 0
], - "created": [
- 0
], - "deferred": [
- 0
], - "delivered": [
- 0
], - "drafted": [
- 0
], - "failed": [
- 0
], - "opened": [
- 0
], - "sent": [
- 0
], - "spammed": [
- 0
], - "suppressed": [
- 0
], - "undeliverable": [
- 0
], - "topic_unsubscribed": [
- 0
], - "unsubscribed": [
- 0
]
}
}
}
Returns metrics for link clicks within a newsletter, both in total and in series
periods (days, weeks, etc). series
metrics are ordered oldest to newest (i.e. the 0-index for any result is the oldest step/period).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
newsletter_id required | integer The identifier of a newsletter. |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
unique | boolean Default: false If true, the response contains only unique customer results, i.e. a customer who clicks a link twice is only counted once. If false, the response contains the total number of results without regard to uniqueness. |
curl --request GET \ --url https://api.customer.io/v1/newsletters/{newsletter_id}/metrics/links
{- "links": [
- {
- "metric": {
- "series": {
- "clicked": [
- 1,
- 3,
- 5,
- 7
]
}
}
}
]
}
Returns the content variants of a newsletter—these are either different languages in a multi-language newsletter or A/B tests.
newsletter_id required | integer The identifier of a newsletter. |
curl --request GET \ --url https://api.customer.io/v1/newsletters/{newsletter_id}/contents
{- "contents": [
- {
- "id": 0,
- "newsletter_id": 10,
- "deduplicate_id": "15:1492548073",
- "name": "newsletter variant A",
- "layout": "<html><body>{{ content }}</body></html>",
- "body": "<strong>Hello from the API</strong>",
- "body_amp": "string",
- "language": "fr",
- "type": "email",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
]
}
Returns information about the deliveries (instances of messages sent to individual people) sent from a newsletter. Provide query parameters to refine the metrics you want to return.
Use the start_ts
and end_ts
to find messages within a time range. If your request doesn't include start_ts
and end_ts
parameters, we'll return up to 6 months of results beginning with the first delivery generated from the newsletter. If your start_ts
and end_ts
range is more than 12 months, we'll return 12 months of data from the most recent timestamp in your request.
newsletter_id required | integer The identifier of a newsletter. |
start | string The token for the page of results you want to return. Responses contain a |
limit | integer The maximum number of results you want to retrieve per page. |
metric | string Enum: "attempted" "sent" "delivered" "opened" "clicked" "converted" … 6 more Determines the metric(s) you want to return. |
start_ts | integer <unix timestamp> The beginning timestamp for your query. |
end_ts | integer <unix timestamp> The ending timestamp for your query. |
curl --request GET \ --url https://api.customer.io/v1/newsletters/{newsletter_id}/messages
{- "messages": [
- {
- "id": "dgOq6QWq6QUDAAF22PaOyFVqVxHY3rI5fsg=",
- "deduplicate_id": "dgOq6QWq6QUDAAF22PaOyFVqVxHY3rI5fsg=:1609957872",
- "msg_template_id": 178,
- "action_id": null,
- "customer_id": "1a55d8d1-b13d-4f1f-858f-a93ef21e3a7d",
- "recipient": "person@email.com",
- "subject": "Did you get that thing I sent you?",
- "metrics": {
- "delivered": 1609957872,
- "sent": 1609957832
}, - "created": 1609957805,
- "failure_message": null,
- "newsletter_id": 72,
- "content_id": 178,
- "campaign_id": null,
- "broadcast_id": null,
- "type": "email",
- "forgotten": false
}
]
}
Returns information about a specific variant of a newsletter, where a variant is either a language in a multi-language newsletter or a part of an A/B test.
newsletter_id required | integer The identifier of a newsletter. |
content_id required | integer The identifier of a message in a newsletter. If your newsletter is an A/B test or has multiple languages, you may have multiple |
curl --request GET \ --url https://api.customer.io/v1/newsletters/{newsletter_id}/contents/{content_id}
{- "content": {
- "id": 0,
- "newsletter_id": 10,
- "deduplicate_id": "15:1492548073",
- "name": "newsletter variant A",
- "layout": "<html><body>{{ content }}</body></html>",
- "body": "<strong>Hello from the API</strong>",
- "body_amp": "string",
- "language": "fr",
- "type": "email",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
}
Update the contents of a newsletter variant (a specific language of your message or a part of an A/B test), including the body of a newsletter.
newsletter_id required | integer The identifier of a newsletter. |
content_id required | integer The identifier of a message in a newsletter. If your newsletter is an A/B test or has multiple languages, you may have multiple |
body | string The body of the variant. You cannot modify the body if you created it with our drag-and-drop editor. |
body_amp | string If your message is an email, this is the AMP-enabled body of your message. If your recipient's email client doesn't support AMP, the |
from_id | integer The identifier of the |
reply_to_id | integer Nullable The identifier for the |
recipient | string The recipient address for an action. |
subject | string The subject line for an |
preheader_text | string Also known as "preview text", this specifies the small block of text shown in an end-user's email inbox, next to, or underneath, the subject line. |
Array of objects Headers must be strings and cannot contain any non-ASCII characters or empty spaces. Some headers are reserved and cannot be overwritten. |
{- "body": "<strong>Hello from the API</strong>",
- "body_amp": "string",
- "from_id": 1,
- "reply_to_id": 38,
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
{- "content": {
- "id": 0,
- "newsletter_id": 10,
- "deduplicate_id": "15:1492548073",
- "name": "newsletter variant A",
- "layout": "<html><body>{{ content }}</body></html>",
- "body": "<strong>Hello from the API</strong>",
- "body_amp": "string",
- "language": "fr",
- "type": "email",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
}
Returns information about a specific language variant of a newsletter. If your newsletter includes A/B tests, use Get a translation in a newsletter test group.
newsletter_id required | integer The identifier of a newsletter. |
language | string A language tag of a language variant. If you don't provide a language, we target your default template. If the language variant does not exist, we throw an error. |
curl --request GET \ --url https://api.customer.io/v1/newsletters/{newsletter_id}/language/{language}
{- "content": {
- "id": 0,
- "newsletter_id": 10,
- "deduplicate_id": "15:1492548073",
- "name": "newsletter variant A",
- "layout": "<html><body>{{ content }}</body></html>",
- "body": "<strong>Hello from the API</strong>",
- "body_amp": "string",
- "language": "fr",
- "type": "email",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
}
Update the translation of a newsletter variant. If your newsletter includes A/B tests, use Update a translation in a newsletter test group.
newsletter_id required | integer The identifier of a newsletter. |
language | string A language tag of a language variant. If you don't provide a language, we target your default template. If the language variant does not exist, we throw an error. |
body | string The body of the variant. You cannot modify the body if you created it with our drag-and-drop editor. |
body_amp | string If your message is an email, this is the AMP-enabled body of your message. If your recipient's email client doesn't support AMP, the |
from_id | integer The identifier of the |
reply_to_id | integer Nullable The identifier for the |
recipient | string The recipient address for an action. |
subject | string The subject line for an |
preheader_text | string Also known as "preview text", this specifies the small block of text shown in an end-user's email inbox, next to, or underneath, the subject line. |
Array of objects Headers must be strings and cannot contain any non-ASCII characters or empty spaces. Some headers are reserved and cannot be overwritten. |
{- "body": "<strong>Hello from the API</strong>",
- "body_amp": "string",
- "from_id": 1,
- "reply_to_id": 38,
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
{- "content": {
- "id": 0,
- "newsletter_id": 10,
- "deduplicate_id": "15:1492548073",
- "name": "newsletter variant A",
- "layout": "<html><body>{{ content }}</body></html>",
- "body": "<strong>Hello from the API</strong>",
- "body_amp": "string",
- "language": "fr",
- "type": "email",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
}
Returns information about each test group in a newsletter, including content ids for each group.
newsletter_id required | integer The identifier of a newsletter. |
curl --request GET \ --url https://api.customer.io/v1/newsletters/{newsletter_id}/test_groups
{- "test_groups": [
- {
- "id": 0,
- "name": "A",
- "label": "test 1",
- "winner": false,
- "content_ids": [
- 25,
- 26
]
}, - {
- "id": 2,
- "name": "B",
- "label": "test 2",
- "winner": false,
- "content_ids": [
- 27,
- 28
]
}
]
}
Returns information about a specific language variant of a newsletter in an A/B test group. You can retrieve test_group_ids
from Get variants in a newsletter test group.
newsletter_id required | integer The identifier of a newsletter. |
test_group_id required | string The ID of the A/B test group. |
language | string A language tag of a language variant. If you don't provide a language, we target your default template. If the language variant does not exist, we throw an error. |
curl --request GET \ --url https://api.customer.io/v1/newsletters/{newsletter_id}/test_group/{test_group_id}/language/{language}
{- "content": {
- "id": 0,
- "newsletter_id": 10,
- "deduplicate_id": "15:1492548073",
- "name": "newsletter variant A",
- "layout": "<html><body>{{ content }}</body></html>",
- "body": "<strong>Hello from the API</strong>",
- "body_amp": "string",
- "language": "fr",
- "type": "email",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
}
Update the translation of a newsletter variant in an A/B test. You can retrieve a list of test_group_ids
from Get variants in a newsletter test group.
newsletter_id required | integer The identifier of a newsletter. |
test_group_id required | string The ID of the A/B test group. |
language | string A language tag of a language variant. If you don't provide a language, we target your default template. If the language variant does not exist, we throw an error. |
body | string The body of the variant. You cannot modify the body if you created it with our drag-and-drop editor. |
body_amp | string If your message is an email, this is the AMP-enabled body of your message. If your recipient's email client doesn't support AMP, the |
from_id | integer The identifier of the |
reply_to_id | integer Nullable The identifier for the |
recipient | string The recipient address for an action. |
subject | string The subject line for an |
preheader_text | string Also known as "preview text", this specifies the small block of text shown in an end-user's email inbox, next to, or underneath, the subject line. |
Array of objects Headers must be strings and cannot contain any non-ASCII characters or empty spaces. Some headers are reserved and cannot be overwritten. |
{- "body": "<strong>Hello from the API</strong>",
- "body_amp": "string",
- "from_id": 1,
- "reply_to_id": 38,
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
{- "content": {
- "id": 0,
- "newsletter_id": 10,
- "deduplicate_id": "15:1492548073",
- "name": "newsletter variant A",
- "layout": "<html><body>{{ content }}</body></html>",
- "body": "<strong>Hello from the API</strong>",
- "body_amp": "string",
- "language": "fr",
- "type": "email",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
]
}
}
Returns a metrics for an individual newsletter variant—either an individual language in a multi-language newsletter or a message in an A/B test. This endpoint returns metrics both in total and in steps
(days, weeks, etc) over a period
of time. Stepped series
metrics are arranged from oldest to newest (i.e. the 0-index for any result is the oldest period/step).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
newsletter_id required | integer The identifier of a newsletter. |
content_id required | integer The identifier of a message in a newsletter. If your newsletter is an A/B test or has multiple languages, you may have multiple |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
type | string Enum: "email" "webhook" "twilio" "slack" "push" "in_app" The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. |
curl --request GET \ --url https://api.customer.io/v1/newsletters/{newsletter_id}/contents/{content_id}/metrics
{- "metric": {
- "series": {
- "2xx": [
- 0
], - "3xx": [
- 0
], - "4xx": [
- 0
], - "5xx": [
- 0
], - "attempted": [
- 0
], - "bounced": [
- 0
], - "clicked": [
- 0
], - "converted": [
- 0
], - "created": [
- 0
], - "deferred": [
- 0
], - "delivered": [
- 0
], - "drafted": [
- 0
], - "failed": [
- 0
], - "opened": [
- 0
], - "sent": [
- 0
], - "spammed": [
- 0
], - "suppressed": [
- 0
], - "undeliverable": [
- 0
], - "topic_unsubscribed": [
- 0
], - "unsubscribed": [
- 0
]
}
}
}
Returns link click metrics for an individual newsletter variant—an individual language in a multi-language newsletter or a message in an A/B test. Unless you specify otherwise, the response contains data for the maximum period by days (45 days).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
newsletter_id required | integer The identifier of a newsletter. |
content_id required | integer The identifier of a message in a newsletter. If your newsletter is an A/B test or has multiple languages, you may have multiple |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
type | string Enum: "email" "webhook" "twilio" "slack" "push" "in_app" The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. |
curl --request GET \ --url https://api.customer.io/v1/newsletters/{newsletter_id}/contents/{content_id}/metrics/links
{- "links": [
- {
- "metric": {
- "series": {
- "clicked": [
- 1,
- 3,
- 5,
- 7
]
}
}
}
]
}
Objects are "groups" that you can relate people to in Customer.io—like the companies they work for, the online classes they take, and so on. These APIs help you find objects, their attributes, the people they're related to, etc. Use the track API v1 or the Track v2 API to add and relate people to objects to your workspace and assign their attributes.
Returns a list of object types in your system. Because each object type is an incrementing ID, you may need to use this endpoint to find the ID of the object type you want to query, create, or modify.
curl --request GET \ --url https://api.customer.io/v1/object_types
{- "types": [
- {
- "enabled": true,
- "icon": "calendar",
- "id": "1",
- "name": "Concerts",
- "singular_name": "Concert",
- "singular_slug": "concert",
- "slug": "concerts"
}
]
}
Use a set of filter conditions to find objects in your workspace. Returns a list of object IDs that you can use to look up object attributes, or to create or modify objects.
The list is paged if you have a large number of objects. You can set the limit
for the number of objects returned, and use the start
to page through the results. It's possible that you'll see duplicate entries across pages. If you want to export objects or relationships, you may want to use the export feature in our UI to return complete results.
start | string The token for the page of results you want to return. Responses contain a |
limit | integer The maximum number of results you want to retrieve per page. |
The object_type_id
you want to search in, and the filter
you want to apply to find objects. Both are required. The object called object_attribute
requires type_id
, as well, which should match the object_type_id
.
object_type_id required | string The type of object you want to search in. Object type IDs are integers passed as strings. |
required | object When filtering for objects, you can use The top level of this object can only contain a single property, but you can nest |
{- "object_type_id": "1",
- "filter": {
- "and": [
- {
- "object_attribute": {
- "field": "name",
- "operator": "exists",
- "type_id": "1"
}
}, - {
- "not": {
- "object_attribute": {
- "field": "name",
- "operator": "eq",
- "value": "acme corp",
- "type_id": "1"
}
}
}
]
}
}
{- "identifiers": [
- {
- "cio_object_id": "ob020101",
- "object_id": "ae3000"
}
], - "ids": [
- "ae3000"
], - "next": "string"
}
Get a list of people people related to an object.
You can use the start
parameter with the next
property in responses to return pages of results. However, it's possible that you'll see duplicate entries across pages. If you want to export objects or relationships, you may want to use the export feature in our UI to return complete results.
object_type_id required | integer Example: 1 The object type an object belongs to—like "Companies" or "Accounts". Object type IDs begin at |
object_id required | string Example: abc123 The |
start | string The token for the page of results you want to return. Responses contain a |
limit | integer The maximum number of results you want to retrieve per page. |
id_type | string Default: "object_id" Enum: "object_id" "cio_object_id" |
curl --request GET \ --url 'https://api.customer.io/v1/objects/{object_type_id}/{object_id}/relationships?start=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&id_type=SOME_STRING_VALUE'
{- "cio_relationships": [
- {
- "identifiers": {
- "cio_id": "ob020101",
- "id": "acmeInc"
}, - "object_type_id": "1",
- "object_type_disabled": false
}
], - "next": "string"
}
Get a list of attributes for an object. Attributes are things you know about an object—like an account name, billing date, etc.
object_type_id required | integer Example: 1 The object type an object belongs to—like "Companies" or "Accounts". Object type IDs begin at |
object_id required | string Example: abc123 The |
id_type | string Default: "object_id" Enum: "object_id" "cio_object_id" |
curl --request GET \ --url 'https://api.customer.io/v1/objects/{object_type_id}/{object_id}/attributes?id_type=SOME_STRING_VALUE'
{- "object": {
- "attributes": {
- "Object Attributes1": null,
- "Object Attributes2": null
}, - "timestamps": {
- "Object Attribute Timestamps1": 0,
- "Object Attribute Timestamps2": 0
}, - "identifiers": {
- "cio_object_id": "a3000001",
- "id": "42",
- "email": "test@example.com"
}, - "object_type_id": "1"
}
}
Set up webhooks to inform an external service about Customer.io events. Webhooks can notify you immediately when immediately when customer attributes change or when people open your messages.
Create a new webhook configuration.
name required | string The name of your webhook. |
endpoint required | string <url> The webhook URL. |
events required | Array of strings non-empty Items Enum: "customer_subscribed" "customer_unsubscribed" "cio_subscription_preferences_changed" "email_drafted" "email_attempted" "email_sent" … 44 more Specifies the types of events you want to report to your webhook. See our reporting webhooks reference for more information about event types and the information they return. |
disabled | boolean Set to |
full_resolution | boolean Default: false Set to |
with_content | boolean Set to |
{- "name": "my cool webhook",
- "disabled": false,
- "full_resolution": true,
- "with_content": false,
- "events": [
- "email_failed",
- "webhook_failed"
]
}
{- "name": "my cool webhook",
- "id": 4,
- "disabled": false,
- "full_resolution": true,
- "with_content": false,
- "events": [
- "email_failed",
- "webhook_failed"
]
}
curl --request GET \ --url https://api.customer.io/v1/reporting_webhooks
{- "reporting_webhooks": [
- {
- "name": "my cool webhook",
- "id": 4,
- "disabled": false,
- "full_resolution": true,
- "with_content": false,
- "events": [
- "email_failed",
- "webhook_failed"
]
}
]
}
Returns information about a specific reporting webhook.
webhook_id required | integer The identifier of a webhook. |
curl --request GET \ --url https://api.customer.io/v1/reporting_webhooks/{webhook_id}
{- "name": "my cool webhook",
- "id": 4,
- "disabled": false,
- "full_resolution": true,
- "with_content": false,
- "events": [
- "email_failed",
- "webhook_failed"
]
}
Update the configuration of a reporting webhook. Turn events on or off, change the webhook URL, etc.
webhook_id required | integer The identifier of a webhook. |
name required | string The name of your webhook. |
endpoint required | string <url> The webhook URL. |
events required | Array of strings non-empty Items Enum: "customer_subscribed" "customer_unsubscribed" "cio_subscription_preferences_changed" "email_drafted" "email_attempted" "email_sent" … 44 more Specifies the types of events you want to report to your webhook. See our reporting webhooks reference for more information about event types and the information they return. |
disabled | boolean Set to |
full_resolution | boolean Default: false Set to |
with_content | boolean Set to |
{- "name": "my cool webhook",
- "disabled": false,
- "full_resolution": true,
- "with_content": false,
- "events": [
- "email_failed",
- "webhook_failed"
]
}
{- "name": "my cool webhook",
- "id": 4,
- "disabled": false,
- "full_resolution": true,
- "with_content": false,
- "events": [
- "email_failed",
- "webhook_failed"
]
}
Customer.io sends events to your webhook URL in the following format. Events are generally organized by object_type
—representing the message or Customer.io action (i.e. email
, sms
, etc)—and the specific metric
pertaining to the type (i.e. sent
, bounced
, etc).
x-cio-timestamp required | integer <unix timestamp> The timestamp when the request was sent. |
x-cio-signature required | string A string combining your webhook signing key with the body of webhook request using an HMAC-SHA256 hash, used to help you securely verify requests. |
metric required | string Value: "subscribed" The metric recorded by the event. For |
event_id required | string The unique ID of the reporting webhook event being sent. |
object_type required | string Value: "customer" The event represents a customer subscribing, unsubscribing, or changing their subscription preferences. |
timestamp required | integer <unix timestamp> The unix timestamp when the event occurred. |
required | object Contains information about the event, specific to the |
{- "metric": "subscribed",
- "event_id": "01E4C4CT6YDC7Y5M7FE1GWWPQJ",
- "object_type": "customer",
- "timestamp": 1613063089,
- "data": {
- "customer_id": "42",
- "email_address": "test@example.com",
- "identifiers": {
- "id": "42",
- "email": "test@example.com",
- "cio_id": "d9c106000001"
}
}
}
Segments are groups of people, subsets of your audience. You get get information about segments and the customers contained by a segment. You can also create or delete manual segments through the API. Use the UI to create, update, or delete data-driven segments.
Create a manual segment with a name and a description. This request creates an empty segment.
required | object |
{- "segment": {
- "name": "Manual Segment 1",
- "description": "My first manual segment"
}
}
{- "segment": {
- "id": 7,
- "deduplicate_id": "15:1492548073",
- "name": "Manual Segment 1",
- "description": "My first manual segment",
- "state": "events",
- "progress": null,
- "type": "manual",
- "tags": null
}
}
curl --request GET \ --url https://api.customer.io/v1/segments
{- "segments": [
- {
- "id": 7,
- "deduplicate_id": "15:1492548073",
- "name": "Manual Segment 1",
- "description": "My first manual segment",
- "state": "events",
- "progress": null,
- "type": "manual",
- "tags": null
}
]
}
Return information about a segment.
segment_id required | integer <int32> The identifier for a segment. You can find your segment's ID on its page in the dashboard—go to Segments, select your segment, and find the ID under Usage. Or you can find your segment using the App API. |
curl --request GET \ --url https://api.customer.io/v1/segments/{segment_id}
{- "segment": {
- "id": 7,
- "deduplicate_id": "15:1492548073",
- "name": "Manual Segment 1",
- "description": "My first manual segment",
- "state": "events",
- "progress": null,
- "type": "manual",
- "tags": null
}
}
Delete a manual segment.
segment_id required | integer <int32> The identifier for a segment. You can find your segment's ID on its page in the dashboard—go to Segments, select your segment, and find the ID under Usage. Or you can find your segment using the App API. |
curl --request DELETE \ --url https://api.customer.io/v1/segments/{segment_id}
Use this endpoint to find out which campaigns and newsletters use a segment.
segment_id required | integer <int32> The identifier for a segment. You can find your segment's ID on its page in the dashboard—go to Segments, select your segment, and find the ID under Usage. Or you can find your segment using the App API. |
curl --request GET \ --url https://api.customer.io/v1/segments/{segment_id}/used_by
{- "used_by": {
- "campaigns": [
- 0
], - "sent_newsletters": [
- 0
], - "draft_newsletters": [
- 0
]
}
}
Returns the membership count for a segment.
segment_id required | integer <int32> The identifier for a segment. You can find your segment's ID on its page in the dashboard—go to Segments, select your segment, and find the ID under Usage. Or you can find your segment using the App API. |
curl --request GET \ --url https://api.customer.io/v1/segments/{segment_id}/customer_count
{- "count": 0
}
Returns customers in a segment. This endpoint returns an array of identifiers
; each object in the array represents a person and contains the identifier values allowed in your workspace. In general, we recommend that you use identifiers
rather than ids
to find people, because it provides more information.
If your workspace does not use email as a unique identifier for people, identifiers
does not contain email
values. Go to your Workspace Settings to find out which identifiers your workspace supports.
The ids
array only lists ID values for people in a segment; if your workspace uses both email
and id
as identifiers, it's possible that a member of your segment does not have an id
value, resulting in an empty string in the ids
array.
segment_id required | integer <int32> The identifier for a segment. You can find your segment's ID on its page in the dashboard—go to Segments, select your segment, and find the ID under Usage. Or you can find your segment using the App API. |
start | string The token for the page of results you want to return. Responses contain a |
limit | integer <= 30000 Default: 1000 The maximum number of results you want to retrieve per page. |
curl --request GET \ --url https://api.customer.io/v1/segments/{segment_id}/membership
{- "ids": [
- "string"
], - "identifiers": [
- {
- "email": "test@example.com",
- "id": 2,
- "cio_id": "a3000001"
}
], - "next": "string"
}
Return information about your senders—the addresses that you send messages from—including usage information for your different senders.
Returns a list of senders in your workspace. Senders are who your messages are "from".
start | string The token for the page of results you want to return. Responses contain a |
limit | integer The maximum number of results you want to retrieve per page. |
sort | string Enum: "asc" "desc" Determine how you want to sort results, |
curl --request GET \ --url https://api.customer.io/v1/sender_identities
{- "sender_identities": [
- {
- "id": 4534,
- "deduplicate_id": "4534:1478035647",
- "name": "Cher Ami",
- "email": "test@example.com",
- "address": "Cher Ami <test@example.com>",
- "template_type": "email",
- "auto_generated": false
}
]
}
Returns information about a specific sender.
sender_id required | integer The identifier of a sender. |
curl --request GET \ --url https://api.customer.io/v1/sender_identities/{sender_id}
{- "sender_identity": {
- "id": 4534,
- "deduplicate_id": "4534:1478035647",
- "name": "Cher Ami",
- "email": "test@example.com",
- "address": "Cher Ami <test@example.com>",
- "template_type": "email",
- "auto_generated": false
}
}
Returns lists of the campaigns and newsletters that use a sender.
sender_id required | integer The identifier of a sender. |
curl --request GET \ --url https://api.customer.io/v1/sender_identities/{sender_id}/used_by
{- "campaigns": [
- 0
], - "sent_newsletters": [
- 0
], - "draft_newsletters": [
- 0
]
}
Snippets are reusable pieces of messages, like a common email footer or link that you use in your messages. Use these endpoints to create, get, or delete snippets.
Returns a list of snippets in your workspace. Snippets are pieces of reusable content, like a common footer for your emails.
curl --request GET \ --url https://api.customer.io/v1/snippets
{- "snippets": [
- {
- "name": "address",
- "value": "<strong>My Company</strong></br>1234 Fake St<br/>Fake,NY<br/>10111",
- "updated_at": 1582500000
}
]
}
In your payload, you'll pass a name
and value
. Snippet names are unique. If the snippet name
does not exist, we'll create a new snippet. If the name
exists, we'll update the existing snippet.
name required | string The name of the snippet, must be unique. |
value required | string The contents of the snippet. |
{- "name": "address",
- "value": "<strong>My Company</strong></br>1234 Fake St<br/>Fake,NY<br/>10111",
- "updated_at": 1582500000
}
{- "snippet": {
- "name": "address",
- "value": "<strong>My Company</strong></br>1234 Fake St<br/>Fake,NY<br/>10111",
- "updated_at": 1582500000
}
}
Remove a snippet. You can only remove a snippet that is not in use. If your snippet is in use, you'll receive a 400
error.
snippet_name required | string The name of a snippet. |
curl --request DELETE \ --url https://api.customer.io/v1/snippets/{snippet_name}
{- "errors": [
- {
- "detail": "unable to delete snippet in use",
- "status": "400"
}
]
}
A subscription center differentiates the types of messages available for your product. Your audience sets subscription preferences by name, but we record subscription preferences by topic ID. You can use these endpoints to get a list of topics and names, helping you understand your audience's subscription preferences.
Returns a list of subscription topics in your workspace. If there are no topics, it returns an empty array.
curl --request GET \ --url https://api.customer.io/v1/subscription_topics
{- "topics": [
- {
- "name": "Product Updates",
- "description": "For people who want updates on product releases.",
- "subscribed_by_default": false,
- "id": 4,
- "identifier": "topic_4"
}
]
}
Send, and return information about, transactional messages. Transactional messages are messages that your audience explicitly requests or expects, like purchase receipts or password reset requests.
The transactional_id
in requests represents the transactional message template. Each individual send—the instance of a message sent to an individual person—is called a "delivery".
Returns a list of your transactional messages—the transactional IDs that you use to trigger an individual transactional delivery. This endpoint does not return information about deliveries (instances of a message sent to a person) themselves.
curl --request GET \ --url https://api.customer.io/v1/transactional
{- "messages": [
- {
- "id": 2,
- "name": "password reset",
- "description": "sends a temporary password and lets the customer reset their password.",
- "send_to_unsubscribed": true,
- "link_tracking": true,
- "open_tracking": true,
- "hide_message_body": true,
- "queue_drafts": true,
- "created_at": 1552341937,
- "updated_at": 1552341937
}
]
}
Returns information about an individual transactional message.
transactional_id required | integer The identifier of your transactional message. You'll find this in the UI or URL of your transactional message. For example, if this is the path of a transactional message URL - |
curl --request GET \ --url https://api.customer.io/v1/transactional/{transactional_id}
{- "message": {
- "id": 2,
- "name": "password reset",
- "description": "sends a temporary password and lets the customer reset their password.",
- "send_to_unsubscribed": true,
- "link_tracking": true,
- "open_tracking": true,
- "hide_message_body": true,
- "queue_drafts": true,
- "created_at": 1552341937,
- "updated_at": 1552341937
}
}
Returns the content variants of a transactional message, where each variant represents a different language.
transactional_id required | integer The identifier of your transactional message. You'll find this in the UI or URL of your transactional message. For example, if this is the path of a transactional message URL - |
curl --request GET \ --url https://api.customer.io/v1/transactional/{transactional_id}/contents
{- "contents": [
- {
- "id": 96,
- "name": "Receipt",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "language": "fr",
- "type": "email",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
]
}
Update the body of a transactional email. This fully overwrites your existing transactional message. We'll use your updated content for any future transactional requests (/v1/send/email
), so make sure that you test your message before you update it.
transactional_id required | integer The identifier of your transactional message. You'll find this in the UI or URL of your transactional message. For example, if this is the path of a transactional message URL - |
content_id required | integer The content variant of your transactional message. You'll find the id in the URL of your transactional message. For example, if this is the path of a transactional message URL - |
body | string The body of the transactional message. You cannot modify the body if you created it with our drag-and-drop editor. |
from_id | integer The identifier of the |
reply_to_id | integer Nullable The identifier for the |
subject | string The subject line for an |
preheader_text | string Also known as "preview text", this specifies the small block of text shown in an end-user's email inbox, next to, or underneath, the subject line. |
Array of objects Headers must be strings and cannot contain any non-ASCII characters or empty spaces. Some headers are reserved and cannot be overwritten. | |
body_amp | string If your message is an email, this is the AMP-enabled body of your message. If your recipient's email client doesn't support AMP, the |
{- "body": "string",
- "from_id": 1,
- "reply_to_id": 38,
- "subject": "Did you get that thing I sent you?",
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
{- "content": [
- {
- "id": 96,
- "name": "Receipt",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "language": "fr",
- "type": "email",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
]
}
Returns information about a translation of an individual transactional message, including the message content.
transactional_id required | integer The identifier of your transactional message. You'll find this in the UI or URL of your transactional message. For example, if this is the path of a transactional message URL - |
language | string A language tag of a language variant. If you don't provide a language, we target your default template. If the language variant does not exist, we throw an error. |
curl --request GET \ --url https://api.customer.io/v1/transactional/{transactional_id}/language/{language}
{- "content": [
- {
- "id": 96,
- "name": "Receipt",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "language": "fr",
- "type": "email",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
]
}
Update the body and other data of a specific language variant for a transactional message. This fully overwrites this specific translation of your existing transactional message.
transactional_id required | integer The identifier of your transactional message. You'll find this in the UI or URL of your transactional message. For example, if this is the path of a transactional message URL - |
language | string A language tag of a language variant. If you don't provide a language, we target your default template. If the language variant does not exist, we throw an error. |
body | string The body of the transactional message. You cannot modify the body if you created it with our drag-and-drop editor. |
from_id | integer The identifier of the |
reply_to_id | integer Nullable The identifier for the |
subject | string The subject line for an |
preheader_text | string Also known as "preview text", this specifies the small block of text shown in an end-user's email inbox, next to, or underneath, the subject line. |
Array of objects Headers must be strings and cannot contain any non-ASCII characters or empty spaces. Some headers are reserved and cannot be overwritten. | |
body_amp | string If your message is an email, this is the AMP-enabled body of your message. If your recipient's email client doesn't support AMP, the |
{- "body": "string",
- "from_id": 1,
- "reply_to_id": 38,
- "subject": "Did you get that thing I sent you?",
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
{- "content": [
- {
- "id": 96,
- "name": "Receipt",
- "created": 1552341937,
- "updated": 1552341937,
- "body": "string",
- "language": "fr",
- "type": "email",
- "from": "sentFrom@example.com",
- "from_id": 1,
- "reply_to": "replyto@example.com",
- "reply_to_id": 38,
- "preprocessor": "premailer",
- "recipient": "{{customer.email}}",
- "subject": "Did you get that thing I sent you?",
- "bcc": "string",
- "fake_bcc": true,
- "preheader_text": "string",
- "headers": [
- {
- "name": "X-Mailgun-Tag",
- "value": "tag-name-for-tracking"
}
], - "body_amp": "string"
}
]
}
Returns a list of metrics for a transactional message in steps
(days, weeks, etc). We return metrics from oldest to newest (i.e. the 0-index for any result is the oldest step/period).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
transactional_id required | integer The identifier of your transactional message. You'll find this in the UI or URL of your transactional message. For example, if this is the path of a transactional message URL - |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
curl --request GET \ --url https://api.customer.io/v1/transactional/{transactional_id}/metrics
{- "metric": {
- "series": {
- "attempted": [
- 0
], - "bounced": [
- 0
], - "clicked": [
- 0
], - "converted": [
- 0
], - "created": [
- 0
], - "deferred": [
- 0
], - "delivered": [
- 0
], - "drafted": [
- 0
], - "failed": [
- 0
], - "opened": [
- 0
], - "sent": [
- 0
], - "spammed": [
- 0
], - "suppressed": [
- 0
], - "undeliverable": [
- 0
], - "topic_unsubscribed": [
- 0
], - "unsubscribed": [
- 0
]
}
}
}
Returns metrics for clicked links from a transactional message, both in total and in series
periods (days, weeks, etc). series
metrics are ordered oldest to newest (i.e. the 0-index for any result is the oldest step/period).
You cannot request fewer than 2 steps of any period (2 hours, 2 days, 2 weeks, or 2 months). For instance, ?period=days&steps=1
means two days - the 48 hours before the API request was made. ?period=days&steps=0
returns the same as the maximum of the period - ?period=days&steps=45
. See the steps
parameter below for the maximum count of each period.
transactional_id required | integer The identifier of your transactional message. You'll find this in the UI or URL of your transactional message. For example, if this is the path of a transactional message URL - |
period | string Default: "days" Enum: "hours" "days" "weeks" "months" The unit of time for your report. |
steps | integer The number of periods you want to return. Defaults to the maximum available, or |
unique | boolean Default: false If true, the response contains only unique customer results, i.e. a customer who clicks a link twice is only counted once. If false, the response contains the total number of results without regard to uniqueness. |
curl --request GET \ --url https://api.customer.io/v1/transactional/{transactional_id}/metrics/links
{- "links": [
- {
- "metric": {
- "series": {
- "clicked": [
- 1,
- 3,
- 5,
- 7
]
}
}
}
]
}
Returns information about the deliveries (instances of messages sent to individual people) from a transactional message. Provide query parameters to refine the metrics you want to return.
Use the start_ts
and end_ts
to find messages within a time range. If your request doesn't include start_ts
and end_ts
parameters, we'll return the most recent 6 months of messages. If your start_ts
and end_ts
range is more than 12 months, we'll return 12 months of data from the most recent timestamp in your request.
transactional_id required | integer The identifier of your transactional message. You'll find this in the UI or URL of your transactional message. For example, if this is the path of a transactional message URL - |
start | string The token for the page of results you want to return. Responses contain a |
limit | integer The maximum number of results you want to retrieve per page. |
metric | string Enum: "attempted" "sent" "delivered" "opened" "clicked" "converted" … 6 more Determines the metric(s) you want to return. |
state | string Enum: "failed" "sent" "drafted" "attempted" The state of a broadcast. |
start_ts | integer <unix timestamp> The beginning timestamp for your query. |
end_ts | integer <unix timestamp> The ending timestamp for your query. |
curl --request GET \ --url https://api.customer.io/v1/transactional/{transactional_id}/messages
{- "messages": [
- {
- "id": "dgOq6QWq6QUDAAF22PaOyFVqVxHY3rI5fsg=",
- "deduplicate_id": "dgOq6QWq6QUDAAF22PaOyFVqVxHY3rI5fsg=:1609957872",
- "msg_template_id": 589,
- "action_id": null,
- "customer_id": "1a55d8d1-b13d-4f1f-858f-a93ef21e3a7d",
- "identifiers": {
- "id": "1a55d8d1-b13d-4f1f-858f-a93ef21e3a7d",
- "email": "person@example.com",
- "cio_id": 786433
}, - "recipient": "person@example.com",
- "subject": "Reset your password",
- "metrics": {
- "delivered": 1609957872,
- "sent": 1609957832
}, - "created": 1609957805,
- "failure_message": null,
- "newsletter_id": null,
- "content_id": null,
- "campaign_id": null,
- "broadcast_id": null,
- "type": "email|push",
- "forgotten": false
}
]
}
An API to retrieve information about your workspaces in your account. You can use this to look up counts for messages sent, monthly billable emails sent, people, and objects.
curl --request GET \ --url https://api.customer.io/v1/workspaces
{- "workspaces": [
- {
- "id": "13XXXX",
- "name": "Workspace 1",
- "messages_sent": 100202,
- "billable_messages_sent": 75124,
- "people": 25666,
- "object_types": 4,
- "objects": 10
}
]
}