endpointStatus() β Endpoint-Level Metrics
Get detailed metrics for a specific API endpoint. Use this when you need granular data about a particular endpoint's performance.
Related: Everything was green β wrong level of detail β when provider status and your pain do not match.
Usage
// Laravel
use OutboundIQ\Laravel\Facades\OutboundIQ;
$status = OutboundIQ::endpointStatus('stripe-post-v1-charges');
// PHP
$status = $client->endpointStatus('stripe-post-v1-charges');
// Node.js / JavaScript
const status = await outboundiq.endpointStatus('stripe-post-v1-charges');Endpoint slugs are auto-generated from the provider + HTTP method + path. You can find them in your OutboundIQ dashboard under the Endpoints section.
Response Structure
{
"meta": {
"version": "1.0",
"generated_at": "2024-01-08T10:30:00Z"
},
"decision": {
"usable": true,
"action": "proceed",
"reason": "Provider is operational with 99.9% success rate"
},
"endpoint": {
"slug": "stripe-post-v1-charges",
"url_pattern": "/v1/charges",
"http_method": "POST",
"full_url": "https://api.stripe.com/v1/charges"
},
"provider": {
"name": "Stripe",
"slug": "stripe"
},
"status": {
"current": "operational",
"indicator": "green",
"last_checked_at": "2024-01-08T10:25:00Z"
},
"metrics": {
"success_rate": 99.9,
"error_rate": 0.1,
"avg_latency_ms": 245,
"total_requests_7d": 4523,
"schema_stability": 100.0,
"latency_trend": [
{ "time": "2024-01-08T10:00:00Z", "latency_ms": 242 },
{ "time": "2024-01-08T09:00:00Z", "latency_ms": 238 },
{ "time": "2024-01-08T08:00:00Z", "latency_ms": 251 }
]
},
"incidents": {
"active_count": 0,
"has_active": false,
"items": []
},
"components": {
"degraded_count": 0,
"items": []
}
}Key Fields Explained
metrics.schema_stabilityPercentage indicating how stable the response schema has been. 100% means no changes detected. Below 95% suggests recent schema changes.
metrics.latency_trendLast 5 hourly latency data points. Use this to detect if latency is increasing over time.
incidents.has_activeQuick boolean check for active incidents without iterating the items array.
Example: Dynamic Timeout
Metrics live under $status['metrics'] (see response shape above). There is no per-endpoint p95 field in the API; use avg_latency_ms or latency_trend if you need a heuristic.
use OutboundIQ\Laravel\Facades\OutboundIQ;
use Illuminate\Support\Facades\Http;
public function createCharge(array $data)
{
$status = OutboundIQ::endpointStatus('stripe-post-v1-charges');
$timeout = 5;
if ($status && isset($status['metrics']['avg_latency_ms']) && $status['metrics']['avg_latency_ms'] > 0) {
// e.g. 2Γ average latency, converted to whole seconds (minimum 1)
$timeout = max(1, (int) ceil($status['metrics']['avg_latency_ms'] * 2 / 1000));
}
if ($status && ($status['metrics']['schema_stability'] ?? 100) < 95) {
Log::warning('Schema instability detected on Stripe charges endpoint');
}
return Http::timeout($timeout)
->withToken(config('services.stripe.secret'))
->post('https://api.stripe.com/v1/charges', $data);
}