Ingest events
curl --request POST \
--url https://app.outlit.ai/api/i/v1/{publicKey}/events \
--header 'Content-Type: application/json' \
--data '
{
"visitorId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"source": "client",
"events": [
{
"type": "pageview",
"url": "https://example.com/pricing",
"path": "/pricing",
"title": "Pricing - Example",
"timestamp": 1699999999999
}
]
}
'import requests
url = "https://app.outlit.ai/api/i/v1/{publicKey}/events"
payload = {
"visitorId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"source": "client",
"events": [
{
"type": "pageview",
"url": "https://example.com/pricing",
"path": "/pricing",
"title": "Pricing - Example",
"timestamp": 1699999999999
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
visitorId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
source: 'client',
events: [
{
type: 'pageview',
url: 'https://example.com/pricing',
path: '/pricing',
title: 'Pricing - Example',
timestamp: 1699999999999
}
]
})
};
fetch('https://app.outlit.ai/api/i/v1/{publicKey}/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://app.outlit.ai/api/i/v1/{publicKey}/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([
'visitorId' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'source' => 'client',
'events' => [
[
'type' => 'pageview',
'url' => 'https://example.com/pricing',
'path' => '/pricing',
'title' => 'Pricing - Example',
'timestamp' => 1699999999999
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://app.outlit.ai/api/i/v1/{publicKey}/events"
payload := strings.NewReader("{\n \"visitorId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"source\": \"client\",\n \"events\": [\n {\n \"type\": \"pageview\",\n \"url\": \"https://example.com/pricing\",\n \"path\": \"/pricing\",\n \"title\": \"Pricing - Example\",\n \"timestamp\": 1699999999999\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://app.outlit.ai/api/i/v1/{publicKey}/events")
.header("Content-Type", "application/json")
.body("{\n \"visitorId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"source\": \"client\",\n \"events\": [\n {\n \"type\": \"pageview\",\n \"url\": \"https://example.com/pricing\",\n \"path\": \"/pricing\",\n \"title\": \"Pricing - Example\",\n \"timestamp\": 1699999999999\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.outlit.ai/api/i/v1/{publicKey}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"visitorId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"source\": \"client\",\n \"events\": [\n {\n \"type\": \"pageview\",\n \"url\": \"https://example.com/pricing\",\n \"path\": \"/pricing\",\n \"title\": \"Pricing - Example\",\n \"timestamp\": 1699999999999\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": true,
"message": "<string>",
"errors": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"success": true,
"message": "<string>",
"errors": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"success": true,
"message": "<string>",
"errors": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"success": true,
"message": "<string>",
"errors": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}Ingest API
Ingest events
Send tracking events to Outlit. The public key in the URL path identifies the workspace; no secret bearer token is required for this endpoint.
POST
/
api
/
i
/
v1
/
{publicKey}
/
events
Ingest events
curl --request POST \
--url https://app.outlit.ai/api/i/v1/{publicKey}/events \
--header 'Content-Type: application/json' \
--data '
{
"visitorId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"source": "client",
"events": [
{
"type": "pageview",
"url": "https://example.com/pricing",
"path": "/pricing",
"title": "Pricing - Example",
"timestamp": 1699999999999
}
]
}
'import requests
url = "https://app.outlit.ai/api/i/v1/{publicKey}/events"
payload = {
"visitorId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"source": "client",
"events": [
{
"type": "pageview",
"url": "https://example.com/pricing",
"path": "/pricing",
"title": "Pricing - Example",
"timestamp": 1699999999999
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
visitorId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
source: 'client',
events: [
{
type: 'pageview',
url: 'https://example.com/pricing',
path: '/pricing',
title: 'Pricing - Example',
timestamp: 1699999999999
}
]
})
};
fetch('https://app.outlit.ai/api/i/v1/{publicKey}/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://app.outlit.ai/api/i/v1/{publicKey}/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([
'visitorId' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'source' => 'client',
'events' => [
[
'type' => 'pageview',
'url' => 'https://example.com/pricing',
'path' => '/pricing',
'title' => 'Pricing - Example',
'timestamp' => 1699999999999
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://app.outlit.ai/api/i/v1/{publicKey}/events"
payload := strings.NewReader("{\n \"visitorId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"source\": \"client\",\n \"events\": [\n {\n \"type\": \"pageview\",\n \"url\": \"https://example.com/pricing\",\n \"path\": \"/pricing\",\n \"title\": \"Pricing - Example\",\n \"timestamp\": 1699999999999\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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://app.outlit.ai/api/i/v1/{publicKey}/events")
.header("Content-Type", "application/json")
.body("{\n \"visitorId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"source\": \"client\",\n \"events\": [\n {\n \"type\": \"pageview\",\n \"url\": \"https://example.com/pricing\",\n \"path\": \"/pricing\",\n \"title\": \"Pricing - Example\",\n \"timestamp\": 1699999999999\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.outlit.ai/api/i/v1/{publicKey}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"visitorId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"source\": \"client\",\n \"events\": [\n {\n \"type\": \"pageview\",\n \"url\": \"https://example.com/pricing\",\n \"path\": \"/pricing\",\n \"title\": \"Pricing - Example\",\n \"timestamp\": 1699999999999\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": true,
"message": "<string>",
"errors": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"success": true,
"message": "<string>",
"errors": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"success": true,
"message": "<string>",
"errors": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}{
"success": true,
"message": "<string>",
"errors": [
{
"path": [
"<string>"
],
"message": "<string>"
}
]
}Path Parameters
Your organization's public key. Starts with pk_.
Pattern:
^pk_Body
application/json
Required array length:
1 - 100 elements- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Show child attributes
Show child attributes
Browser visitor identifier. Required for client tracking.
Available options:
client, server, integration Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Events accepted.
Was this page helpful?
⌘I