curl --request POST \
--url https://enterprise.tavrn.ai/v2/cases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Jane Doe v. ACME Corp",
"client_name": "Jane Doe",
"description": "<string>",
"client_date_of_birth": "2023-12-25",
"client_address": "<string>",
"client_phone": "<string>",
"client_email": "jsmith@example.com",
"date_of_injury": "2023-12-25",
"deposition_date": "2023-12-25",
"case_category": "personal_injury",
"status": "active",
"external_id": "<string>",
"metadata": {
"external_id": "case-123"
},
"owner_email": "jane.smith@example.com",
"interested_parties": [
"john.doe@example.com"
]
}
'import requests
url = "https://enterprise.tavrn.ai/v2/cases"
payload = {
"title": "Jane Doe v. ACME Corp",
"client_name": "Jane Doe",
"description": "<string>",
"client_date_of_birth": "2023-12-25",
"client_address": "<string>",
"client_phone": "<string>",
"client_email": "jsmith@example.com",
"date_of_injury": "2023-12-25",
"deposition_date": "2023-12-25",
"case_category": "personal_injury",
"status": "active",
"external_id": "<string>",
"metadata": { "external_id": "case-123" },
"owner_email": "jane.smith@example.com",
"interested_parties": ["john.doe@example.com"]
}
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({
title: 'Jane Doe v. ACME Corp',
client_name: 'Jane Doe',
description: '<string>',
client_date_of_birth: '2023-12-25',
client_address: '<string>',
client_phone: '<string>',
client_email: 'jsmith@example.com',
date_of_injury: '2023-12-25',
deposition_date: '2023-12-25',
case_category: 'personal_injury',
status: 'active',
external_id: '<string>',
metadata: {external_id: 'case-123'},
owner_email: 'jane.smith@example.com',
interested_parties: ['john.doe@example.com']
})
};
fetch('https://enterprise.tavrn.ai/v2/cases', 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://enterprise.tavrn.ai/v2/cases",
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([
'title' => 'Jane Doe v. ACME Corp',
'client_name' => 'Jane Doe',
'description' => '<string>',
'client_date_of_birth' => '2023-12-25',
'client_address' => '<string>',
'client_phone' => '<string>',
'client_email' => 'jsmith@example.com',
'date_of_injury' => '2023-12-25',
'deposition_date' => '2023-12-25',
'case_category' => 'personal_injury',
'status' => 'active',
'external_id' => '<string>',
'metadata' => [
'external_id' => 'case-123'
],
'owner_email' => 'jane.smith@example.com',
'interested_parties' => [
'john.doe@example.com'
]
]),
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://enterprise.tavrn.ai/v2/cases"
payload := strings.NewReader("{\n \"title\": \"Jane Doe v. ACME Corp\",\n \"client_name\": \"Jane Doe\",\n \"description\": \"<string>\",\n \"client_date_of_birth\": \"2023-12-25\",\n \"client_address\": \"<string>\",\n \"client_phone\": \"<string>\",\n \"client_email\": \"jsmith@example.com\",\n \"date_of_injury\": \"2023-12-25\",\n \"deposition_date\": \"2023-12-25\",\n \"case_category\": \"personal_injury\",\n \"status\": \"active\",\n \"external_id\": \"<string>\",\n \"metadata\": {\n \"external_id\": \"case-123\"\n },\n \"owner_email\": \"jane.smith@example.com\",\n \"interested_parties\": [\n \"john.doe@example.com\"\n ]\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://enterprise.tavrn.ai/v2/cases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Jane Doe v. ACME Corp\",\n \"client_name\": \"Jane Doe\",\n \"description\": \"<string>\",\n \"client_date_of_birth\": \"2023-12-25\",\n \"client_address\": \"<string>\",\n \"client_phone\": \"<string>\",\n \"client_email\": \"jsmith@example.com\",\n \"date_of_injury\": \"2023-12-25\",\n \"deposition_date\": \"2023-12-25\",\n \"case_category\": \"personal_injury\",\n \"status\": \"active\",\n \"external_id\": \"<string>\",\n \"metadata\": {\n \"external_id\": \"case-123\"\n },\n \"owner_email\": \"jane.smith@example.com\",\n \"interested_parties\": [\n \"john.doe@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://enterprise.tavrn.ai/v2/cases")
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 \"title\": \"Jane Doe v. ACME Corp\",\n \"client_name\": \"Jane Doe\",\n \"description\": \"<string>\",\n \"client_date_of_birth\": \"2023-12-25\",\n \"client_address\": \"<string>\",\n \"client_phone\": \"<string>\",\n \"client_email\": \"jsmith@example.com\",\n \"date_of_injury\": \"2023-12-25\",\n \"deposition_date\": \"2023-12-25\",\n \"case_category\": \"personal_injury\",\n \"status\": \"active\",\n \"external_id\": \"<string>\",\n \"metadata\": {\n \"external_id\": \"case-123\"\n },\n \"owner_email\": \"jane.smith@example.com\",\n \"interested_parties\": [\n \"john.doe@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "case_abc123",
"case_number": "EI-2025-0001",
"title": "Jane Doe v. ACME Corp",
"client_name": "Jane Doe",
"case_category": "personal_injury",
"status": "active",
"created_at": "2025-02-01T12:34:56Z",
"updated_at": "2025-02-01T12:34:56Z",
"metadata": {
"external_id": "case-123"
},
"owner_email": "jane.smith@example.com",
"interested_parties": [
"john.doe@example.com"
],
"description": "Rear-end MVA with cervical injury",
"client_date_of_birth": "1989-04-12",
"client_address": "123 Main St, Austin, TX 78701",
"client_phone": "+1-512-555-0101",
"client_email": "jane@example.com",
"date_of_injury": "2025-01-10",
"deposition_date": "2025-06-15",
"external_id": "expert-institute-12345"
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#internal_error"
}
}Create a case
Create a new legal case
curl --request POST \
--url https://enterprise.tavrn.ai/v2/cases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Jane Doe v. ACME Corp",
"client_name": "Jane Doe",
"description": "<string>",
"client_date_of_birth": "2023-12-25",
"client_address": "<string>",
"client_phone": "<string>",
"client_email": "jsmith@example.com",
"date_of_injury": "2023-12-25",
"deposition_date": "2023-12-25",
"case_category": "personal_injury",
"status": "active",
"external_id": "<string>",
"metadata": {
"external_id": "case-123"
},
"owner_email": "jane.smith@example.com",
"interested_parties": [
"john.doe@example.com"
]
}
'import requests
url = "https://enterprise.tavrn.ai/v2/cases"
payload = {
"title": "Jane Doe v. ACME Corp",
"client_name": "Jane Doe",
"description": "<string>",
"client_date_of_birth": "2023-12-25",
"client_address": "<string>",
"client_phone": "<string>",
"client_email": "jsmith@example.com",
"date_of_injury": "2023-12-25",
"deposition_date": "2023-12-25",
"case_category": "personal_injury",
"status": "active",
"external_id": "<string>",
"metadata": { "external_id": "case-123" },
"owner_email": "jane.smith@example.com",
"interested_parties": ["john.doe@example.com"]
}
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({
title: 'Jane Doe v. ACME Corp',
client_name: 'Jane Doe',
description: '<string>',
client_date_of_birth: '2023-12-25',
client_address: '<string>',
client_phone: '<string>',
client_email: 'jsmith@example.com',
date_of_injury: '2023-12-25',
deposition_date: '2023-12-25',
case_category: 'personal_injury',
status: 'active',
external_id: '<string>',
metadata: {external_id: 'case-123'},
owner_email: 'jane.smith@example.com',
interested_parties: ['john.doe@example.com']
})
};
fetch('https://enterprise.tavrn.ai/v2/cases', 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://enterprise.tavrn.ai/v2/cases",
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([
'title' => 'Jane Doe v. ACME Corp',
'client_name' => 'Jane Doe',
'description' => '<string>',
'client_date_of_birth' => '2023-12-25',
'client_address' => '<string>',
'client_phone' => '<string>',
'client_email' => 'jsmith@example.com',
'date_of_injury' => '2023-12-25',
'deposition_date' => '2023-12-25',
'case_category' => 'personal_injury',
'status' => 'active',
'external_id' => '<string>',
'metadata' => [
'external_id' => 'case-123'
],
'owner_email' => 'jane.smith@example.com',
'interested_parties' => [
'john.doe@example.com'
]
]),
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://enterprise.tavrn.ai/v2/cases"
payload := strings.NewReader("{\n \"title\": \"Jane Doe v. ACME Corp\",\n \"client_name\": \"Jane Doe\",\n \"description\": \"<string>\",\n \"client_date_of_birth\": \"2023-12-25\",\n \"client_address\": \"<string>\",\n \"client_phone\": \"<string>\",\n \"client_email\": \"jsmith@example.com\",\n \"date_of_injury\": \"2023-12-25\",\n \"deposition_date\": \"2023-12-25\",\n \"case_category\": \"personal_injury\",\n \"status\": \"active\",\n \"external_id\": \"<string>\",\n \"metadata\": {\n \"external_id\": \"case-123\"\n },\n \"owner_email\": \"jane.smith@example.com\",\n \"interested_parties\": [\n \"john.doe@example.com\"\n ]\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://enterprise.tavrn.ai/v2/cases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Jane Doe v. ACME Corp\",\n \"client_name\": \"Jane Doe\",\n \"description\": \"<string>\",\n \"client_date_of_birth\": \"2023-12-25\",\n \"client_address\": \"<string>\",\n \"client_phone\": \"<string>\",\n \"client_email\": \"jsmith@example.com\",\n \"date_of_injury\": \"2023-12-25\",\n \"deposition_date\": \"2023-12-25\",\n \"case_category\": \"personal_injury\",\n \"status\": \"active\",\n \"external_id\": \"<string>\",\n \"metadata\": {\n \"external_id\": \"case-123\"\n },\n \"owner_email\": \"jane.smith@example.com\",\n \"interested_parties\": [\n \"john.doe@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://enterprise.tavrn.ai/v2/cases")
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 \"title\": \"Jane Doe v. ACME Corp\",\n \"client_name\": \"Jane Doe\",\n \"description\": \"<string>\",\n \"client_date_of_birth\": \"2023-12-25\",\n \"client_address\": \"<string>\",\n \"client_phone\": \"<string>\",\n \"client_email\": \"jsmith@example.com\",\n \"date_of_injury\": \"2023-12-25\",\n \"deposition_date\": \"2023-12-25\",\n \"case_category\": \"personal_injury\",\n \"status\": \"active\",\n \"external_id\": \"<string>\",\n \"metadata\": {\n \"external_id\": \"case-123\"\n },\n \"owner_email\": \"jane.smith@example.com\",\n \"interested_parties\": [\n \"john.doe@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "case_abc123",
"case_number": "EI-2025-0001",
"title": "Jane Doe v. ACME Corp",
"client_name": "Jane Doe",
"case_category": "personal_injury",
"status": "active",
"created_at": "2025-02-01T12:34:56Z",
"updated_at": "2025-02-01T12:34:56Z",
"metadata": {
"external_id": "case-123"
},
"owner_email": "jane.smith@example.com",
"interested_parties": [
"john.doe@example.com"
],
"description": "Rear-end MVA with cervical injury",
"client_date_of_birth": "1989-04-12",
"client_address": "123 Main St, Austin, TX 78701",
"client_phone": "+1-512-555-0101",
"client_email": "jane@example.com",
"date_of_injury": "2025-01-10",
"deposition_date": "2025-06-15",
"external_id": "expert-institute-12345"
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "validation_error",
"message": "The patient.date_of_birth field is required",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"param": "patient.date_of_birth",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#validation_error"
}
}{
"error": {
"code": "internal_error",
"message": "Internal server error",
"request_id": "req_0c1f1f1cd1c84e2f8d4b6a2e9f3b7a11",
"doc_url": "https://docs.tavrn.ai/guides/v2/errors#internal_error"
}
}Authorizations
API key authentication. Use format: Authorization: Bearer tavrn_sk_live_... Live keys (tavrn_sk_live_...) work only against https://enterprise.tavrn.ai; sandbox test keys (tavrn_sk_test_..., from https://sandbox.tavrn.ai) work only against https://sandbox.tavrn.ai.
Headers
Optional opaque key (1-255 characters, a UUID v4 is recommended) that makes a POST safe to retry. Scoped to your organization and kept for 24 hours. A retry with the same key and the same body replays the original status and body with Idempotent-Replayed: true; the same key with a different body returns 422 idempotency_key_reused_with_different_payload; a retry while the first attempt is still running returns 409 idempotency_key_in_use. Only 2xx and 4xx outcomes are stored - a 5xx releases the key so the retry executes again. See the Idempotent requests guide.
1 - 255Body
Users to add as interested parties, by email. Each gets access to the case and its notifications. Every email must match a user in your organization, otherwise 400 validation_error. The owner's email is ignored.
50255["john.doe@example.com"]
Response
Case created successfully