API Reference
HTTP Ingest API
Send events directly to the ingest endpoint without an SDK. Any HTTP client works — PHP, Python, Ruby, Go, cURL.
Endpoint
http
POST https://<your-ingest-host>/v1/events
Content-Type: application/json
X-Veriq-Key: pk_...
Authentication
Pass your project's public key in the X-Veriq-Key header. Keys start with pk_ and are found in Project Settings → API Keys.
Event schema
json
{
"events": [
{
"type": "error",
"timestamp": "2024-01-01T12:00:00.000Z",
"release": "1.0.0",
"environment": "production",
"exception": {
"type": "RuntimeException",
"value": "Something went wrong",
"stacktrace": {
"frames": [
{
"filename": "src/handler.php",
"lineno": 42,
"function": "handleRequest",
"in_app": true
}
]
}
}
}
]
}
| Field | Type | Required | Description |
|---|
| type | string | ✓ | "error" or "perf" |
| timestamp | ISO 8601 | ✓ | When the event occurred |
| release | string | — | App version, e.g. "1.2.0" |
| environment | string | — | "production", "staging", etc. |
| exception.type | string | ✓ for errors | Exception class name |
| exception.value | string | ✓ for errors | Error message |
| exception.stacktrace.frames | array | — | Stack frames, innermost last |
cURL
bash
curl -X POST https://<ingest-host>/v1/events \
-H "Content-Type: application/json" \
-H "X-Veriq-Key: pk_..." \
-d '{
"events": [{
"type": "error",
"timestamp": "2024-01-01T12:00:00.000Z",
"environment": "production",
"exception": {
"type": "Error",
"value": "Test error from cURL"
}
}]
}'
PHP
php
<?php
function captureException(Throwable $e, string $dsn): void {
$payload = [
'events' => [[
'type' => 'error',
'timestamp' => gmdate('Y-m-d\TH:i:s.v\Z'),
'environment' => getenv('APP_ENV') ?: 'production',
'exception' => [
'type' => get_class($e),
'value' => $e->getMessage(),
'stacktrace' => [
'frames' => array_map(fn($f) => [
'filename' => $f['file'] ?? '(unknown)',
'lineno' => $f['line'] ?? 0,
'function' => $f['function'] ?? '',
'in_app' => true,
], $e->getTrace()),
],
],
]],
];
$ch = curl_init('https://<ingest-host>/v1/events');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
"X-Veriq-Key: {$dsn}",
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 3,
]);
curl_exec($ch);
curl_close($ch);
}
set_exception_handler(fn(Throwable $e) => captureException($e, 'pk_...'));
Python
python
import json, urllib.request, traceback
from datetime import datetime, timezone
INGEST_URL = "https://<ingest-host>/v1/events"
VERIQ_KEY = "pk_..."
def capture_exception(exc: BaseException) -> None:
tb = traceback.extract_tb(exc.__traceback__)
frames = [{"filename": f.filename, "lineno": f.lineno, "function": f.name, "in_app": True} for f in tb]
payload = {"events": [{"type": "error", "timestamp": datetime.now(timezone.utc).isoformat(), "environment": "production", "exception": {"type": type(exc).__name__, "value": str(exc), "stacktrace": {"frames": frames}}}]}
body = json.dumps(payload).encode()
req = urllib.request.Request(INGEST_URL, data=body, headers={"Content-Type": "application/json", "X-Veriq-Key": VERIQ_KEY}, method="POST")
try:
urllib.request.urlopen(req, timeout=3)
except Exception:
pass
import sys
sys.excepthook = lambda t, v, tb: capture_exception(v)