curl --request POST \
--url https://app.octavehq.com/api/v2/event/import \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"events": [
{
"type": "crm",
"eventTimestamp": "2024-02-03T16:00:00Z",
"eventType": "opportunity_created",
"opportunityId": "opp_12345",
"opportunityName": "Acme Corp - Enterprise Plan",
"amount": "50000.00",
"currency": "USD",
"stage": "Qualification",
"stageCategory": "open",
"accountName": "Acme Corp",
"crmAccountId": "acct_67890",
"crmAccountDomain": "acme.com",
"contactEmails": [
"john@acme.com",
"priya@acme.com"
],
"ownerEmail": "rep@yourcompany.com",
"closeDate": "2024-03-31T00:00:00Z",
"crmLastModifiedAt": "2024-02-03T16:00:00Z",
"eventId": "deal_12345_created"
},
{
"type": "email",
"eventTimestamp": "2024-02-03T10:30:00Z",
"eventType": "sent",
"subject": "Follow up on our conversation",
"body": {
"text": "Hi John, just wanted to follow up..."
},
"from": {
"email": "rep@yourcompany.com",
"name": "Sarah Johnson"
},
"to": [
{
"email": "john@acme.com",
"name": "John Smith"
}
],
"crmOpportunityId": "opp_12345",
"eventId": "email_98765"
},
{
"type": "call",
"eventTimestamp": "2024-02-03T14:00:00Z",
"eventType": "transcript",
"title": "Discovery Call - Acme Corp",
"transcript": [
{
"speaker": {
"name": "Sarah Johnson",
"email": "rep@yourcompany.com",
"role": "internal"
},
"text": "Thanks for making the time. What pushed you to look at this now?"
},
{
"speaker": {
"name": "John Smith",
"email": "john@acme.com",
"role": "external"
},
"text": "Our current process breaks down past about fifty reps."
}
],
"participants": [
{
"name": "Sarah Johnson",
"email": "rep@yourcompany.com",
"role": "internal"
},
{
"name": "John Smith",
"email": "john@acme.com",
"role": "external"
}
],
"crmOpportunityId": "opp_12345",
"eventId": "call_55501"
}
]
}
'import requests
url = "https://app.octavehq.com/api/v2/event/import"
payload = { "events": [
{
"type": "crm",
"eventTimestamp": "2024-02-03T16:00:00Z",
"eventType": "opportunity_created",
"opportunityId": "opp_12345",
"opportunityName": "Acme Corp - Enterprise Plan",
"amount": "50000.00",
"currency": "USD",
"stage": "Qualification",
"stageCategory": "open",
"accountName": "Acme Corp",
"crmAccountId": "acct_67890",
"crmAccountDomain": "acme.com",
"contactEmails": ["john@acme.com", "priya@acme.com"],
"ownerEmail": "rep@yourcompany.com",
"closeDate": "2024-03-31T00:00:00Z",
"crmLastModifiedAt": "2024-02-03T16:00:00Z",
"eventId": "deal_12345_created"
},
{
"type": "email",
"eventTimestamp": "2024-02-03T10:30:00Z",
"eventType": "sent",
"subject": "Follow up on our conversation",
"body": { "text": "Hi John, just wanted to follow up..." },
"from": {
"email": "rep@yourcompany.com",
"name": "Sarah Johnson"
},
"to": [
{
"email": "john@acme.com",
"name": "John Smith"
}
],
"crmOpportunityId": "opp_12345",
"eventId": "email_98765"
},
{
"type": "call",
"eventTimestamp": "2024-02-03T14:00:00Z",
"eventType": "transcript",
"title": "Discovery Call - Acme Corp",
"transcript": [
{
"speaker": {
"name": "Sarah Johnson",
"email": "rep@yourcompany.com",
"role": "internal"
},
"text": "Thanks for making the time. What pushed you to look at this now?"
},
{
"speaker": {
"name": "John Smith",
"email": "john@acme.com",
"role": "external"
},
"text": "Our current process breaks down past about fifty reps."
}
],
"participants": [
{
"name": "Sarah Johnson",
"email": "rep@yourcompany.com",
"role": "internal"
},
{
"name": "John Smith",
"email": "john@acme.com",
"role": "external"
}
],
"crmOpportunityId": "opp_12345",
"eventId": "call_55501"
}
] }
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
type: 'crm',
eventTimestamp: '2024-02-03T16:00:00Z',
eventType: 'opportunity_created',
opportunityId: 'opp_12345',
opportunityName: 'Acme Corp - Enterprise Plan',
amount: '50000.00',
currency: 'USD',
stage: 'Qualification',
stageCategory: 'open',
accountName: 'Acme Corp',
crmAccountId: 'acct_67890',
crmAccountDomain: 'acme.com',
contactEmails: ['john@acme.com', 'priya@acme.com'],
ownerEmail: 'rep@yourcompany.com',
closeDate: '2024-03-31T00:00:00Z',
crmLastModifiedAt: '2024-02-03T16:00:00Z',
eventId: 'deal_12345_created'
},
{
type: 'email',
eventTimestamp: '2024-02-03T10:30:00Z',
eventType: 'sent',
subject: 'Follow up on our conversation',
body: JSON.stringify({text: 'Hi John, just wanted to follow up...'}),
from: {email: 'rep@yourcompany.com', name: 'Sarah Johnson'},
to: [{email: 'john@acme.com', name: 'John Smith'}],
crmOpportunityId: 'opp_12345',
eventId: 'email_98765'
},
{
type: 'call',
eventTimestamp: '2024-02-03T14:00:00Z',
eventType: 'transcript',
title: 'Discovery Call - Acme Corp',
transcript: [
{
speaker: {name: 'Sarah Johnson', email: 'rep@yourcompany.com', role: 'internal'},
text: 'Thanks for making the time. What pushed you to look at this now?'
},
{
speaker: {name: 'John Smith', email: 'john@acme.com', role: 'external'},
text: 'Our current process breaks down past about fifty reps.'
}
],
participants: [
{name: 'Sarah Johnson', email: 'rep@yourcompany.com', role: 'internal'},
{name: 'John Smith', email: 'john@acme.com', role: 'external'}
],
crmOpportunityId: 'opp_12345',
eventId: 'call_55501'
}
]
})
};
fetch('https://app.octavehq.com/api/v2/event/import', 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.octavehq.com/api/v2/event/import",
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([
'events' => [
[
'type' => 'crm',
'eventTimestamp' => '2024-02-03T16:00:00Z',
'eventType' => 'opportunity_created',
'opportunityId' => 'opp_12345',
'opportunityName' => 'Acme Corp - Enterprise Plan',
'amount' => '50000.00',
'currency' => 'USD',
'stage' => 'Qualification',
'stageCategory' => 'open',
'accountName' => 'Acme Corp',
'crmAccountId' => 'acct_67890',
'crmAccountDomain' => 'acme.com',
'contactEmails' => [
'john@acme.com',
'priya@acme.com'
],
'ownerEmail' => 'rep@yourcompany.com',
'closeDate' => '2024-03-31T00:00:00Z',
'crmLastModifiedAt' => '2024-02-03T16:00:00Z',
'eventId' => 'deal_12345_created'
],
[
'type' => 'email',
'eventTimestamp' => '2024-02-03T10:30:00Z',
'eventType' => 'sent',
'subject' => 'Follow up on our conversation',
'body' => [
'text' => 'Hi John, just wanted to follow up...'
],
'from' => [
'email' => 'rep@yourcompany.com',
'name' => 'Sarah Johnson'
],
'to' => [
[
'email' => 'john@acme.com',
'name' => 'John Smith'
]
],
'crmOpportunityId' => 'opp_12345',
'eventId' => 'email_98765'
],
[
'type' => 'call',
'eventTimestamp' => '2024-02-03T14:00:00Z',
'eventType' => 'transcript',
'title' => 'Discovery Call - Acme Corp',
'transcript' => [
[
'speaker' => [
'name' => 'Sarah Johnson',
'email' => 'rep@yourcompany.com',
'role' => 'internal'
],
'text' => 'Thanks for making the time. What pushed you to look at this now?'
],
[
'speaker' => [
'name' => 'John Smith',
'email' => 'john@acme.com',
'role' => 'external'
],
'text' => 'Our current process breaks down past about fifty reps.'
]
],
'participants' => [
[
'name' => 'Sarah Johnson',
'email' => 'rep@yourcompany.com',
'role' => 'internal'
],
[
'name' => 'John Smith',
'email' => 'john@acme.com',
'role' => 'external'
]
],
'crmOpportunityId' => 'opp_12345',
'eventId' => 'call_55501'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_key: <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://app.octavehq.com/api/v2/event/import"
payload := strings.NewReader("{\n \"events\": [\n {\n \"type\": \"crm\",\n \"eventTimestamp\": \"2024-02-03T16:00:00Z\",\n \"eventType\": \"opportunity_created\",\n \"opportunityId\": \"opp_12345\",\n \"opportunityName\": \"Acme Corp - Enterprise Plan\",\n \"amount\": \"50000.00\",\n \"currency\": \"USD\",\n \"stage\": \"Qualification\",\n \"stageCategory\": \"open\",\n \"accountName\": \"Acme Corp\",\n \"crmAccountId\": \"acct_67890\",\n \"crmAccountDomain\": \"acme.com\",\n \"contactEmails\": [\n \"john@acme.com\",\n \"priya@acme.com\"\n ],\n \"ownerEmail\": \"rep@yourcompany.com\",\n \"closeDate\": \"2024-03-31T00:00:00Z\",\n \"crmLastModifiedAt\": \"2024-02-03T16:00:00Z\",\n \"eventId\": \"deal_12345_created\"\n },\n {\n \"type\": \"email\",\n \"eventTimestamp\": \"2024-02-03T10:30:00Z\",\n \"eventType\": \"sent\",\n \"subject\": \"Follow up on our conversation\",\n \"body\": {\n \"text\": \"Hi John, just wanted to follow up...\"\n },\n \"from\": {\n \"email\": \"rep@yourcompany.com\",\n \"name\": \"Sarah Johnson\"\n },\n \"to\": [\n {\n \"email\": \"john@acme.com\",\n \"name\": \"John Smith\"\n }\n ],\n \"crmOpportunityId\": \"opp_12345\",\n \"eventId\": \"email_98765\"\n },\n {\n \"type\": \"call\",\n \"eventTimestamp\": \"2024-02-03T14:00:00Z\",\n \"eventType\": \"transcript\",\n \"title\": \"Discovery Call - Acme Corp\",\n \"transcript\": [\n {\n \"speaker\": {\n \"name\": \"Sarah Johnson\",\n \"email\": \"rep@yourcompany.com\",\n \"role\": \"internal\"\n },\n \"text\": \"Thanks for making the time. What pushed you to look at this now?\"\n },\n {\n \"speaker\": {\n \"name\": \"John Smith\",\n \"email\": \"john@acme.com\",\n \"role\": \"external\"\n },\n \"text\": \"Our current process breaks down past about fifty reps.\"\n }\n ],\n \"participants\": [\n {\n \"name\": \"Sarah Johnson\",\n \"email\": \"rep@yourcompany.com\",\n \"role\": \"internal\"\n },\n {\n \"name\": \"John Smith\",\n \"email\": \"john@acme.com\",\n \"role\": \"external\"\n }\n ],\n \"crmOpportunityId\": \"opp_12345\",\n \"eventId\": \"call_55501\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_key", "<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://app.octavehq.com/api/v2/event/import")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"type\": \"crm\",\n \"eventTimestamp\": \"2024-02-03T16:00:00Z\",\n \"eventType\": \"opportunity_created\",\n \"opportunityId\": \"opp_12345\",\n \"opportunityName\": \"Acme Corp - Enterprise Plan\",\n \"amount\": \"50000.00\",\n \"currency\": \"USD\",\n \"stage\": \"Qualification\",\n \"stageCategory\": \"open\",\n \"accountName\": \"Acme Corp\",\n \"crmAccountId\": \"acct_67890\",\n \"crmAccountDomain\": \"acme.com\",\n \"contactEmails\": [\n \"john@acme.com\",\n \"priya@acme.com\"\n ],\n \"ownerEmail\": \"rep@yourcompany.com\",\n \"closeDate\": \"2024-03-31T00:00:00Z\",\n \"crmLastModifiedAt\": \"2024-02-03T16:00:00Z\",\n \"eventId\": \"deal_12345_created\"\n },\n {\n \"type\": \"email\",\n \"eventTimestamp\": \"2024-02-03T10:30:00Z\",\n \"eventType\": \"sent\",\n \"subject\": \"Follow up on our conversation\",\n \"body\": {\n \"text\": \"Hi John, just wanted to follow up...\"\n },\n \"from\": {\n \"email\": \"rep@yourcompany.com\",\n \"name\": \"Sarah Johnson\"\n },\n \"to\": [\n {\n \"email\": \"john@acme.com\",\n \"name\": \"John Smith\"\n }\n ],\n \"crmOpportunityId\": \"opp_12345\",\n \"eventId\": \"email_98765\"\n },\n {\n \"type\": \"call\",\n \"eventTimestamp\": \"2024-02-03T14:00:00Z\",\n \"eventType\": \"transcript\",\n \"title\": \"Discovery Call - Acme Corp\",\n \"transcript\": [\n {\n \"speaker\": {\n \"name\": \"Sarah Johnson\",\n \"email\": \"rep@yourcompany.com\",\n \"role\": \"internal\"\n },\n \"text\": \"Thanks for making the time. What pushed you to look at this now?\"\n },\n {\n \"speaker\": {\n \"name\": \"John Smith\",\n \"email\": \"john@acme.com\",\n \"role\": \"external\"\n },\n \"text\": \"Our current process breaks down past about fifty reps.\"\n }\n ],\n \"participants\": [\n {\n \"name\": \"Sarah Johnson\",\n \"email\": \"rep@yourcompany.com\",\n \"role\": \"internal\"\n },\n {\n \"name\": \"John Smith\",\n \"email\": \"john@acme.com\",\n \"role\": \"external\"\n }\n ],\n \"crmOpportunityId\": \"opp_12345\",\n \"eventId\": \"call_55501\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.octavehq.com/api/v2/event/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"type\": \"crm\",\n \"eventTimestamp\": \"2024-02-03T16:00:00Z\",\n \"eventType\": \"opportunity_created\",\n \"opportunityId\": \"opp_12345\",\n \"opportunityName\": \"Acme Corp - Enterprise Plan\",\n \"amount\": \"50000.00\",\n \"currency\": \"USD\",\n \"stage\": \"Qualification\",\n \"stageCategory\": \"open\",\n \"accountName\": \"Acme Corp\",\n \"crmAccountId\": \"acct_67890\",\n \"crmAccountDomain\": \"acme.com\",\n \"contactEmails\": [\n \"john@acme.com\",\n \"priya@acme.com\"\n ],\n \"ownerEmail\": \"rep@yourcompany.com\",\n \"closeDate\": \"2024-03-31T00:00:00Z\",\n \"crmLastModifiedAt\": \"2024-02-03T16:00:00Z\",\n \"eventId\": \"deal_12345_created\"\n },\n {\n \"type\": \"email\",\n \"eventTimestamp\": \"2024-02-03T10:30:00Z\",\n \"eventType\": \"sent\",\n \"subject\": \"Follow up on our conversation\",\n \"body\": {\n \"text\": \"Hi John, just wanted to follow up...\"\n },\n \"from\": {\n \"email\": \"rep@yourcompany.com\",\n \"name\": \"Sarah Johnson\"\n },\n \"to\": [\n {\n \"email\": \"john@acme.com\",\n \"name\": \"John Smith\"\n }\n ],\n \"crmOpportunityId\": \"opp_12345\",\n \"eventId\": \"email_98765\"\n },\n {\n \"type\": \"call\",\n \"eventTimestamp\": \"2024-02-03T14:00:00Z\",\n \"eventType\": \"transcript\",\n \"title\": \"Discovery Call - Acme Corp\",\n \"transcript\": [\n {\n \"speaker\": {\n \"name\": \"Sarah Johnson\",\n \"email\": \"rep@yourcompany.com\",\n \"role\": \"internal\"\n },\n \"text\": \"Thanks for making the time. What pushed you to look at this now?\"\n },\n {\n \"speaker\": {\n \"name\": \"John Smith\",\n \"email\": \"john@acme.com\",\n \"role\": \"external\"\n },\n \"text\": \"Our current process breaks down past about fifty reps.\"\n }\n ],\n \"participants\": [\n {\n \"name\": \"Sarah Johnson\",\n \"email\": \"rep@yourcompany.com\",\n \"role\": \"internal\"\n },\n {\n \"name\": \"John Smith\",\n \"email\": \"john@acme.com\",\n \"role\": \"external\"\n }\n ],\n \"crmOpportunityId\": \"opp_12345\",\n \"eventId\": \"call_55501\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"_metadata": {
"requestId": "requestId",
"timestamp": "2021-01-01T00:00:00.000Z",
"usage": 0,
"message": "message"
},
"jobs": [
{
"eventType": "email",
"provider": "OCTAVE_GENERIC_CALL",
"jobOId": "pbj_3rgkoHhR00cEdE9DjKeIK",
"accepted": 123,
"preSkipped": 123,
"duplicatesInBatch": [
123
]
}
],
"totalAccepted": 123,
"totalPreSkipped": 123
}{
"_metadata": {
"requestId": "requestId",
"timestamp": "2021-01-01T00:00:00.000Z",
"usage": 0,
"message": "message"
},
"message": "<string>"
}Bulk import events
Imports a batch of events (calls, emails, CRM, social) into the analytics pipeline. Accepts up to 1000 events per request; events are ingested asynchronously.
One import job is created per event type present in the request; each job is tracked independently via GET /event/import/status.
Deduplication: supply eventId on each event for predictable dedupe, otherwise a deterministic ID is derived from the event’s content. Events whose ID matches an existing event in the workspace are skipped (reported as preSkipped); duplicate IDs within one request keep the first occurrence (later indices reported in duplicatesInBatch). An event re-sent while its first copy is still being ingested is accepted again and de-duplicated at ingest instead — it lands in that job’s skipped count, never as a second event.
Skipped vs failed: only processable event types produce analytics events (email sent/reply, call transcript, all CRM types, all social types) — other event types are accepted but land in the job’s skipped count, alongside duplicates and internal-only events. ingested is the authoritative success count.
Callback: if callbackUrl is provided, each job POSTs its final counts to that URL once on completion (one callback per job; delivery is best-effort — poll the status endpoint as the source of truth). The callback body is { jobOId, provider, status, counts, completedAt } with the same counts object the status endpoint returns, sent with an X-Request-Id header.
Limits: 30 requests per minute per API key; request body up to 30 MB; each serialized event under 1,000,000 bytes (oversized indices are rejected with a 400 before anything is queued).
Validation is all-or-nothing: a 400 means nothing in the request was imported; the message lists the offending zero-based indices.
Authentication: api_key header. Requires the analytics and write-API entitlements.
curl --request POST \
--url https://app.octavehq.com/api/v2/event/import \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"events": [
{
"type": "crm",
"eventTimestamp": "2024-02-03T16:00:00Z",
"eventType": "opportunity_created",
"opportunityId": "opp_12345",
"opportunityName": "Acme Corp - Enterprise Plan",
"amount": "50000.00",
"currency": "USD",
"stage": "Qualification",
"stageCategory": "open",
"accountName": "Acme Corp",
"crmAccountId": "acct_67890",
"crmAccountDomain": "acme.com",
"contactEmails": [
"john@acme.com",
"priya@acme.com"
],
"ownerEmail": "rep@yourcompany.com",
"closeDate": "2024-03-31T00:00:00Z",
"crmLastModifiedAt": "2024-02-03T16:00:00Z",
"eventId": "deal_12345_created"
},
{
"type": "email",
"eventTimestamp": "2024-02-03T10:30:00Z",
"eventType": "sent",
"subject": "Follow up on our conversation",
"body": {
"text": "Hi John, just wanted to follow up..."
},
"from": {
"email": "rep@yourcompany.com",
"name": "Sarah Johnson"
},
"to": [
{
"email": "john@acme.com",
"name": "John Smith"
}
],
"crmOpportunityId": "opp_12345",
"eventId": "email_98765"
},
{
"type": "call",
"eventTimestamp": "2024-02-03T14:00:00Z",
"eventType": "transcript",
"title": "Discovery Call - Acme Corp",
"transcript": [
{
"speaker": {
"name": "Sarah Johnson",
"email": "rep@yourcompany.com",
"role": "internal"
},
"text": "Thanks for making the time. What pushed you to look at this now?"
},
{
"speaker": {
"name": "John Smith",
"email": "john@acme.com",
"role": "external"
},
"text": "Our current process breaks down past about fifty reps."
}
],
"participants": [
{
"name": "Sarah Johnson",
"email": "rep@yourcompany.com",
"role": "internal"
},
{
"name": "John Smith",
"email": "john@acme.com",
"role": "external"
}
],
"crmOpportunityId": "opp_12345",
"eventId": "call_55501"
}
]
}
'import requests
url = "https://app.octavehq.com/api/v2/event/import"
payload = { "events": [
{
"type": "crm",
"eventTimestamp": "2024-02-03T16:00:00Z",
"eventType": "opportunity_created",
"opportunityId": "opp_12345",
"opportunityName": "Acme Corp - Enterprise Plan",
"amount": "50000.00",
"currency": "USD",
"stage": "Qualification",
"stageCategory": "open",
"accountName": "Acme Corp",
"crmAccountId": "acct_67890",
"crmAccountDomain": "acme.com",
"contactEmails": ["john@acme.com", "priya@acme.com"],
"ownerEmail": "rep@yourcompany.com",
"closeDate": "2024-03-31T00:00:00Z",
"crmLastModifiedAt": "2024-02-03T16:00:00Z",
"eventId": "deal_12345_created"
},
{
"type": "email",
"eventTimestamp": "2024-02-03T10:30:00Z",
"eventType": "sent",
"subject": "Follow up on our conversation",
"body": { "text": "Hi John, just wanted to follow up..." },
"from": {
"email": "rep@yourcompany.com",
"name": "Sarah Johnson"
},
"to": [
{
"email": "john@acme.com",
"name": "John Smith"
}
],
"crmOpportunityId": "opp_12345",
"eventId": "email_98765"
},
{
"type": "call",
"eventTimestamp": "2024-02-03T14:00:00Z",
"eventType": "transcript",
"title": "Discovery Call - Acme Corp",
"transcript": [
{
"speaker": {
"name": "Sarah Johnson",
"email": "rep@yourcompany.com",
"role": "internal"
},
"text": "Thanks for making the time. What pushed you to look at this now?"
},
{
"speaker": {
"name": "John Smith",
"email": "john@acme.com",
"role": "external"
},
"text": "Our current process breaks down past about fifty reps."
}
],
"participants": [
{
"name": "Sarah Johnson",
"email": "rep@yourcompany.com",
"role": "internal"
},
{
"name": "John Smith",
"email": "john@acme.com",
"role": "external"
}
],
"crmOpportunityId": "opp_12345",
"eventId": "call_55501"
}
] }
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
type: 'crm',
eventTimestamp: '2024-02-03T16:00:00Z',
eventType: 'opportunity_created',
opportunityId: 'opp_12345',
opportunityName: 'Acme Corp - Enterprise Plan',
amount: '50000.00',
currency: 'USD',
stage: 'Qualification',
stageCategory: 'open',
accountName: 'Acme Corp',
crmAccountId: 'acct_67890',
crmAccountDomain: 'acme.com',
contactEmails: ['john@acme.com', 'priya@acme.com'],
ownerEmail: 'rep@yourcompany.com',
closeDate: '2024-03-31T00:00:00Z',
crmLastModifiedAt: '2024-02-03T16:00:00Z',
eventId: 'deal_12345_created'
},
{
type: 'email',
eventTimestamp: '2024-02-03T10:30:00Z',
eventType: 'sent',
subject: 'Follow up on our conversation',
body: JSON.stringify({text: 'Hi John, just wanted to follow up...'}),
from: {email: 'rep@yourcompany.com', name: 'Sarah Johnson'},
to: [{email: 'john@acme.com', name: 'John Smith'}],
crmOpportunityId: 'opp_12345',
eventId: 'email_98765'
},
{
type: 'call',
eventTimestamp: '2024-02-03T14:00:00Z',
eventType: 'transcript',
title: 'Discovery Call - Acme Corp',
transcript: [
{
speaker: {name: 'Sarah Johnson', email: 'rep@yourcompany.com', role: 'internal'},
text: 'Thanks for making the time. What pushed you to look at this now?'
},
{
speaker: {name: 'John Smith', email: 'john@acme.com', role: 'external'},
text: 'Our current process breaks down past about fifty reps.'
}
],
participants: [
{name: 'Sarah Johnson', email: 'rep@yourcompany.com', role: 'internal'},
{name: 'John Smith', email: 'john@acme.com', role: 'external'}
],
crmOpportunityId: 'opp_12345',
eventId: 'call_55501'
}
]
})
};
fetch('https://app.octavehq.com/api/v2/event/import', 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.octavehq.com/api/v2/event/import",
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([
'events' => [
[
'type' => 'crm',
'eventTimestamp' => '2024-02-03T16:00:00Z',
'eventType' => 'opportunity_created',
'opportunityId' => 'opp_12345',
'opportunityName' => 'Acme Corp - Enterprise Plan',
'amount' => '50000.00',
'currency' => 'USD',
'stage' => 'Qualification',
'stageCategory' => 'open',
'accountName' => 'Acme Corp',
'crmAccountId' => 'acct_67890',
'crmAccountDomain' => 'acme.com',
'contactEmails' => [
'john@acme.com',
'priya@acme.com'
],
'ownerEmail' => 'rep@yourcompany.com',
'closeDate' => '2024-03-31T00:00:00Z',
'crmLastModifiedAt' => '2024-02-03T16:00:00Z',
'eventId' => 'deal_12345_created'
],
[
'type' => 'email',
'eventTimestamp' => '2024-02-03T10:30:00Z',
'eventType' => 'sent',
'subject' => 'Follow up on our conversation',
'body' => [
'text' => 'Hi John, just wanted to follow up...'
],
'from' => [
'email' => 'rep@yourcompany.com',
'name' => 'Sarah Johnson'
],
'to' => [
[
'email' => 'john@acme.com',
'name' => 'John Smith'
]
],
'crmOpportunityId' => 'opp_12345',
'eventId' => 'email_98765'
],
[
'type' => 'call',
'eventTimestamp' => '2024-02-03T14:00:00Z',
'eventType' => 'transcript',
'title' => 'Discovery Call - Acme Corp',
'transcript' => [
[
'speaker' => [
'name' => 'Sarah Johnson',
'email' => 'rep@yourcompany.com',
'role' => 'internal'
],
'text' => 'Thanks for making the time. What pushed you to look at this now?'
],
[
'speaker' => [
'name' => 'John Smith',
'email' => 'john@acme.com',
'role' => 'external'
],
'text' => 'Our current process breaks down past about fifty reps.'
]
],
'participants' => [
[
'name' => 'Sarah Johnson',
'email' => 'rep@yourcompany.com',
'role' => 'internal'
],
[
'name' => 'John Smith',
'email' => 'john@acme.com',
'role' => 'external'
]
],
'crmOpportunityId' => 'opp_12345',
'eventId' => 'call_55501'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_key: <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://app.octavehq.com/api/v2/event/import"
payload := strings.NewReader("{\n \"events\": [\n {\n \"type\": \"crm\",\n \"eventTimestamp\": \"2024-02-03T16:00:00Z\",\n \"eventType\": \"opportunity_created\",\n \"opportunityId\": \"opp_12345\",\n \"opportunityName\": \"Acme Corp - Enterprise Plan\",\n \"amount\": \"50000.00\",\n \"currency\": \"USD\",\n \"stage\": \"Qualification\",\n \"stageCategory\": \"open\",\n \"accountName\": \"Acme Corp\",\n \"crmAccountId\": \"acct_67890\",\n \"crmAccountDomain\": \"acme.com\",\n \"contactEmails\": [\n \"john@acme.com\",\n \"priya@acme.com\"\n ],\n \"ownerEmail\": \"rep@yourcompany.com\",\n \"closeDate\": \"2024-03-31T00:00:00Z\",\n \"crmLastModifiedAt\": \"2024-02-03T16:00:00Z\",\n \"eventId\": \"deal_12345_created\"\n },\n {\n \"type\": \"email\",\n \"eventTimestamp\": \"2024-02-03T10:30:00Z\",\n \"eventType\": \"sent\",\n \"subject\": \"Follow up on our conversation\",\n \"body\": {\n \"text\": \"Hi John, just wanted to follow up...\"\n },\n \"from\": {\n \"email\": \"rep@yourcompany.com\",\n \"name\": \"Sarah Johnson\"\n },\n \"to\": [\n {\n \"email\": \"john@acme.com\",\n \"name\": \"John Smith\"\n }\n ],\n \"crmOpportunityId\": \"opp_12345\",\n \"eventId\": \"email_98765\"\n },\n {\n \"type\": \"call\",\n \"eventTimestamp\": \"2024-02-03T14:00:00Z\",\n \"eventType\": \"transcript\",\n \"title\": \"Discovery Call - Acme Corp\",\n \"transcript\": [\n {\n \"speaker\": {\n \"name\": \"Sarah Johnson\",\n \"email\": \"rep@yourcompany.com\",\n \"role\": \"internal\"\n },\n \"text\": \"Thanks for making the time. What pushed you to look at this now?\"\n },\n {\n \"speaker\": {\n \"name\": \"John Smith\",\n \"email\": \"john@acme.com\",\n \"role\": \"external\"\n },\n \"text\": \"Our current process breaks down past about fifty reps.\"\n }\n ],\n \"participants\": [\n {\n \"name\": \"Sarah Johnson\",\n \"email\": \"rep@yourcompany.com\",\n \"role\": \"internal\"\n },\n {\n \"name\": \"John Smith\",\n \"email\": \"john@acme.com\",\n \"role\": \"external\"\n }\n ],\n \"crmOpportunityId\": \"opp_12345\",\n \"eventId\": \"call_55501\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_key", "<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://app.octavehq.com/api/v2/event/import")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"type\": \"crm\",\n \"eventTimestamp\": \"2024-02-03T16:00:00Z\",\n \"eventType\": \"opportunity_created\",\n \"opportunityId\": \"opp_12345\",\n \"opportunityName\": \"Acme Corp - Enterprise Plan\",\n \"amount\": \"50000.00\",\n \"currency\": \"USD\",\n \"stage\": \"Qualification\",\n \"stageCategory\": \"open\",\n \"accountName\": \"Acme Corp\",\n \"crmAccountId\": \"acct_67890\",\n \"crmAccountDomain\": \"acme.com\",\n \"contactEmails\": [\n \"john@acme.com\",\n \"priya@acme.com\"\n ],\n \"ownerEmail\": \"rep@yourcompany.com\",\n \"closeDate\": \"2024-03-31T00:00:00Z\",\n \"crmLastModifiedAt\": \"2024-02-03T16:00:00Z\",\n \"eventId\": \"deal_12345_created\"\n },\n {\n \"type\": \"email\",\n \"eventTimestamp\": \"2024-02-03T10:30:00Z\",\n \"eventType\": \"sent\",\n \"subject\": \"Follow up on our conversation\",\n \"body\": {\n \"text\": \"Hi John, just wanted to follow up...\"\n },\n \"from\": {\n \"email\": \"rep@yourcompany.com\",\n \"name\": \"Sarah Johnson\"\n },\n \"to\": [\n {\n \"email\": \"john@acme.com\",\n \"name\": \"John Smith\"\n }\n ],\n \"crmOpportunityId\": \"opp_12345\",\n \"eventId\": \"email_98765\"\n },\n {\n \"type\": \"call\",\n \"eventTimestamp\": \"2024-02-03T14:00:00Z\",\n \"eventType\": \"transcript\",\n \"title\": \"Discovery Call - Acme Corp\",\n \"transcript\": [\n {\n \"speaker\": {\n \"name\": \"Sarah Johnson\",\n \"email\": \"rep@yourcompany.com\",\n \"role\": \"internal\"\n },\n \"text\": \"Thanks for making the time. What pushed you to look at this now?\"\n },\n {\n \"speaker\": {\n \"name\": \"John Smith\",\n \"email\": \"john@acme.com\",\n \"role\": \"external\"\n },\n \"text\": \"Our current process breaks down past about fifty reps.\"\n }\n ],\n \"participants\": [\n {\n \"name\": \"Sarah Johnson\",\n \"email\": \"rep@yourcompany.com\",\n \"role\": \"internal\"\n },\n {\n \"name\": \"John Smith\",\n \"email\": \"john@acme.com\",\n \"role\": \"external\"\n }\n ],\n \"crmOpportunityId\": \"opp_12345\",\n \"eventId\": \"call_55501\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.octavehq.com/api/v2/event/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"type\": \"crm\",\n \"eventTimestamp\": \"2024-02-03T16:00:00Z\",\n \"eventType\": \"opportunity_created\",\n \"opportunityId\": \"opp_12345\",\n \"opportunityName\": \"Acme Corp - Enterprise Plan\",\n \"amount\": \"50000.00\",\n \"currency\": \"USD\",\n \"stage\": \"Qualification\",\n \"stageCategory\": \"open\",\n \"accountName\": \"Acme Corp\",\n \"crmAccountId\": \"acct_67890\",\n \"crmAccountDomain\": \"acme.com\",\n \"contactEmails\": [\n \"john@acme.com\",\n \"priya@acme.com\"\n ],\n \"ownerEmail\": \"rep@yourcompany.com\",\n \"closeDate\": \"2024-03-31T00:00:00Z\",\n \"crmLastModifiedAt\": \"2024-02-03T16:00:00Z\",\n \"eventId\": \"deal_12345_created\"\n },\n {\n \"type\": \"email\",\n \"eventTimestamp\": \"2024-02-03T10:30:00Z\",\n \"eventType\": \"sent\",\n \"subject\": \"Follow up on our conversation\",\n \"body\": {\n \"text\": \"Hi John, just wanted to follow up...\"\n },\n \"from\": {\n \"email\": \"rep@yourcompany.com\",\n \"name\": \"Sarah Johnson\"\n },\n \"to\": [\n {\n \"email\": \"john@acme.com\",\n \"name\": \"John Smith\"\n }\n ],\n \"crmOpportunityId\": \"opp_12345\",\n \"eventId\": \"email_98765\"\n },\n {\n \"type\": \"call\",\n \"eventTimestamp\": \"2024-02-03T14:00:00Z\",\n \"eventType\": \"transcript\",\n \"title\": \"Discovery Call - Acme Corp\",\n \"transcript\": [\n {\n \"speaker\": {\n \"name\": \"Sarah Johnson\",\n \"email\": \"rep@yourcompany.com\",\n \"role\": \"internal\"\n },\n \"text\": \"Thanks for making the time. What pushed you to look at this now?\"\n },\n {\n \"speaker\": {\n \"name\": \"John Smith\",\n \"email\": \"john@acme.com\",\n \"role\": \"external\"\n },\n \"text\": \"Our current process breaks down past about fifty reps.\"\n }\n ],\n \"participants\": [\n {\n \"name\": \"Sarah Johnson\",\n \"email\": \"rep@yourcompany.com\",\n \"role\": \"internal\"\n },\n {\n \"name\": \"John Smith\",\n \"email\": \"john@acme.com\",\n \"role\": \"external\"\n }\n ],\n \"crmOpportunityId\": \"opp_12345\",\n \"eventId\": \"call_55501\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"_metadata": {
"requestId": "requestId",
"timestamp": "2021-01-01T00:00:00.000Z",
"usage": 0,
"message": "message"
},
"jobs": [
{
"eventType": "email",
"provider": "OCTAVE_GENERIC_CALL",
"jobOId": "pbj_3rgkoHhR00cEdE9DjKeIK",
"accepted": 123,
"preSkipped": 123,
"duplicatesInBatch": [
123
]
}
],
"totalAccepted": 123,
"totalPreSkipped": 123
}{
"_metadata": {
"requestId": "requestId",
"timestamp": "2021-01-01T00:00:00.000Z",
"usage": 0,
"message": "message"
},
"message": "<string>"
}Authorizations
Body
1 to 1000 events. Types can be mixed in one request; each event carries a type discriminator (email | call | crm | social) and otherwise follows the same structure as the single-event webhook for that type. Each serialized event must be under 1,000,000 bytes.
1 - 1000 elements- Email Event
- Call Event
- CRM Event
- Social Event
Show child attributes
Show child attributes
HTTPS URL to POST each job's final counts to on completion. Public hosts only — localhost, private ranges and cloud metadata endpoints are rejected.
"https://example.com/octave/import-complete"
Response
Import jobs created