Logs
GET https://api.echovalue.dev/token/logs
Returns a list of recent API calls made with your token. Logs have a TTL of 7 days and are deleted within 24 hours after expiration.
Request
Section titled “Request”Request headers:
| Header | Description |
|---|---|
x-token | Your API token |
Query parameters:
| Parameter | Type | Description | Default |
|---|---|---|---|
n | integer | Number of log entries to retrieve. Min: 1. Default: 5. | 5 |
type | string | Optional endpoint filter. Common values include kv, token, settings, webhook, webhook-delivery, url-to-metadata, myip, service, and manage. | — |
Supported type filters are implementation-driven. Common values are:
| Type | Description |
|---|---|
kv | Key-value operations |
token | Wallet info requests |
settings | Low-balance settings reads and updates |
webhook | Webhook management audit logs |
webhook-delivery | Webhook delivery and test logs, including scheduled deliveries |
url-to-metadata | URL metadata and scraping requests |
myip | Caller IP lookup requests |
service | Recharge operations |
manage | Management operations |
For webhook-delivery logs, path is the webhookId.
Response
Section titled “Response”200 OK — JSON object.
{ "logs": [ { "id": "jd9kImh8U4In3odfNeKf", "method": "GET", "path": "/kv/default/mykey", "endpoint": "kv", "status_code": 200, "response_time_ms": 513, "error": "Key Not Found", "timestamp": "2023-12-07T12:14:16.124481Z", "expiration": "2023-12-14T12:14:16.12448Z", "cost": 1, "balance": 97 } ], "n": 1}| Field | Type | Description |
|---|---|---|
n | integer | Number of entries actually returned |
logs | array | Array of log entries |
Log entry fields:
| Field | Type | Description |
|---|---|---|
id | string | Unique log entry ID |
method | string | HTTP method used (GET, POST, DELETE) |
path | string | Full request path including query parameters. For webhook-delivery logs, this is the webhookId. |
endpoint | string | API category such as kv, token, settings, webhook, webhook-delivery, url-to-metadata, myip, service, or manage |
status_code | integer | HTTP status code returned by the request |
response_time_ms | integer | Response time in milliseconds for the request |
error | string | Error message, if any (omitted on success) |
timestamp | string (ISO 8601) | When the request was made |
expiration | string (ISO 8601) | When this log entry expires (7 days after creation) |
cost | integer | Credits deducted for that request |
balance | integer | Wallet balance after that request |
Status Codes
Section titled “Status Codes”| Status | Meaning |
|---|---|
200 | Logs returned |
401 | Invalid token |
Response headers:
| Header | Description |
|---|---|
x-cost | Declared in the current OpenAPI file. For this free endpoint, treat it as informational only. |
Examples
Section titled “Examples”# Get all logs (default 5)curl 'https://api.echovalue.dev/token/logs?n=5' \ -H 'x-token: mytoken'
# Get only webhook deliveries and testscurl 'https://api.echovalue.dev/token/logs?type=webhook-delivery' \ -H 'x-token: mytoken'// Get all logsfetch('https://api.echovalue.dev/token/logs?n=5', { headers: { 'x-token': 'mytoken' }}).then(response => response.json()).then(data => { console.log(`Returned ${data.n} logs`); (data.logs || []).forEach(l => { console.log(`${l.timestamp} ${l.method} ${l.endpoint || l.path} status=${l.status_code} time=${l.response_time_ms}ms cost=${l.cost} balance=${l.balance} id=${l.id}`); });});
// Get only webhook delivery logsfetch('https://api.echovalue.dev/token/logs?type=webhook-delivery', { headers: { 'x-token': 'mytoken' }}).then(response => response.json()).then(data => { console.log(`Returned ${data.n} webhook delivery logs`);});import requests
# Get all logsresponse = requests.get('https://api.echovalue.dev/token/logs', headers={'x-token': 'mytoken'}, params={'n': 5})data = response.json()print(f"Returned {data.get('n')} logs")for l in data.get('logs', []): print(f"{l.get('timestamp')} {l.get('method')} {l.get('endpoint') or l.get('path')} status={l.get('status_code')} time={l.get('response_time_ms')}ms cost={l.get('cost')} balance={l.get('balance')} id={l.get('id')}")
# Get only webhook delivery logsresponse = requests.get('https://api.echovalue.dev/token/logs', headers={'x-token': 'mytoken'}, params={'type': 'webhook-delivery'})<?php// Get all logs$ch = curl_init('https://api.echovalue.dev/token/logs?n=5');curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-token: mytoken']);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);$response = curl_exec($ch);curl_close($ch);$data = json_decode($response, true);echo "Returned {$data['n']} logs\n";foreach ($data['logs'] as $l) { echo "{$l['timestamp']} {$l['method']} " . ($l['endpoint'] ?? $l['path']) . " status={$l['status_code']} time={$l['response_time_ms']}ms cost={$l['cost']} balance={$l['balance']} id={$l['id']}\n";}
// Get only webhook delivery logs$ch = curl_init('https://api.echovalue.dev/token/logs?type=webhook-delivery');curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-token: mytoken']);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);$response = curl_exec($ch);curl_close($ch);?>package main
import ( "encoding/json" "fmt" "io" "net/http")
func main() { // Get all logs req, _ := http.NewRequest("GET", "https://api.echovalue.dev/token/logs?n=5", nil) req.Header.Set("x-token", "mytoken")
client := &http.Client{} resp, _ := client.Do(req) defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body) var result map[string]interface{} json.Unmarshal(body, &result)
if logs, ok := result["logs"].([]interface{}); ok { fmt.Printf("Returned %v logs\n", result["n"]) for _, li := range logs { l := li.(map[string]interface{}) fmt.Printf("%v %v %v status=%v time=%vms cost=%v balance=%v id=%v\n", l["timestamp"], l["method"], l["endpoint"], l["status_code"], l["response_time_ms"], l["cost"], l["balance"], l["id"]) } }
// Get only webhook delivery logs req2, _ := http.NewRequest("GET", "https://api.echovalue.dev/token/logs?type=webhook-delivery", nil) req2.Header.Set("x-token", "mytoken") resp2, _ := client.Do(req2) defer resp2.Body.Close()}- Logs can appear with a delay of a few seconds after the original request.
- Entries expire after 7 days and are deleted within 24 hours after expiration.