curl --request POST \
--url https://api.embeddables.com/projects/{projectId}/events \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"embeddable_id": "flow_myexampleflow",
"timestamp": "2022-01-01T00:00:00.000Z",
"custom_event_name": "my_custom_event",
"custom_event_props": "{ \"my_prop\": \"my_val\" }",
"identifiers": [
{
"key": "email",
"value": "\"test@test.com\""
}
]
}
'import requests
url = "https://api.embeddables.com/projects/{projectId}/events"
payload = {
"embeddable_id": "flow_myexampleflow",
"timestamp": "2022-01-01T00:00:00.000Z",
"custom_event_name": "my_custom_event",
"custom_event_props": "{ \"my_prop\": \"my_val\" }",
"identifiers": [
{
"key": "email",
"value": "\"test@test.com\""
}
]
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
embeddable_id: 'flow_myexampleflow',
timestamp: '2022-01-01T00:00:00.000Z',
custom_event_name: 'my_custom_event',
custom_event_props: '{ "my_prop": "my_val" }',
identifiers: [{key: 'email', value: '"test@test.com"'}]
})
};
fetch('https://api.embeddables.com/projects/{projectId}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.embeddables.com/projects/{projectId}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'embeddable_id' => 'flow_myexampleflow',
'timestamp' => '2022-01-01T00:00:00.000Z',
'custom_event_name' => 'my_custom_event',
'custom_event_props' => '{ "my_prop": "my_val" }',
'identifiers' => [
[
'key' => 'email',
'value' => '"test@test.com"'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.embeddables.com/projects/{projectId}/events"
payload := strings.NewReader("{\n \"embeddable_id\": \"flow_myexampleflow\",\n \"timestamp\": \"2022-01-01T00:00:00.000Z\",\n \"custom_event_name\": \"my_custom_event\",\n \"custom_event_props\": \"{ \\\"my_prop\\\": \\\"my_val\\\" }\",\n \"identifiers\": [\n {\n \"key\": \"email\",\n \"value\": \"\\\"test@test.com\\\"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.embeddables.com/projects/{projectId}/events")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"embeddable_id\": \"flow_myexampleflow\",\n \"timestamp\": \"2022-01-01T00:00:00.000Z\",\n \"custom_event_name\": \"my_custom_event\",\n \"custom_event_props\": \"{ \\\"my_prop\\\": \\\"my_val\\\" }\",\n \"identifiers\": [\n {\n \"key\": \"email\",\n \"value\": \"\\\"test@test.com\\\"\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.embeddables.com/projects/{projectId}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"embeddable_id\": \"flow_myexampleflow\",\n \"timestamp\": \"2022-01-01T00:00:00.000Z\",\n \"custom_event_name\": \"my_custom_event\",\n \"custom_event_props\": \"{ \\\"my_prop\\\": \\\"my_val\\\" }\",\n \"identifiers\": [\n {\n \"key\": \"email\",\n \"value\": \"\\\"test@test.com\\\"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"group_id": "group_myexamplegroup",
"project_id": "pr_myexampleproject",
"embeddable_id": "flow_myexampleflow",
"embeddable_version_number": 1,
"contact_id": "contact_myexamplecontact",
"entry_id": "entry_myexampleentry",
"timestamp": "2022-01-01T00:00:00Z",
"event_type": "custom_event:triggered",
"custom_event_name": "my_custom_event",
"custom_event_props": "{ \"my_prop\": \"my_val\" }"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"projectId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"entryId": "<string>"
}Create Event
Submit a custom event for an entry
curl --request POST \
--url https://api.embeddables.com/projects/{projectId}/events \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"embeddable_id": "flow_myexampleflow",
"timestamp": "2022-01-01T00:00:00.000Z",
"custom_event_name": "my_custom_event",
"custom_event_props": "{ \"my_prop\": \"my_val\" }",
"identifiers": [
{
"key": "email",
"value": "\"test@test.com\""
}
]
}
'import requests
url = "https://api.embeddables.com/projects/{projectId}/events"
payload = {
"embeddable_id": "flow_myexampleflow",
"timestamp": "2022-01-01T00:00:00.000Z",
"custom_event_name": "my_custom_event",
"custom_event_props": "{ \"my_prop\": \"my_val\" }",
"identifiers": [
{
"key": "email",
"value": "\"test@test.com\""
}
]
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
embeddable_id: 'flow_myexampleflow',
timestamp: '2022-01-01T00:00:00.000Z',
custom_event_name: 'my_custom_event',
custom_event_props: '{ "my_prop": "my_val" }',
identifiers: [{key: 'email', value: '"test@test.com"'}]
})
};
fetch('https://api.embeddables.com/projects/{projectId}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.embeddables.com/projects/{projectId}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'embeddable_id' => 'flow_myexampleflow',
'timestamp' => '2022-01-01T00:00:00.000Z',
'custom_event_name' => 'my_custom_event',
'custom_event_props' => '{ "my_prop": "my_val" }',
'identifiers' => [
[
'key' => 'email',
'value' => '"test@test.com"'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.embeddables.com/projects/{projectId}/events"
payload := strings.NewReader("{\n \"embeddable_id\": \"flow_myexampleflow\",\n \"timestamp\": \"2022-01-01T00:00:00.000Z\",\n \"custom_event_name\": \"my_custom_event\",\n \"custom_event_props\": \"{ \\\"my_prop\\\": \\\"my_val\\\" }\",\n \"identifiers\": [\n {\n \"key\": \"email\",\n \"value\": \"\\\"test@test.com\\\"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.embeddables.com/projects/{projectId}/events")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"embeddable_id\": \"flow_myexampleflow\",\n \"timestamp\": \"2022-01-01T00:00:00.000Z\",\n \"custom_event_name\": \"my_custom_event\",\n \"custom_event_props\": \"{ \\\"my_prop\\\": \\\"my_val\\\" }\",\n \"identifiers\": [\n {\n \"key\": \"email\",\n \"value\": \"\\\"test@test.com\\\"\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.embeddables.com/projects/{projectId}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"embeddable_id\": \"flow_myexampleflow\",\n \"timestamp\": \"2022-01-01T00:00:00.000Z\",\n \"custom_event_name\": \"my_custom_event\",\n \"custom_event_props\": \"{ \\\"my_prop\\\": \\\"my_val\\\" }\",\n \"identifiers\": [\n {\n \"key\": \"email\",\n \"value\": \"\\\"test@test.com\\\"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"group_id": "group_myexamplegroup",
"project_id": "pr_myexampleproject",
"embeddable_id": "flow_myexampleflow",
"embeddable_version_number": 1,
"contact_id": "contact_myexamplecontact",
"entry_id": "entry_myexampleentry",
"timestamp": "2022-01-01T00:00:00Z",
"event_type": "custom_event:triggered",
"custom_event_name": "my_custom_event",
"custom_event_props": "{ \"my_prop\": \"my_val\" }"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"projectId": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
},
"entryId": "<string>"
}Headers
Path Parameters
The unique identifier for a Project in the database
Body
The unique identifier for a Embeddable in the database
A Date + Time string in ISO format
A name of your choosing for the custom event - must be snake_case
Any custom properties you want to attach to the custom event - must be a valid JSON string
A list of key-value pairs that uniquely identify the end-user that this event should be attached to. Currently supports one key-value pair. The value must be JSON-stringified, so strings must be wrapped in double-quotes.
Show child attributes
Show child attributes
Response
The unique identifier for an Entry in the database
The unique identifier for a Contact in the database
The unique identifier for a Project in the database
The unique identifier for a Group in the database
The unique identifier for a Embeddable in the database
A Date + Time string in ISO format
The version number of an embeddable
Was this page helpful?

