openapi: 3.2.0 info: version: 1.0.0 title: Customer.io App Broadcasts API description: Our App API provides ways to trigger messages and retrieve information about people, campaigns, broadcasts, and more. servers: - url: https://api.customer.io description: The base URL for broadcasts, transactional messages, and data-retrieval APIs. These endpoints use bearer authorization, and require a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). - url: https://api-eu.customer.io description: The base URL for broadcasts, transactional messages, and data-retrieval APIs (EU region). These endpoints use bearer authorization, and require a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). tags: - name: Broadcasts x-displayName: API-triggered Broadcasts description: In the UI, we frequently refer to broadcasts that you trigger through these endpoints as "API triggered" broadcasts. paths: /v1/campaigns/{broadcast_id}/triggers/{trigger_id}/errors: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). parameters: - name: broadcast_id in: path required: true description: The ID of the broadcast that you want to return information about. schema: type: integer - name: trigger_id in: path required: true description: The ID of the campaign trigger that you want to return information for. schema: type: integer example: 3 - name: start in: query required: false description: The token for the page of results you want to return. Responses contain a `next` property. Use this property as the `start` value to return the next page of results. schema: type: string - name: limit in: query required: false description: The maximum number of results you want to retrieve per page. schema: type: integer get: operationId: broadcastErrors security: - Bearer-Auth: [] tags: - Broadcasts summary: Get broadcast error descriptions description: 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. responses: '200': description: Returns an array of errors. content: application/json: schema: type: object properties: errors: description: 'A list of errors in the format `line : ` to help you troubleshoot errors associated with your audience or data file.' type: array items: type: string next: type: integer description: The offset to pass as the `start` value to fetch the next page of errors. '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. '401': description: Unauthorized request. Make sure that you provided the right credentials. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/campaigns/{broadcast_id}/triggers/{trigger_id}/errors" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/campaigns/%7Bbroadcast_id%7D/triggers/%7Btrigger_id%7D/errors\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/campaigns/%7Bbroadcast_id%7D/triggers/%7Btrigger_id%7D/errors") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/campaigns/%7Bbroadcast_id%7D/triggers/%7Btrigger_id%7D/errors") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/campaigns/%7Bbroadcast_id%7D/triggers/%7Btrigger_id%7D/errors\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" /v1/broadcasts: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). get: summary: List broadcasts operationId: listBroadcasts security: - Bearer-Auth: [] description: Returns a list of your API-triggered broadcasts and associated metadata. tags: - Broadcasts responses: '200': description: Returns an array of API-triggered broadcasts. content: application/json: schema: type: object properties: broadcasts: type: array items: x-scalar-ignore: true type: object properties: id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the broadcast. readOnly: true type: type: string description: The type of broadcast. enum: - triggered_broadcast created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true active: type: boolean description: If true, the broadcast is active. state: type: string description: The state of the broadcast. enum: - running - draft actions: type: array description: A list of actions used by the broadcast. items: type: object properties: id: type: integer description: The identifier for the action. type: type: string description: The type of action. enum: - email - webhook - push - sms - slack msg_template_ids: x-scalar-ignore: true type: array deprecated: true description: Indicates the message template(s) used in this broadcast. items: type: object properties: id: type: integer description: The identifier for the template. type: type: string description: The type of template. enum: - email - webhook - push - sms - slack first_started: type: integer format: unix timestamp description: The date and time when you activated the broadcast. example: 1552341937 tags: type: array description: An array of tags you set on this broadcast. items: type: string example: 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 '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/broadcasts") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" /v1/broadcasts/{broadcast_id}: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). parameters: - name: broadcast_id in: path required: true description: The identifier of a broadcast. schema: type: integer get: operationId: getBroadcast summary: Get a broadcast security: - Bearer-Auth: [] description: Returns metadata for an individual broadcast. tags: - Broadcasts responses: '200': description: Returns metadata for the broadcast. content: application/json: schema: type: object properties: broadcast: x-scalar-ignore: true type: object properties: id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the broadcast. readOnly: true type: type: string description: The type of broadcast. enum: - triggered_broadcast created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true active: type: boolean description: If true, the broadcast is active. state: type: string description: The state of the broadcast. enum: - running - draft actions: type: array description: A list of actions used by the broadcast. items: type: object properties: id: type: integer description: The identifier for the action. type: type: string description: The type of action. enum: - email - webhook - push - sms - slack msg_template_ids: x-scalar-ignore: true type: array deprecated: true description: Indicates the message template(s) used in this broadcast. items: type: object properties: id: type: integer description: The identifier for the template. type: type: string description: The type of template. enum: - email - webhook - push - sms - slack first_started: type: integer format: unix timestamp description: The date and time when you activated the broadcast. example: 1552341937 tags: type: array description: An array of tags you set on this broadcast. items: type: string example: 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 '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts/{broadcast_id}" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts/%7Bbroadcast_id%7D\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/broadcasts/%7Bbroadcast_id%7D") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" /v1/campaigns/{broadcast_id}/triggers/{trigger_id}: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). parameters: - name: broadcast_id in: path required: true description: The ID of the broadcast that you want to return information about. schema: type: integer - name: trigger_id in: path required: true description: The ID of the campaign trigger that you want to return information for. schema: type: integer example: 3 get: operationId: broadcastStatus security: - Bearer-Auth: [] tags: - Broadcasts summary: Get the status of a broadcast description: 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. responses: '200': description: Returns the status of your broadcast. content: application/json: schema: x-scalar-ignore: true type: object description: You can get triggers to know when you triggered a broadcast and whether or not it's been processed. properties: id: type: integer description: The identifier for a broadcast trigger. broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 created_at: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true processed_at: type: integer format: unix timestamp description: The date-time when Customer.io processed the trigger. '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/campaigns/{broadcast_id}/triggers/{trigger_id}" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/campaigns/%7Bbroadcast_id%7D/triggers/%7Btrigger_id%7D\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/campaigns/%7Bbroadcast_id%7D/triggers/%7Btrigger_id%7D") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/campaigns/%7Bbroadcast_id%7D/triggers/%7Btrigger_id%7D") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/campaigns/%7Bbroadcast_id%7D/triggers/%7Btrigger_id%7D\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" /v1/broadcasts/{broadcast_id}/metrics: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). parameters: - name: broadcast_id in: path required: true description: The identifier of a broadcast. schema: type: integer - name: period in: query required: false description: The unit of time for your report. schema: type: string default: days enum: - hours - days - weeks - months - name: steps in: query required: false description: The number of periods you want to return. Defaults to the maximum available, or `12` if the period is in `months`. Maximums are 24 hours, 45 days, 12 weeks, or 121 months. Days start at 00:00 EST. Weeks start at 00:00 EST on Sunday. Months start at 00:00 EST on the 1st of the month. schema: type: integer - name: type in: query required: false description: The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. schema: type: string enum: - email - webhook - twilio - whatsapp - slack - push - in_app - live_notification get: operationId: broadcastMetrics summary: Get broadcast metrics security: - Bearer-Auth: [] description: '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.' tags: - Broadcasts responses: '200': description: Returns broadcast metrics by `series` (with increments are based on the `period` and `step` in your request) for the broadcast. content: application/json: schema: type: object properties: metric: type: object properties: series: allOf: - x-scalar-ignore: true type: object description: Metrics grouped by the requested resolution. Each property is an array where each entry represents one period, such as one day. properties: 2xx: type: array items: type: integer description: 2xx responses by period, representative of webhook performance. 3xx: type: array items: type: integer description: 3xx responses by period, representative of webhook performance. 4xx: type: array items: type: integer description: 4xx responses by period, representative of webhook performance. 5xx: type: array items: type: integer description: 5xx responses by period, representative of webhook performance. - x-scalar-ignore: true description: Metrics grouped by the requested resolution. Each property is an array where each entry represents one period, such as one day. type: object properties: attempted: type: array items: type: integer description: The number of `attempted` messages. bounced: type: array items: type: integer description: The number of `bounced` messages. clicked: type: array items: type: integer description: The number of `clicked` messages. human_clicked: type: array items: type: integer description: The number of `clicked` emails excluding machine clicks. This metric is reliable starting April 20, 2025. [Learn more](/journeys/metrics/analytics/#delivery-metrics). prefetch_clicked: type: array items: type: integer description: The number of `clicked` emails attributed to machines. This metric is reliable starting April 20, 2025. converted: type: array items: type: integer description: The number of `converted` messages. created: type: array items: type: integer description: The number of `created` messages. deferred: type: array items: type: integer description: The number of `deferred` messages. delivered: type: array items: type: integer description: The number of `delivered` messages. drafted: type: array items: type: integer description: The number of `drafted` messages. failed: type: array items: type: integer description: The number of `failed` messages. opened: type: array items: type: integer description: The number of `opened` messages. human_opened: type: array items: type: integer description: The number of `opened` emails excluding machine opens. This metric is reliable starting March 20, 2025. [Learn more](/journeys/metrics/analytics/#delivery-metrics). prefetch_opened: type: array items: type: integer description: The number of `opened` emails attributed to machines. This metric is reliable starting March 20, 2025. sent: type: array items: type: integer description: The number of sent messages. spammed: type: array items: type: integer description: The number of spam complaints. suppressed: type: array items: type: integer description: The number of `suppressed` messages. undeliverable: type: array items: type: integer description: The number of `undeliverable` messages. topic_unsubscribed: type: array items: type: integer description: The number of topic unsubscribes in a given period. unsubscribed: type: array items: type: integer description: The number of unsubscribes attributed to the campaign or message. '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts/{broadcast_id}/metrics" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts/%7Bbroadcast_id%7D/metrics\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/metrics") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/broadcasts/%7Bbroadcast_id%7D/metrics") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/metrics\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" /v1/broadcasts/{broadcast_id}/metrics/links: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). parameters: - name: broadcast_id in: path required: true description: The identifier of a broadcast. schema: type: integer - name: period in: query required: false description: The unit of time for your report. schema: type: string default: days enum: - hours - days - weeks - months - name: steps in: query required: false description: The number of periods you want to return. Defaults to the maximum available, or `12` if the period is in `months`. Maximums are 24 hours, 45 days, 12 weeks, or 121 months. Days start at 00:00 EST. Weeks start at 00:00 EST on Sunday. Months start at 00:00 EST on the 1st of the month. schema: type: integer - name: unique in: query required: false description: 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. schema: type: boolean default: false get: operationId: broadcastLinks summary: Get broadcast link metrics security: - Bearer-Auth: [] description: '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.' tags: - Broadcasts responses: '200': description: Returns an array of link objects. Each object represents a different link in your broadcast and contains independent metrics. content: application/json: schema: type: object properties: links: type: array items: x-scalar-ignore: true type: object properties: link: type: object properties: id: type: integer description: The ID of the link. example: 1234 href: type: string description: The link destination—a URL, mailto, etc. example: https://docs.customer.io metric: type: object description: Contains metrics for the link. properties: series: type: object properties: clicked: type: array description: An array of results from oldest to newest, where each result indicates a period. items: type: integer example: - 1 - 3 - 5 - 7 human_clicked: type: array description: An array of human click counts (clicks excluding machine clicks) from oldest to newest, where each result indicates a period. This metric is reliable starting April 20, 2025. [Learn more](/journeys/metrics/analytics/#delivery-metrics). items: type: integer example: - 1 - 2 - 3 - 4 machine_clicked: type: array description: An array of machine click counts (clicks attributed to bots or prefetching) from oldest to newest, where each result indicates a period. This metric is reliable starting April 20, 2025. [Learn more](/journeys/metrics/analytics/#delivery-metrics). items: type: integer example: - 0 - 1 - 1 - 2 '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts/{broadcast_id}/metrics/links" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts/%7Bbroadcast_id%7D/metrics/links\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/metrics/links") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/broadcasts/%7Bbroadcast_id%7D/metrics/links") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/metrics/links\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" /v1/broadcasts/{broadcast_id}/actions: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). parameters: - name: broadcast_id in: path required: true description: The identifier of a broadcast. schema: type: integer get: operationId: broadcastActions summary: List broadcast actions security: - Bearer-Auth: [] description: Returns the actions that occur as a part of a broadcast. tags: - Broadcasts responses: '200': description: Returns broadcast `actions`. Each object represents an individual variant for this broadcast. content: application/json: schema: type: object properties: actions: type: array items: x-scalar-ignore: true oneOf: - title: Email / message allOf: - x-scalar-ignore: true type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - email - in_app - push - twilio - slack - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true from: x-scalar-ignore: true type: string description: The address that the message is from, relevant if the action `type` is `email`. readOnly: true example: sentFrom@example.com from_id: x-scalar-ignore: true type: integer description: The identifier of the `from` address, commonly known as the "sender". Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 1 reply_to: x-scalar-ignore: true type: string description: The address that receives replies for the message, if applicable. readOnly: true example: replyto@example.com reply_to_id: x-scalar-ignore: true type: - integer - 'null' description: The identifier for the `reply_to` address, if applicable. Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 38 preprocessor: x-scalar-ignore: true type: string description: If CSS pre-processing is enabled, this key is populated with `premailer`. Note, Juice replaced Premailer as the pre-processor, but you will only see `premailer` as the value. enum: - premailer readOnly: true recipient: x-scalar-ignore: true description: The recipient address for an action. type: string example: '{{customer.email}}' subject: x-scalar-ignore: true type: string description: The subject line for an `email` action. example: Did you get that thing I sent you? cc: x-scalar-ignore: true readOnly: true description: The carbon-copy address(es) for this action. type: string bcc: x-scalar-ignore: true readOnly: true description: The blind-copy address(es) for this action. type: string fake_bcc: x-scalar-ignore: true readOnly: true type: boolean description: '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). ' preheader_text: x-scalar-ignore: true type: string description: '[Also known as "preview text"](/journeys/channels/email/headers/custom-preheader-text/), this is the small block of text shown in an email inbox next to or underneath the subject line. ' body_amp: x-scalar-ignore: true type: string description: AMP-enabled content for your email. If a recipient's email client doesn't support AMP, they receive your `body` content instead. Make sure you're [set up to send AMP](/journeys/channels/email/layouts/amp-for-email/) first. - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 headers: x-scalar-ignore: true description: A JSON string containing header objects with `name` and `value`. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: string format: json example: '[{"name":"X-Mailgun-Tag","value":"my-cool-tag"},{"name":"X-Custom-Header","value":"custom-value"}]' - title: SMS / MMS allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of your SMS. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For SMS/MMS messages, the `type` is always `twilio`. enum: - twilio readOnly: true image_url: type: string description: The URL of the image in your SMS (MMS) message. sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient, usually an attribute you reference with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' - title: WhatsApp allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true description: The action object for WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio). Messages sent through Twilio still use the `twilio` type and are treated similarly to SMS messages. type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Welcome Message created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: A JSON string containing WhatsApp template metadata from Meta and template parameters with Liquid variables. Use `GET /v1/environments/{environment_id}/whatsapp/templates` to list templates. example: '{"body":"","image_url":"","whatsapp_message_template":{"id":"12345","name":"welcome","language":"en_US","status":"APPROVED","components":[...]},"template_parameters":{"name":"welcome","components":[{"type":"BODY","parameters":[{"type":"text","text":"{{customer.name}}","parameter_name":"name"}]}]}}' body_json: type: string description: For visual editor content (if applicable). language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio), the `type` is always `whatsapp`. enum: - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient's phone number in E.164 format, usually referenced with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' sender_identity_id: type: integer description: 'The ID of the WhatsApp Business phone number to send from. This corresponds to a phone number registered in your WhatsApp Business Account and synced via `GET /v1/environments/{environment_id}/whatsapp/sync`. ' send_to_unsubscribed: type: boolean description: Whether to send this message to unsubscribed customers. tracked: type: boolean description: Whether links in template parameters should be tracked. default: false - title: Webhook allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - webhook readOnly: true url: type: string description: The URL to send a webhook to, applies to `webhook` type actions. example: https://my.example.com/webhook headers: x-scalar-ignore: true description: A JSON string containing header objects with `name` and `value`. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: string format: json example: '[{"name":"X-Mailgun-Tag","value":"my-cool-tag"},{"name":"X-Custom-Header","value":"custom-value"}]' method: description: The HTTP method for your webhook. type: string enum: - get - post - put - delete - patch example: post sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts/{broadcast_id}/actions" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts/%7Bbroadcast_id%7D/actions\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/broadcasts/%7Bbroadcast_id%7D/actions") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" /v1/broadcasts/{broadcast_id}/messages: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). parameters: - name: broadcast_id in: path required: true description: The identifier of a broadcast. schema: type: integer - name: start in: query required: false description: The token for the page of results you want to return. Responses contain a `next` property. Use this property as the `start` value to return the next page of results. schema: type: string - name: limit in: query required: false description: The maximum number of results you want to retrieve per page. schema: type: integer - name: metric in: query required: false description: Determines the metric(s) you want to return. schema: type: string enum: - attempted - sent - delivered - opened - clicked - converted - bounced - spammed - unsubscribed - dropped - failed - undeliverable - name: state in: query required: false description: The state of a broadcast. schema: type: string enum: - failed - sent - drafted - attempted - name: type in: query required: false description: The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. schema: type: string enum: - email - webhook - twilio - whatsapp - slack - push - in_app - live_notification - name: start_ts in: query required: false description: The beginning timestamp for your query. schema: type: integer format: unix timestamp - name: end_ts in: query required: false description: The ending timestamp for your query. schema: type: integer format: unix timestamp - name: get_tracked_responses in: query required: false description: If true, the response includes `tracked_responses` for each message—an object containing tracked response option names for in-app survey responses. schema: type: boolean default: false get: operationId: broadcastMessages summary: Get messages for a broadcast security: - Bearer-Auth: [] description: '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. Timestamps reflect when deliveries were created in our system, not when they were actually sent to recipients. There may be a delay between creation and sending.' tags: - Broadcasts responses: '200': description: Returns an array of `messages`. Each object represents a different message in your broadcast. content: application/json: schema: type: object properties: messages: type: array items: x-scalar-ignore: true description: Describes an individual message delivery. The object contains keys for all possible parents of the message (`newsletter_id`, `broadcast_id`, etc) but only the parents of the delivery are populated. Other parent IDs are null. allOf: - x-scalar-ignore: true type: object description: Describes an individual message delivery. The object contains keys for all possible parents of the message (`newsletter_id`, `broadcast_id`, etc) but only the parents of the delivery are populated. Other parent IDs are null. properties: id: x-scalar-ignore: true description: The identifier for a delivery—the instance of a message intended for an individual recipient. type: string readOnly: true example: dgOq6QWq6QUBAAF4_CGoeVX7mFkDbRFu7ek= deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 message_template_id: x-scalar-ignore: true description: The identifier of the message template used to create a message. type: integer readOnly: true deprecated: true customer_id: x-scalar-ignore: true type: - string - 'null' description: The ID of a customer profile, analogous to a "person" in the UI. If your workspace supports multiple identifiers (email and ID), this value can be null. example: '42' customer_identifiers: x-scalar-ignore: true type: object description: Identifiers for the person in a response—`id`, `cio_id`, and `email`. Unset `id` or `email` values are `null`. We recommend this object over the less descriptive `customer_id`. This object doesn't include `phone`, even if your workspace uses phone numbers as an identifier; look for the person's `phone` attribute instead. required: - email - id - cio_id properties: email: type: - string - 'null' format: email description: A person's email address, if set. example: test@example.com id: type: - string - 'null' description: A person's unique ID, if set. This is the same as the `customer_id` if present. example: 2 cio_id: x-scalar-ignore: true type: string description: A unique identifier set by Customer.io, used to reference a person if you want to update their identifiers. example: a3000001 recipient: x-scalar-ignore: true description: The recipient address for an action. type: string example: '{{customer.email}}' subject: x-scalar-ignore: true type: string description: The subject line for an `email` action. example: Did you get that thing I sent you? metrics: x-scalar-ignore: true type: object description: Metrics for an individual instance of a message; each item in the object represents the timestamp when a message achieved a particular metric. This object only contains metrics that have been recorded. properties: bounced: type: integer description: The timestamp when the message `bounced`. clicked: type: integer description: The timestamp when the message was `clicked`. human_clicked: type: integer description: The number of `clicked` messages excluding machine clicks. This metric is reliable starting April 20, 2025. [Learn more](/journeys/metrics/analytics/#delivery-metrics). prefetch_clicked: type: integer description: The number of `clicked` messages attributed to machines. This metric is reliable starting April 20, 2025. converted: type: integer description: The timestamp when the message was `converted`. created: type: integer description: The timestamp when the message was `created`. delivered: type: integer description: The timestamp when the message was `delivered`. drafted: type: integer description: The timestamp when the message was `drafted`. dropped: type: integer description: The timestamp when the message was `dropped`. failed: type: integer description: The timestamp when the message `failed`. opened: type: integer description: The timestamp when the message was `opened`. human_opened: type: integer description: The number of `opened` messages excluding machine opens. This metric is reliable starting March 20, 2025. [Learn more](/journeys/metrics/analytics/#delivery-metrics). prefetch_opened: type: integer description: The number of `opened` messages attributed to machines. This metric is reliable starting March 20, 2025. sent: type: integer description: The timestamp when the message was `sent`. spammed: type: integer description: The timestamp when the message was marked as spam. undeliverable: type: integer description: The timestamp when the message became `undeliverable`. unsubscribed: type: integer description: The timestamp when a person unsubscribed based on this message. created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true failure_message: type: - string - 'null' description: Explains why a message failed, if applicable. campaign_id: oneOf: - x-scalar-ignore: true description: The identifier for a campaign. type: integer example: 5 - type: 'null' action_id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 parent_action_id: x-scalar-ignore: true type: integer description: The ID of the parent action, if the action occurred within a campaign and has a parent (like a randomized split, etc). example: 1 readOnly: true newsletter_id: oneOf: - x-scalar-ignore: true description: The identifier for a newsletter. type: integer example: 10 - type: 'null' content_id: x-scalar-ignore: true description: The identifier for a message in a newsletter. Newsletters can have multiple content IDs (for multi-language messages or A/B tests). type: integer readOnly: true example: 1 broadcast_id: oneOf: - x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - type: 'null' trigger_event_id: x-scalar-ignore: true type: string description: The id of the event that triggered an event-triggered campaign (not an API-triggered broadcast). example: 21E4C3CT6YDC7Y4N7FE1GWWABC forgotten: type: boolean description: If true message contents are not retained by Customer.io. tracked_responses: type: object description: Tracked in-app survey responses, keyed by response option name. Present only when `get_tracked_responses` is `true`. additionalProperties: type: object properties: id: type: integer description: The identifier for the tracked response. ts: type: integer description: A unix timestamp representing when the response was tracked. example: cool-button: id: 1 ts: 1715769600 cool-button-2: id: 2 ts: 1715769600 - type: object properties: type: x-scalar-ignore: true description: The type of message or action for a delivery, campaign action, or related object. Includes channels that newsletters do not support (for example, `slack` and `whatsapp`). type: string enum: - email - webhook - twilio - push - in_app - slack - whatsapp - live_notification readOnly: true example: email example: 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 examples: email: summary: An email message value: 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 in-app: summary: An in-app message with tracked survey responses value: messages: - id: bX2r7YZq8RCAAB5_DGopeWY8nGlEcSGv8fl= deduplicate_id: bX2r7YZq8RCAAB5_DGopeWY8nGlEcSGv8fl=:1715769500 msg_template_id: 87 action_id: 312 customer_id: user_2048 customer_identifiers: id: user_2048 cio_id: '04000001' recipient: user_2048 subject: null metrics: opened: 1715769550 sent: 1715769500 created: 1715769500 failure_message: null newsletter_id: null content_id: null campaign_id: null broadcast_id: 94 type: in_app forgotten: false tracked_responses: how-satisfied: id: 1 ts: 1715769560 would-recommend: id: 2 ts: 1715769565 '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts/{broadcast_id}/messages" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts/%7Bbroadcast_id%7D/messages\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/messages") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/broadcasts/%7Bbroadcast_id%7D/messages") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/messages\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" /v1/broadcasts/{broadcast_id}/actions/{action_id}: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). parameters: - name: broadcast_id in: path required: true description: The identifier of a broadcast. schema: type: integer - name: action_id in: path required: true description: The action you want to lookup or act on. schema: type: integer get: operationId: getBroadcastAction summary: Get a broadcast action security: - Bearer-Auth: [] description: Returns information about a specific action within a broadcast. tags: - Broadcasts responses: '200': description: Returns the requested broadcast `action`. content: application/json: schema: type: object properties: action: x-scalar-ignore: true oneOf: - title: Email / message allOf: - x-scalar-ignore: true type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - email - in_app - push - twilio - slack - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true from: x-scalar-ignore: true type: string description: The address that the message is from, relevant if the action `type` is `email`. readOnly: true example: sentFrom@example.com from_id: x-scalar-ignore: true type: integer description: The identifier of the `from` address, commonly known as the "sender". Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 1 reply_to: x-scalar-ignore: true type: string description: The address that receives replies for the message, if applicable. readOnly: true example: replyto@example.com reply_to_id: x-scalar-ignore: true type: - integer - 'null' description: The identifier for the `reply_to` address, if applicable. Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 38 preprocessor: x-scalar-ignore: true type: string description: If CSS pre-processing is enabled, this key is populated with `premailer`. Note, Juice replaced Premailer as the pre-processor, but you will only see `premailer` as the value. enum: - premailer readOnly: true recipient: x-scalar-ignore: true description: The recipient address for an action. type: string example: '{{customer.email}}' subject: x-scalar-ignore: true type: string description: The subject line for an `email` action. example: Did you get that thing I sent you? cc: x-scalar-ignore: true readOnly: true description: The carbon-copy address(es) for this action. type: string bcc: x-scalar-ignore: true readOnly: true description: The blind-copy address(es) for this action. type: string fake_bcc: x-scalar-ignore: true readOnly: true type: boolean description: '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). ' preheader_text: x-scalar-ignore: true type: string description: '[Also known as "preview text"](/journeys/channels/email/headers/custom-preheader-text/), this is the small block of text shown in an email inbox next to or underneath the subject line. ' body_amp: x-scalar-ignore: true type: string description: AMP-enabled content for your email. If a recipient's email client doesn't support AMP, they receive your `body` content instead. Make sure you're [set up to send AMP](/journeys/channels/email/layouts/amp-for-email/) first. - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 headers: x-scalar-ignore: true description: A JSON string containing header objects with `name` and `value`. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: string format: json example: '[{"name":"X-Mailgun-Tag","value":"my-cool-tag"},{"name":"X-Custom-Header","value":"custom-value"}]' - title: SMS / MMS allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of your SMS. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For SMS/MMS messages, the `type` is always `twilio`. enum: - twilio readOnly: true image_url: type: string description: The URL of the image in your SMS (MMS) message. sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient, usually an attribute you reference with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' - title: WhatsApp allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true description: The action object for WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio). Messages sent through Twilio still use the `twilio` type and are treated similarly to SMS messages. type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Welcome Message created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: A JSON string containing WhatsApp template metadata from Meta and template parameters with Liquid variables. Use `GET /v1/environments/{environment_id}/whatsapp/templates` to list templates. example: '{"body":"","image_url":"","whatsapp_message_template":{"id":"12345","name":"welcome","language":"en_US","status":"APPROVED","components":[...]},"template_parameters":{"name":"welcome","components":[{"type":"BODY","parameters":[{"type":"text","text":"{{customer.name}}","parameter_name":"name"}]}]}}' body_json: type: string description: For visual editor content (if applicable). language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio), the `type` is always `whatsapp`. enum: - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient's phone number in E.164 format, usually referenced with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' sender_identity_id: type: integer description: 'The ID of the WhatsApp Business phone number to send from. This corresponds to a phone number registered in your WhatsApp Business Account and synced via `GET /v1/environments/{environment_id}/whatsapp/sync`. ' send_to_unsubscribed: type: boolean description: Whether to send this message to unsubscribed customers. tracked: type: boolean description: Whether links in template parameters should be tracked. default: false - title: Webhook allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - webhook readOnly: true url: type: string description: The URL to send a webhook to, applies to `webhook` type actions. example: https://my.example.com/webhook headers: x-scalar-ignore: true description: A JSON string containing header objects with `name` and `value`. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: string format: json example: '[{"name":"X-Mailgun-Tag","value":"my-cool-tag"},{"name":"X-Custom-Header","value":"custom-value"}]' method: description: The HTTP method for your webhook. type: string enum: - get - post - put - delete - patch example: post sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. Or the `language` does not exist for this action. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts/{broadcast_id}/actions/{action_id}" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" put: operationId: updateBroadcastAction summary: Update a broadcast action security: - Bearer-Auth: [] description: 'Update the contents of a broadcast action, including the body of messages or HTTP requests. **NOTE** You cannot manage content made with Design Studio with this endpoint. Use the Design Studio APIs instead.' tags: - Broadcasts requestBody: content: application/json: schema: x-scalar-ignore: true oneOf: - title: Email / message allOf: - x-scalar-ignore: true type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - email - in_app - push - twilio - slack - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true from: x-scalar-ignore: true type: string description: The address that the message is from, relevant if the action `type` is `email`. readOnly: true example: sentFrom@example.com from_id: x-scalar-ignore: true type: integer description: The identifier of the `from` address, commonly known as the "sender". Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 1 reply_to: x-scalar-ignore: true type: string description: The address that receives replies for the message, if applicable. readOnly: true example: replyto@example.com reply_to_id: x-scalar-ignore: true type: - integer - 'null' description: The identifier for the `reply_to` address, if applicable. Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 38 preprocessor: x-scalar-ignore: true type: string description: If CSS pre-processing is enabled, this key is populated with `premailer`. Note, Juice replaced Premailer as the pre-processor, but you will only see `premailer` as the value. enum: - premailer readOnly: true recipient: x-scalar-ignore: true description: The recipient address for an action. type: string example: '{{customer.email}}' subject: x-scalar-ignore: true type: string description: The subject line for an `email` action. example: Did you get that thing I sent you? cc: x-scalar-ignore: true readOnly: true description: The carbon-copy address(es) for this action. type: string bcc: x-scalar-ignore: true readOnly: true description: The blind-copy address(es) for this action. type: string fake_bcc: x-scalar-ignore: true readOnly: true type: boolean description: '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). ' preheader_text: x-scalar-ignore: true type: string description: '[Also known as "preview text"](/journeys/channels/email/headers/custom-preheader-text/), this is the small block of text shown in an email inbox next to or underneath the subject line. ' body_amp: x-scalar-ignore: true type: string description: AMP-enabled content for your email. If a recipient's email client doesn't support AMP, they receive your `body` content instead. Make sure you're [set up to send AMP](/journeys/channels/email/layouts/amp-for-email/) first. - type: object properties: headers: x-scalar-ignore: true description: Headers you want to add or update. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: array items: type: object properties: name: type: string description: The name of the header. value: type: string description: The value of the header. example: - name: X-Mailgun-Tag value: my-cool-tag - title: SMS / MMS allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of your SMS. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For SMS/MMS messages, the `type` is always `twilio`. enum: - twilio readOnly: true image_url: type: string description: The URL of the image in your SMS (MMS) message. sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient, usually an attribute you reference with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' - title: WhatsApp allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true description: The action object for WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio). Messages sent through Twilio still use the `twilio` type and are treated similarly to SMS messages. type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Welcome Message created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: A JSON string containing WhatsApp template metadata from Meta and template parameters with Liquid variables. Use `GET /v1/environments/{environment_id}/whatsapp/templates` to list templates. example: '{"body":"","image_url":"","whatsapp_message_template":{"id":"12345","name":"welcome","language":"en_US","status":"APPROVED","components":[...]},"template_parameters":{"name":"welcome","components":[{"type":"BODY","parameters":[{"type":"text","text":"{{customer.name}}","parameter_name":"name"}]}]}}' body_json: type: string description: For visual editor content (if applicable). language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio), the `type` is always `whatsapp`. enum: - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient's phone number in E.164 format, usually referenced with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' sender_identity_id: type: integer description: 'The ID of the WhatsApp Business phone number to send from. This corresponds to a phone number registered in your WhatsApp Business Account and synced via `GET /v1/environments/{environment_id}/whatsapp/sync`. ' send_to_unsubscribed: type: boolean description: Whether to send this message to unsubscribed customers. tracked: type: boolean description: Whether links in template parameters should be tracked. default: false - title: Webhook allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - webhook readOnly: true url: type: string description: The URL to send a webhook to, applies to `webhook` type actions. example: https://my.example.com/webhook headers: x-scalar-ignore: true description: A JSON string containing header objects with `name` and `value`. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: string format: json example: '[{"name":"X-Mailgun-Tag","value":"my-cool-tag"},{"name":"X-Custom-Header","value":"custom-value"}]' method: description: The HTTP method for your webhook. type: string enum: - get - post - put - delete - patch example: post sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. responses: '200': description: Returns the updated broadcast action. content: application/json: schema: type: object properties: action: x-scalar-ignore: true oneOf: - title: Email / message allOf: - x-scalar-ignore: true type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - email - in_app - push - twilio - slack - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true from: x-scalar-ignore: true type: string description: The address that the message is from, relevant if the action `type` is `email`. readOnly: true example: sentFrom@example.com from_id: x-scalar-ignore: true type: integer description: The identifier of the `from` address, commonly known as the "sender". Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 1 reply_to: x-scalar-ignore: true type: string description: The address that receives replies for the message, if applicable. readOnly: true example: replyto@example.com reply_to_id: x-scalar-ignore: true type: - integer - 'null' description: The identifier for the `reply_to` address, if applicable. Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 38 preprocessor: x-scalar-ignore: true type: string description: If CSS pre-processing is enabled, this key is populated with `premailer`. Note, Juice replaced Premailer as the pre-processor, but you will only see `premailer` as the value. enum: - premailer readOnly: true recipient: x-scalar-ignore: true description: The recipient address for an action. type: string example: '{{customer.email}}' subject: x-scalar-ignore: true type: string description: The subject line for an `email` action. example: Did you get that thing I sent you? cc: x-scalar-ignore: true readOnly: true description: The carbon-copy address(es) for this action. type: string bcc: x-scalar-ignore: true readOnly: true description: The blind-copy address(es) for this action. type: string fake_bcc: x-scalar-ignore: true readOnly: true type: boolean description: '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). ' preheader_text: x-scalar-ignore: true type: string description: '[Also known as "preview text"](/journeys/channels/email/headers/custom-preheader-text/), this is the small block of text shown in an email inbox next to or underneath the subject line. ' body_amp: x-scalar-ignore: true type: string description: AMP-enabled content for your email. If a recipient's email client doesn't support AMP, they receive your `body` content instead. Make sure you're [set up to send AMP](/journeys/channels/email/layouts/amp-for-email/) first. - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 headers: x-scalar-ignore: true description: A JSON string containing header objects with `name` and `value`. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: string format: json example: '[{"name":"X-Mailgun-Tag","value":"my-cool-tag"},{"name":"X-Custom-Header","value":"custom-value"}]' - title: SMS / MMS allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of your SMS. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For SMS/MMS messages, the `type` is always `twilio`. enum: - twilio readOnly: true image_url: type: string description: The URL of the image in your SMS (MMS) message. sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient, usually an attribute you reference with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' - title: WhatsApp allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true description: The action object for WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio). Messages sent through Twilio still use the `twilio` type and are treated similarly to SMS messages. type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Welcome Message created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: A JSON string containing WhatsApp template metadata from Meta and template parameters with Liquid variables. Use `GET /v1/environments/{environment_id}/whatsapp/templates` to list templates. example: '{"body":"","image_url":"","whatsapp_message_template":{"id":"12345","name":"welcome","language":"en_US","status":"APPROVED","components":[...]},"template_parameters":{"name":"welcome","components":[{"type":"BODY","parameters":[{"type":"text","text":"{{customer.name}}","parameter_name":"name"}]}]}}' body_json: type: string description: For visual editor content (if applicable). language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio), the `type` is always `whatsapp`. enum: - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient's phone number in E.164 format, usually referenced with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' sender_identity_id: type: integer description: 'The ID of the WhatsApp Business phone number to send from. This corresponds to a phone number registered in your WhatsApp Business Account and synced via `GET /v1/environments/{environment_id}/whatsapp/sync`. ' send_to_unsubscribed: type: boolean description: Whether to send this message to unsubscribed customers. tracked: type: boolean description: Whether links in template parameters should be tracked. default: false - title: Webhook allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - webhook readOnly: true url: type: string description: The URL to send a webhook to, applies to `webhook` type actions. example: https://my.example.com/webhook headers: x-scalar-ignore: true description: A JSON string containing header objects with `name` and `value`. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: string format: json example: '[{"name":"X-Mailgun-Tag","value":"my-cool-tag"},{"name":"X-Custom-Header","value":"custom-value"}]' method: description: The HTTP method for your webhook. type: string enum: - get - post - put - delete - patch example: post sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. Or the `language` does not exist for this action. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: json label: JSON source: '{}' - lang: Shell + Curl source: "curl --request PUT \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts/{broadcast_id}/actions/{action_id} \\\n --header 'content-type: application/json' \\\n --data '{\"broadcast_id\":2,\"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\",\"body_amp\":\"string\",\"headers\":[[{\"name\":\"X-Mailgun-Tag\",\"value\":\"my-cool-tag\"}]]}'" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"PUT\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D\",\n \"headers\": {\n \"content-type\": \"application/json\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.write(JSON.stringify({\n broadcast_id: 2,\n body: 'string',\n sending_state: 'automatic',\n from_id: 1,\n reply_to_id: 38,\n recipient: '{{customer.email}}',\n subject: 'Did you get that thing I sent you?',\n preheader_text: 'string',\n body_amp: 'string',\n headers: [[{name: 'X-Mailgun-Tag', value: 'my-cool-tag'}]]\n}));\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Put.new(url) request["content-type"] = ''application/json'' request.body = "{\"broadcast_id\":2,\"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\",\"body_amp\":\"string\",\"headers\":[[{\"name\":\"X-Mailgun-Tag\",\"value\":\"my-cool-tag\"}]]}" response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") payload = "{\"broadcast_id\":2,\"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\",\"body_amp\":\"string\",\"headers\":[[{\"name\":\"X-Mailgun-Tag\",\"value\":\"my-cool-tag\"}]]}" headers = { ''content-type'': "application/json" } conn.request("PUT", "/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D\"\n\n\tpayload := strings.NewReader(\"{\\\"broadcast_id\\\":2,\\\"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\\\",\\\"body_amp\\\":\\\"string\\\",\\\"headers\\\":[[{\\\"name\\\":\\\"X-Mailgun-Tag\\\",\\\"value\\\":\\\"my-cool-tag\\\"}]]}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" /v1/broadcasts/{broadcast_id}/actions/{action_id}/language/{language}: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). parameters: - name: broadcast_id in: path required: true description: The identifier of a broadcast. schema: type: integer - name: action_id in: path required: true description: The action you want to lookup or act on. schema: type: integer - name: language in: path required: true description: A [language tag](/journeys/channels/subscriptions/unsubscribe-faqs/#currently-supported-languages) of a language variant. If you don't provide a language (an empty string), we'll use your default language. If the language variant does not exist, we'll return an error. schema: type: string get: operationId: getBroadcastActionLanguage summary: Get a translation of a broadcast message security: - Bearer-Auth: [] description: Returns information about a translation of message in a broadcast. The message is identified by the `action_id`. tags: - Broadcasts responses: '200': description: Returns information for the requested language variant for a broadcast `action`. content: application/json: schema: type: object properties: action: x-scalar-ignore: true oneOf: - title: Email / message allOf: - x-scalar-ignore: true type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - email - in_app - push - twilio - slack - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true from: x-scalar-ignore: true type: string description: The address that the message is from, relevant if the action `type` is `email`. readOnly: true example: sentFrom@example.com from_id: x-scalar-ignore: true type: integer description: The identifier of the `from` address, commonly known as the "sender". Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 1 reply_to: x-scalar-ignore: true type: string description: The address that receives replies for the message, if applicable. readOnly: true example: replyto@example.com reply_to_id: x-scalar-ignore: true type: - integer - 'null' description: The identifier for the `reply_to` address, if applicable. Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 38 preprocessor: x-scalar-ignore: true type: string description: If CSS pre-processing is enabled, this key is populated with `premailer`. Note, Juice replaced Premailer as the pre-processor, but you will only see `premailer` as the value. enum: - premailer readOnly: true recipient: x-scalar-ignore: true description: The recipient address for an action. type: string example: '{{customer.email}}' subject: x-scalar-ignore: true type: string description: The subject line for an `email` action. example: Did you get that thing I sent you? cc: x-scalar-ignore: true readOnly: true description: The carbon-copy address(es) for this action. type: string bcc: x-scalar-ignore: true readOnly: true description: The blind-copy address(es) for this action. type: string fake_bcc: x-scalar-ignore: true readOnly: true type: boolean description: '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). ' preheader_text: x-scalar-ignore: true type: string description: '[Also known as "preview text"](/journeys/channels/email/headers/custom-preheader-text/), this is the small block of text shown in an email inbox next to or underneath the subject line. ' body_amp: x-scalar-ignore: true type: string description: AMP-enabled content for your email. If a recipient's email client doesn't support AMP, they receive your `body` content instead. Make sure you're [set up to send AMP](/journeys/channels/email/layouts/amp-for-email/) first. - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 headers: x-scalar-ignore: true description: A JSON string containing header objects with `name` and `value`. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: string format: json example: '[{"name":"X-Mailgun-Tag","value":"my-cool-tag"},{"name":"X-Custom-Header","value":"custom-value"}]' - title: SMS / MMS allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of your SMS. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For SMS/MMS messages, the `type` is always `twilio`. enum: - twilio readOnly: true image_url: type: string description: The URL of the image in your SMS (MMS) message. sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient, usually an attribute you reference with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' - title: WhatsApp allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true description: The action object for WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio). Messages sent through Twilio still use the `twilio` type and are treated similarly to SMS messages. type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Welcome Message created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: A JSON string containing WhatsApp template metadata from Meta and template parameters with Liquid variables. Use `GET /v1/environments/{environment_id}/whatsapp/templates` to list templates. example: '{"body":"","image_url":"","whatsapp_message_template":{"id":"12345","name":"welcome","language":"en_US","status":"APPROVED","components":[...]},"template_parameters":{"name":"welcome","components":[{"type":"BODY","parameters":[{"type":"text","text":"{{customer.name}}","parameter_name":"name"}]}]}}' body_json: type: string description: For visual editor content (if applicable). language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio), the `type` is always `whatsapp`. enum: - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient's phone number in E.164 format, usually referenced with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' sender_identity_id: type: integer description: 'The ID of the WhatsApp Business phone number to send from. This corresponds to a phone number registered in your WhatsApp Business Account and synced via `GET /v1/environments/{environment_id}/whatsapp/sync`. ' send_to_unsubscribed: type: boolean description: Whether to send this message to unsubscribed customers. tracked: type: boolean description: Whether links in template parameters should be tracked. default: false - title: Webhook allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - webhook readOnly: true url: type: string description: The URL to send a webhook to, applies to `webhook` type actions. example: https://my.example.com/webhook headers: x-scalar-ignore: true description: A JSON string containing header objects with `name` and `value`. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: string format: json example: '[{"name":"X-Mailgun-Tag","value":"my-cool-tag"},{"name":"X-Custom-Header","value":"custom-value"}]' method: description: The HTTP method for your webhook. type: string enum: - get - post - put - delete - patch example: post sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. Or the `language` does not exist for this action. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts/{broadcast_id}/actions/{action_id}/language/{language}" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/language/%7Blanguage%7D\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/language/%7Blanguage%7D") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/language/%7Blanguage%7D") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/language/%7Blanguage%7D\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" put: operationId: updateBroadcastActionLanguage summary: Update a translation of a broadcast message security: - Bearer-Auth: [] description: 'Update a translation of a specific broadcast action, including the body of messages or HTTP requests. **NOTE** You cannot manage content made with Design Studio with this endpoint. Use the Design Studio APIs instead.' tags: - Broadcasts requestBody: content: application/json: schema: x-scalar-ignore: true oneOf: - title: Email / message allOf: - x-scalar-ignore: true type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - email - in_app - push - twilio - slack - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true from: x-scalar-ignore: true type: string description: The address that the message is from, relevant if the action `type` is `email`. readOnly: true example: sentFrom@example.com from_id: x-scalar-ignore: true type: integer description: The identifier of the `from` address, commonly known as the "sender". Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 1 reply_to: x-scalar-ignore: true type: string description: The address that receives replies for the message, if applicable. readOnly: true example: replyto@example.com reply_to_id: x-scalar-ignore: true type: - integer - 'null' description: The identifier for the `reply_to` address, if applicable. Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 38 preprocessor: x-scalar-ignore: true type: string description: If CSS pre-processing is enabled, this key is populated with `premailer`. Note, Juice replaced Premailer as the pre-processor, but you will only see `premailer` as the value. enum: - premailer readOnly: true recipient: x-scalar-ignore: true description: The recipient address for an action. type: string example: '{{customer.email}}' subject: x-scalar-ignore: true type: string description: The subject line for an `email` action. example: Did you get that thing I sent you? cc: x-scalar-ignore: true readOnly: true description: The carbon-copy address(es) for this action. type: string bcc: x-scalar-ignore: true readOnly: true description: The blind-copy address(es) for this action. type: string fake_bcc: x-scalar-ignore: true readOnly: true type: boolean description: '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). ' preheader_text: x-scalar-ignore: true type: string description: '[Also known as "preview text"](/journeys/channels/email/headers/custom-preheader-text/), this is the small block of text shown in an email inbox next to or underneath the subject line. ' body_amp: x-scalar-ignore: true type: string description: AMP-enabled content for your email. If a recipient's email client doesn't support AMP, they receive your `body` content instead. Make sure you're [set up to send AMP](/journeys/channels/email/layouts/amp-for-email/) first. - type: object properties: headers: x-scalar-ignore: true description: Headers you want to add or update. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: array items: type: object properties: name: type: string description: The name of the header. value: type: string description: The value of the header. example: - name: X-Mailgun-Tag value: my-cool-tag - title: SMS / MMS allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of your SMS. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For SMS/MMS messages, the `type` is always `twilio`. enum: - twilio readOnly: true image_url: type: string description: The URL of the image in your SMS (MMS) message. sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient, usually an attribute you reference with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' - title: WhatsApp allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true description: The action object for WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio). Messages sent through Twilio still use the `twilio` type and are treated similarly to SMS messages. type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Welcome Message created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: A JSON string containing WhatsApp template metadata from Meta and template parameters with Liquid variables. Use `GET /v1/environments/{environment_id}/whatsapp/templates` to list templates. example: '{"body":"","image_url":"","whatsapp_message_template":{"id":"12345","name":"welcome","language":"en_US","status":"APPROVED","components":[...]},"template_parameters":{"name":"welcome","components":[{"type":"BODY","parameters":[{"type":"text","text":"{{customer.name}}","parameter_name":"name"}]}]}}' body_json: type: string description: For visual editor content (if applicable). language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio), the `type` is always `whatsapp`. enum: - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient's phone number in E.164 format, usually referenced with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' sender_identity_id: type: integer description: 'The ID of the WhatsApp Business phone number to send from. This corresponds to a phone number registered in your WhatsApp Business Account and synced via `GET /v1/environments/{environment_id}/whatsapp/sync`. ' send_to_unsubscribed: type: boolean description: Whether to send this message to unsubscribed customers. tracked: type: boolean description: Whether links in template parameters should be tracked. default: false - title: Webhook allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - webhook readOnly: true url: type: string description: The URL to send a webhook to, applies to `webhook` type actions. example: https://my.example.com/webhook headers: x-scalar-ignore: true description: A JSON string containing header objects with `name` and `value`. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: string format: json example: '[{"name":"X-Mailgun-Tag","value":"my-cool-tag"},{"name":"X-Custom-Header","value":"custom-value"}]' method: description: The HTTP method for your webhook. type: string enum: - get - post - put - delete - patch example: post sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. responses: '200': description: Returns the updated broadcast action. content: application/json: schema: type: object properties: action: x-scalar-ignore: true oneOf: - title: Email / message allOf: - x-scalar-ignore: true type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - email - in_app - push - twilio - slack - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true from: x-scalar-ignore: true type: string description: The address that the message is from, relevant if the action `type` is `email`. readOnly: true example: sentFrom@example.com from_id: x-scalar-ignore: true type: integer description: The identifier of the `from` address, commonly known as the "sender". Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 1 reply_to: x-scalar-ignore: true type: string description: The address that receives replies for the message, if applicable. readOnly: true example: replyto@example.com reply_to_id: x-scalar-ignore: true type: - integer - 'null' description: The identifier for the `reply_to` address, if applicable. Use [List sender identities](#tag/sender-identities/listSenders) to find valid IDs. example: 38 preprocessor: x-scalar-ignore: true type: string description: If CSS pre-processing is enabled, this key is populated with `premailer`. Note, Juice replaced Premailer as the pre-processor, but you will only see `premailer` as the value. enum: - premailer readOnly: true recipient: x-scalar-ignore: true description: The recipient address for an action. type: string example: '{{customer.email}}' subject: x-scalar-ignore: true type: string description: The subject line for an `email` action. example: Did you get that thing I sent you? cc: x-scalar-ignore: true readOnly: true description: The carbon-copy address(es) for this action. type: string bcc: x-scalar-ignore: true readOnly: true description: The blind-copy address(es) for this action. type: string fake_bcc: x-scalar-ignore: true readOnly: true type: boolean description: '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). ' preheader_text: x-scalar-ignore: true type: string description: '[Also known as "preview text"](/journeys/channels/email/headers/custom-preheader-text/), this is the small block of text shown in an email inbox next to or underneath the subject line. ' body_amp: x-scalar-ignore: true type: string description: AMP-enabled content for your email. If a recipient's email client doesn't support AMP, they receive your `body` content instead. Make sure you're [set up to send AMP](/journeys/channels/email/layouts/amp-for-email/) first. - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 headers: x-scalar-ignore: true description: A JSON string containing header objects with `name` and `value`. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: string format: json example: '[{"name":"X-Mailgun-Tag","value":"my-cool-tag"},{"name":"X-Custom-Header","value":"custom-value"}]' - title: SMS / MMS allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of your SMS. language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For SMS/MMS messages, the `type` is always `twilio`. enum: - twilio readOnly: true image_url: type: string description: The URL of the image in your SMS (MMS) message. sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient, usually an attribute you reference with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' - title: WhatsApp allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true description: The action object for WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio). Messages sent through Twilio still use the `twilio` type and are treated similarly to SMS messages. type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action. readOnly: true example: Welcome Message created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: A JSON string containing WhatsApp template metadata from Meta and template parameters with Liquid variables. Use `GET /v1/environments/{environment_id}/whatsapp/templates` to list templates. example: '{"body":"","image_url":"","whatsapp_message_template":{"id":"12345","name":"welcome","language":"en_US","status":"APPROVED","components":[...]},"template_parameters":{"name":"welcome","components":[{"type":"BODY","parameters":[{"type":"text","text":"{{customer.name}}","parameter_name":"name"}]}]}}' body_json: type: string description: For visual editor content (if applicable). language: x-scalar-ignore: true type: string description: The language variant for your message. If you don't use our [localization feature](/journeys/channels/localization/getting-started), or this is the default message, this value is an empty string. example: fr readOnly: true type: type: string description: For WhatsApp messages sent from Customer.io using your Facebook Business Account (not Twilio), the `type` is always `whatsapp`. enum: - whatsapp readOnly: true sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. recipient: type: string description: The recipient's phone number in E.164 format, usually referenced with Liquid like `{{customer.phone}}`. If you use Liquid, this field is blank in `GET` responses because we resolve the recipient at send time. example: '' sender_identity_id: type: integer description: 'The ID of the WhatsApp Business phone number to send from. This corresponds to a phone number registered in your WhatsApp Business Account and synced via `GET /v1/environments/{environment_id}/whatsapp/sync`. ' send_to_unsubscribed: type: boolean description: Whether to send this message to unsubscribed customers. tracked: type: boolean description: Whether links in template parameters should be tracked. default: false - title: Webhook allOf: - type: object properties: id: x-scalar-ignore: true description: The identifier for an action. type: integer readOnly: true example: 96 broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 - x-scalar-ignore: true type: object properties: deduplicate_id: x-scalar-ignore: true type: string readOnly: true description: An identifier in the format `id:timestamp` where the id is for the object you're working with (Campaigns, Deliveries, Exports, Identities, Newsletters, Segments, and Templates), and the timestamp is the last time the object was updated. example: 15:1492548073 name: type: string description: The name of the action, if it exists. readOnly: true example: Opening Message layout: type: string description: The layout used for the action, if it exists. readOnly: true created: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true updated: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was last updated. example: 1552341937 readOnly: true body: type: string description: The body of the action. You cannot modify the body if you created it with our drag-and-drop editor. type: type: string description: The type of action. enum: - webhook readOnly: true url: type: string description: The URL to send a webhook to, applies to `webhook` type actions. example: https://my.example.com/webhook headers: x-scalar-ignore: true description: A JSON string containing header objects with `name` and `value`. Names and values must be strings, with no non-ASCII characters or spaces. You can't overwrite reserved headers. type: string format: json example: '[{"name":"X-Mailgun-Tag","value":"my-cool-tag"},{"name":"X-Custom-Header","value":"custom-value"}]' method: description: The HTTP method for your webhook. type: string enum: - get - post - put - delete - patch example: post sending_state: x-scalar-ignore: true type: string enum: - automatic - draft - 'off' description: Determines the sending behavior for the action. `automatic` sends the action automatically when triggered; `draft` queues drafts when the action is triggered; or `off` to disable the action. '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. Or the `language` does not exist for this action. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: json label: JSON source: '{}' - lang: Shell + Curl source: "curl --request PUT \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts/{broadcast_id}/actions/{action_id}/language/{language} \\\n --header 'content-type: application/json' \\\n --data '{\"broadcast_id\":2,\"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\",\"body_amp\":\"string\",\"headers\":[[{\"name\":\"X-Mailgun-Tag\",\"value\":\"my-cool-tag\"}]]}'" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"PUT\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/language/%7Blanguage%7D\",\n \"headers\": {\n \"content-type\": \"application/json\"\n }\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.write(JSON.stringify({\n broadcast_id: 2,\n body: 'string',\n sending_state: 'automatic',\n from_id: 1,\n reply_to_id: 38,\n recipient: '{{customer.email}}',\n subject: 'Did you get that thing I sent you?',\n preheader_text: 'string',\n body_amp: 'string',\n headers: [[{name: 'X-Mailgun-Tag', value: 'my-cool-tag'}]]\n}));\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/language/%7Blanguage%7D") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Put.new(url) request["content-type"] = ''application/json'' request.body = "{\"broadcast_id\":2,\"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\",\"body_amp\":\"string\",\"headers\":[[{\"name\":\"X-Mailgun-Tag\",\"value\":\"my-cool-tag\"}]]}" response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") payload = "{\"broadcast_id\":2,\"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\",\"body_amp\":\"string\",\"headers\":[[{\"name\":\"X-Mailgun-Tag\",\"value\":\"my-cool-tag\"}]]}" headers = { ''content-type'': "application/json" } conn.request("PUT", "/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/language/%7Blanguage%7D", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/language/%7Blanguage%7D\"\n\n\tpayload := strings.NewReader(\"{\\\"broadcast_id\\\":2,\\\"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\\\",\\\"body_amp\\\":\\\"string\\\",\\\"headers\\\":[[{\\\"name\\\":\\\"X-Mailgun-Tag\\\",\\\"value\\\":\\\"my-cool-tag\\\"}]]}\")\n\n\treq, _ := http.NewRequest(\"PUT\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" /v1/broadcasts/{broadcast_id}/actions/{action_id}/metrics: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). parameters: - name: broadcast_id in: path required: true description: The identifier of a broadcast. schema: type: integer - name: action_id in: path required: true description: The action you want to lookup or act on. schema: type: integer - name: period in: query required: false description: The unit of time for your report. schema: type: string default: days enum: - hours - days - weeks - months - name: steps in: query required: false description: The number of periods you want to return. Defaults to the maximum available, or `12` if the period is in `months`. Maximums are 24 hours, 45 days, 12 weeks, or 121 months. Days start at 00:00 EST. Weeks start at 00:00 EST on Sunday. Months start at 00:00 EST on the 1st of the month. schema: type: integer - name: type in: query required: false description: The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. schema: type: string enum: - email - webhook - twilio - whatsapp - slack - push - in_app - live_notification get: operationId: broadcastActionMetrics summary: Get broadcast action metrics security: - Bearer-Auth: [] description: '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.' tags: - Broadcasts responses: '200': description: Returns action metrics by `series` (with increments are based on the `period` and `step` in your request) for the broadcast. content: application/json: schema: type: object properties: metric: type: object properties: series: allOf: - x-scalar-ignore: true type: object description: Metrics grouped by the requested resolution. Each property is an array where each entry represents one period, such as one day. properties: 2xx: type: array items: type: integer description: 2xx responses by period, representative of webhook performance. 3xx: type: array items: type: integer description: 3xx responses by period, representative of webhook performance. 4xx: type: array items: type: integer description: 4xx responses by period, representative of webhook performance. 5xx: type: array items: type: integer description: 5xx responses by period, representative of webhook performance. - x-scalar-ignore: true description: Metrics grouped by the requested resolution. Each property is an array where each entry represents one period, such as one day. type: object properties: attempted: type: array items: type: integer description: The number of `attempted` messages. bounced: type: array items: type: integer description: The number of `bounced` messages. clicked: type: array items: type: integer description: The number of `clicked` messages. human_clicked: type: array items: type: integer description: The number of `clicked` emails excluding machine clicks. This metric is reliable starting April 20, 2025. [Learn more](/journeys/metrics/analytics/#delivery-metrics). prefetch_clicked: type: array items: type: integer description: The number of `clicked` emails attributed to machines. This metric is reliable starting April 20, 2025. converted: type: array items: type: integer description: The number of `converted` messages. created: type: array items: type: integer description: The number of `created` messages. deferred: type: array items: type: integer description: The number of `deferred` messages. delivered: type: array items: type: integer description: The number of `delivered` messages. drafted: type: array items: type: integer description: The number of `drafted` messages. failed: type: array items: type: integer description: The number of `failed` messages. opened: type: array items: type: integer description: The number of `opened` messages. human_opened: type: array items: type: integer description: The number of `opened` emails excluding machine opens. This metric is reliable starting March 20, 2025. [Learn more](/journeys/metrics/analytics/#delivery-metrics). prefetch_opened: type: array items: type: integer description: The number of `opened` emails attributed to machines. This metric is reliable starting March 20, 2025. sent: type: array items: type: integer description: The number of sent messages. spammed: type: array items: type: integer description: The number of spam complaints. suppressed: type: array items: type: integer description: The number of `suppressed` messages. undeliverable: type: array items: type: integer description: The number of `undeliverable` messages. topic_unsubscribed: type: array items: type: integer description: The number of topic unsubscribes in a given period. unsubscribed: type: array items: type: integer description: The number of unsubscribes attributed to the campaign or message. '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts/{broadcast_id}/actions/{action_id}/metrics" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/metrics\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/metrics") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/metrics") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/metrics\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" /v1/broadcasts/{broadcast_id}/actions/{action_id}/metrics/links: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). parameters: - name: broadcast_id in: path required: true description: The identifier of a broadcast. schema: type: integer - name: action_id in: path required: true description: The action you want to lookup or act on. schema: type: integer - name: period in: query required: false description: The unit of time for your report. schema: type: string default: days enum: - hours - days - weeks - months - name: steps in: query required: false description: The number of periods you want to return. Defaults to the maximum available, or `12` if the period is in `months`. Maximums are 24 hours, 45 days, 12 weeks, or 121 months. Days start at 00:00 EST. Weeks start at 00:00 EST on Sunday. Months start at 00:00 EST on the 1st of the month. schema: type: integer - name: type in: query required: false description: The type of item you want to return metrics for. When empty, the response contains metrics for all possible types. schema: type: string enum: - email - webhook - twilio - whatsapp - slack - push - in_app - live_notification get: operationId: broadcastActionLinks summary: Get broadcast action link metrics security: - Bearer-Auth: [] description: '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.' tags: - Broadcasts responses: '200': description: Returns broadcast variant metrics by `series` (with increments are based on the `period` and `step` in your request) for the broadcast. content: application/json: schema: type: object properties: links: type: array description: Each object in the array represents a link in your broadcast variant. items: x-scalar-ignore: true type: object properties: link: type: object properties: id: type: integer description: The ID of the link. example: 1234 href: type: string description: The link destination—a URL, mailto, etc. example: https://docs.customer.io metric: type: object description: Contains metrics for the link. properties: series: type: object properties: clicked: type: array description: An array of results from oldest to newest, where each result indicates a period. items: type: integer example: - 1 - 3 - 5 - 7 human_clicked: type: array description: An array of human click counts (clicks excluding machine clicks) from oldest to newest, where each result indicates a period. This metric is reliable starting April 20, 2025. [Learn more](/journeys/metrics/analytics/#delivery-metrics). items: type: integer example: - 1 - 2 - 3 - 4 machine_clicked: type: array description: An array of machine click counts (clicks attributed to bots or prefetching) from oldest to newest, where each result indicates a period. This metric is reliable starting April 20, 2025. [Learn more](/journeys/metrics/analytics/#delivery-metrics). items: type: integer example: - 0 - 1 - 1 - 2 '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts/{broadcast_id}/actions/{action_id}/metrics/links" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/metrics/links\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/metrics/links") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/metrics/links") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/actions/%7Baction_id%7D/metrics/links\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" /v1/broadcasts/{broadcast_id}/triggers: servers: - url: https://api.customer.io description: This API uses bearer authorization, requiring a [token that you generate in the UI](https://fly.customer.io/settings/api_credentials?keyType=app). parameters: - name: broadcast_id in: path required: true description: The identifier of a broadcast. schema: type: integer get: operationId: listBroadcastTriggers summary: Get broadcast triggers security: - Bearer-Auth: [] description: Returns a list of the `triggers` for a broadcast. tags: - Broadcasts responses: '200': description: Returns an array of `triggers`. content: application/json: schema: type: object properties: triggers: type: array description: Each object in the array represents a time that your broadcast was triggered/sent. items: x-scalar-ignore: true type: object description: You can get triggers to know when you triggered a broadcast and whether or not it's been processed. properties: id: type: integer description: The identifier for a broadcast trigger. broadcast_id: x-scalar-ignore: true type: integer description: The identifier for a broadcast. example: 2 created_at: x-scalar-ignore: true type: integer format: unix timestamp description: The date time when the referenced ID was created. example: 1552341937 readOnly: true processed_at: type: integer format: unix timestamp description: The date-time when Customer.io processed the trigger. '400': description: The `broadcastID`, `actionID` or `triggerID` is invalid. '404': description: The broadcast, action, and/or trigger do not exist. '429': description: Your request is over the 10-per-second limit. x-codeSamples: - lang: Shell + Curl source: "curl --request GET \\\n --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \\\n --url https://api.customer.io/v1/broadcasts/{broadcast_id}/triggers" - lang: Node + Native source: "const http = require(\"https\");\n\nconst options = {\n \"method\": \"GET\",\n \"hostname\": \"api.customer.io\",\n \"port\": null,\n \"path\": \"/v1/broadcasts/%7Bbroadcast_id%7D/triggers\",\n \"headers\": {}\n};\n\nconst req = http.request(options, function (res) {\n const chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n const body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n});\n\nreq.end();" - lang: Ruby + Native source: 'require ''uri'' require ''net/http'' require ''openssl'' url = URI("https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/triggers") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body' - lang: Python + Python3 source: 'import http.client conn = http.client.HTTPSConnection("api.customer.io") conn.request("GET", "/v1/broadcasts/%7Bbroadcast_id%7D/triggers") res = conn.getresponse() data = res.read() print(data.decode("utf-8"))' - lang: Go + Native source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.customer.io/v1/broadcasts/%7Bbroadcast_id%7D/triggers\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" components: securitySchemes: Bearer-Auth: type: http scheme: bearer description: '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](https://fly.customer.io/settings/api_credentials?keyType=app). [Learn more about bearer authorization in Customer.io](/accounts/settings/managing-credentials). ' ServiceAccount-Auth: x-scalar-ignore: true type: http scheme: bearer bearerFormat: sa_live_ description: 'Transactional send endpoints (`/v1/send/email`, `/v1/send/push`, `/v1/send/sms`, `/v1/send/in_app`, `/v1/send/inbox_message`) also accept a service-account bearer token, prefixed with `sa_live_`. Service-account tokens work across workspaces, so you must pass the target workspace as the `X-Workspace-Id` header on each request. Service-account tokens are intended for testing and one-off sends—for example, using the Customer.io CLI with an AI agent like Claude to verify that a transactional message renders correctly before wiring it into your production backend. **For the production integration that triggers the message from your application, use an App API Key instead**: it''s workspace-scoped, easier to rotate, and has a smaller blast radius. Service-account tokens are server-side credentials. Treat them like any API key—keep them in environment variables or a secret manager, and never embed them in client-side code, mobile apps, or other untrusted contexts. ' bearerAuth: type: http scheme: bearer description: API key passed as a Bearer token