Imports
Upload Import Events
Uploads a batch of raw events to an in-progress import.
POST /api/sites/:site/imports/:importId/eventsUploads a batch of raw events to an in-progress import. Requires an admin or owner API key. On Rybbit Cloud, this requires a paid plan.
Upload events in batches. The request body limit is 50 MB, so split large exports across multiple requests. Set isLastBatch to true on the final batch to finalize the import.
Path Parameters
Prop
Type
Request Body
Prop
Type
Response
Returns 200 OK with an empty body. Events outside your plan's retention window are skipped and reflected in the import's skippedEvents / invalidEvents counts (see List Imports).
curl -X POST "https://app.rybbit.io/api/sites/123/imports/f47ac10b-58cc-4372-a567-0e02b2c3d479/events" \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"events": [
{ "...": "platform-specific fields" }
],
"isLastBatch": false
}'const response = await fetch(
'https://app.rybbit.io/api/sites/123/imports/f47ac10b-58cc-4372-a567-0e02b2c3d479/events',
{
method: 'POST',
headers: {
'Authorization': 'Bearer your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
events: [
{ '...': 'platform-specific fields' }
],
isLastBatch: false
})
}
);import requests
response = requests.post(
'https://app.rybbit.io/api/sites/123/imports/f47ac10b-58cc-4372-a567-0e02b2c3d479/events',
json={
'events': [
{ '...': 'platform-specific fields' }
],
'isLastBatch': False
},
headers={
'Authorization': 'Bearer your_api_key_here'
}
)$body = [
'events' => [
['...' => 'platform-specific fields']
],
'isLastBatch' => false
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.rybbit.io/api/sites/123/imports/f47ac10b-58cc-4372-a567-0e02b2c3d479/events');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer your_api_key_here',
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);require 'net/http'
require 'json'
uri = URI('https://app.rybbit.io/api/sites/123/imports/f47ac10b-58cc-4372-a567-0e02b2c3d479/events')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer your_api_key_here'
request['Content-Type'] = 'application/json'
request.body = {
events: [
{ '...': 'platform-specific fields' }
],
isLastBatch: false
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
endbody := map[string]interface{}{
"events": []map[string]string{
{"...": "platform-specific fields"},
},
"isLastBatch": false,
}
jsonBody, _ := json.Marshal(body)
req, _ := http.NewRequest("POST", "https://app.rybbit.io/api/sites/123/imports/f47ac10b-58cc-4372-a567-0e02b2c3d479/events", bytes.NewBuffer(jsonBody))
req.Header.Set("Authorization", "Bearer your_api_key_here")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()let body = serde_json::json!({
"events": [
{"...": "platform-specific fields"}
],
"isLastBatch": false
});
let client = reqwest::Client::new();
let res = client
.post("https://app.rybbit.io/api/sites/123/imports/f47ac10b-58cc-4372-a567-0e02b2c3d479/events")
.header("Authorization", "Bearer your_api_key_here")
.json(&body)
.send()
.await?;String json = """
{
"events": [
{"...": "platform-specific fields"}
],
"isLastBatch": false
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://app.rybbit.io/api/sites/123/imports/f47ac10b-58cc-4372-a567-0e02b2c3d479/events"))
.header("Authorization", "Bearer your_api_key_here")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());var body = new
{
events = new[]
{
new Dictionary<string, string> { { "...", "platform-specific fields" } }
},
isLastBatch = false
};
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
var content = new StringContent(
JsonSerializer.Serialize(body),
Encoding.UTF8,
"application/json");
var response = await client.PostAsync("https://app.rybbit.io/api/sites/123/imports/f47ac10b-58cc-4372-a567-0e02b2c3d479/events", content);