Skip to main content
POST
/
traces
Ingest OTLP traces
curl --request POST \
  --url https://api.coval.dev/v1/traces \
  --header 'Content-Type: application/x-protobuf' \
  --header 'X-API-Key: <api-key>' \
  --data '"<string>"'
import requests

url = "https://api.coval.dev/v1/traces"

payload = "<string>"
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/x-protobuf"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/x-protobuf'},
body: JSON.stringify('<string>')
};

fetch('https://api.coval.dev/v1/traces', 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.coval.dev/v1/traces",
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('<string>'),
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-protobuf",
"X-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://api.coval.dev/v1/traces"

payload := strings.NewReader("\"<string>\"")

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

req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/x-protobuf")

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.coval.dev/v1/traces")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/x-protobuf")
.body("\"<string>\"")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.coval.dev/v1/traces")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/x-protobuf'
request.body = "\"<string>\""

response = http.request(request)
puts response.read_body
{
  "status": "ok",
  "simulation_output_id": "a1b2c3d4"
}
{
"error": {
"code": "INVALID_ARGUMENT",
"message": "Missing required header: X-Simulation-Id or X-Conversation-Id",
"details": [
{
"field": "X-Simulation-Id",
"description": "Provide either X-Simulation-Id or X-Conversation-Id"
}
]
}
}
{
"error": {
"code": "UNAUTHENTICATED",
"message": "Authentication failed",
"details": [
{
"field": "X-API-Key",
"description": "Invalid or missing API key"
}
]
}
}
{
"error": {
"code": "PERMISSION_DENIED",
"message": "Insufficient permissions",
"details": [
{
"field": "permissions",
"description": "API key lacks the traces:write scope"
}
]
}
}
{
"error": {
"code": "NOT_FOUND",
"message": "Simulation output not found",
"details": [
{
"field": "X-Simulation-Id",
"description": "No simulation output found with this ID"
}
]
}
}
{
"error": {
"code": "INTERNAL",
"message": "Internal server error",
"details": [
{
"description": "An unexpected error occurred while processing the request"
}
]
}
}
{
"error": {
"code": "INTERNAL",
"message": "Service temporarily unavailable",
"details": [
{
"description": "Database routing is temporarily unavailable. Please retry."
}
]
}
}

Authorizations

X-API-Key
string
header
required

Organization API key for authentication

Headers

X-Simulation-Id
string

Simulation output ID to associate the spans with. Use for simulation-based flows. Mutually exclusive with X-Conversation-Id.

X-Conversation-Id
string

Conversation (Run) ID returned by POST /v1/conversations:submit. Use for monitoring flows. Mutually exclusive with X-Simulation-Id.

Body

OTLP ExportTraceServiceRequest payload — protobuf or JSON.

OTLP/HTTP protobuf-encoded ExportTraceServiceRequest. This is the default content type emitted by the OpenTelemetry HTTP exporter (opentelemetry-exporter-otlp-proto-http).

Response

Spans accepted and queued for ingestion.

status
string
required

Always ok on success.

Example:

"ok"

simulation_output_id
string
required

The simulation output ID the spans were associated with. For monitoring flows submitted via X-Conversation-Id, this equals the conversation ID.

Example:

"a1b2c3d4"