Skip to main content
POST
/
v1
/
dev
/
user
/
conversations
Create Conversation
curl --request POST \
  --url https://api.omi.me/v1/dev/user/conversations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "<string>",
  "finished_at": "2023-11-07T05:31:56Z",
  "geolocation": {
    "latitude": 123,
    "longitude": 123,
    "address": "<string>",
    "google_place_id": "<string>",
    "location_type": "<string>"
  },
  "language": "en",
  "started_at": "2023-11-07T05:31:56Z",
  "text_source": "other_text",
  "text_source_spec": "<string>"
}
'
import requests

url = "https://api.omi.me/v1/dev/user/conversations"

payload = {
"text": "<string>",
"finished_at": "2023-11-07T05:31:56Z",
"geolocation": {
"latitude": 123,
"longitude": 123,
"address": "<string>",
"google_place_id": "<string>",
"location_type": "<string>"
},
"language": "en",
"started_at": "2023-11-07T05:31:56Z",
"text_source": "other_text",
"text_source_spec": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
finished_at: '2023-11-07T05:31:56Z',
geolocation: {
latitude: 123,
longitude: 123,
address: '<string>',
google_place_id: '<string>',
location_type: '<string>'
},
language: 'en',
started_at: '2023-11-07T05:31:56Z',
text_source: 'other_text',
text_source_spec: '<string>'
})
};

fetch('https://api.omi.me/v1/dev/user/conversations', 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.omi.me/v1/dev/user/conversations",
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([
'text' => '<string>',
'finished_at' => '2023-11-07T05:31:56Z',
'geolocation' => [
'latitude' => 123,
'longitude' => 123,
'address' => '<string>',
'google_place_id' => '<string>',
'location_type' => '<string>'
],
'language' => 'en',
'started_at' => '2023-11-07T05:31:56Z',
'text_source' => 'other_text',
'text_source_spec' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.omi.me/v1/dev/user/conversations"

payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"finished_at\": \"2023-11-07T05:31:56Z\",\n \"geolocation\": {\n \"latitude\": 123,\n \"longitude\": 123,\n \"address\": \"<string>\",\n \"google_place_id\": \"<string>\",\n \"location_type\": \"<string>\"\n },\n \"language\": \"en\",\n \"started_at\": \"2023-11-07T05:31:56Z\",\n \"text_source\": \"other_text\",\n \"text_source_spec\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
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.omi.me/v1/dev/user/conversations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"finished_at\": \"2023-11-07T05:31:56Z\",\n \"geolocation\": {\n \"latitude\": 123,\n \"longitude\": 123,\n \"address\": \"<string>\",\n \"google_place_id\": \"<string>\",\n \"location_type\": \"<string>\"\n },\n \"language\": \"en\",\n \"started_at\": \"2023-11-07T05:31:56Z\",\n \"text_source\": \"other_text\",\n \"text_source_spec\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.omi.me/v1/dev/user/conversations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"finished_at\": \"2023-11-07T05:31:56Z\",\n \"geolocation\": {\n \"latitude\": 123,\n \"longitude\": 123,\n \"address\": \"<string>\",\n \"google_place_id\": \"<string>\",\n \"location_type\": \"<string>\"\n },\n \"language\": \"en\",\n \"started_at\": \"2023-11-07T05:31:56Z\",\n \"text_source\": \"other_text\",\n \"text_source_spec\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "discarded": true,
  "id": "<string>",
  "status": "<string>"
}
{
"detail": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

Send Authorization: Bearer <firebase_id_token>.

Body

application/json
text
string
required

The conversation text/transcript

Required string length: 1 - 100000
finished_at
string<date-time> | null

When the conversation finished (defaults to started_at + 5 minutes)

geolocation
Geolocation · object | null

Geolocation where conversation occurred

language
string | null
default:en

Language code (ISO 639-1, e.g., 'en', 'es', 'fr')

started_at
string<date-time> | null

When the conversation started (defaults to now)

text_source
enum<string>
default:other_text

Source type: audio_transcript, message, or other_text

Available options:
audio_transcript,
message,
other_text
text_source_spec
string | null

Additional source specification (e.g., 'email', 'slack', 'whatsapp')

Response

Successful Response

discarded
boolean
required
id
string
required
status
string
required