@extends('admin.layouts.app') @section('title', 'API Exchange #' . $exchange->id) @section('page_title', 'API Exchange Inspector') @push('styles') @endpush @section('content') @include('admin.automation._nav') @php $requestJson = json_encode($requestPayload ?? $exchange->request_payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $responseJson = json_encode($exchange->response_payload, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $requestHeadersJson = json_encode($exchange->request_headers_safe, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $responseHeadersJson = json_encode($exchange->response_headers_safe, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); $httpStatus = (int) ($exchange->http_status ?? 0); $statusClass = $httpStatus === 0 ? 'neutral' : ($httpStatus < 300 ? 'ok' : ($httpStatus < 400 ? 'warn' : 'error')); $endpointLabel = \Illuminate\Support\Str::of($exchange->endpoint_key ?: $exchange->integration)->replace(['api.v1.ai.','n8n.'], '')->replace(['.','_'], ' ')->headline(); $endpointUrl = $exchange->endpoint_path; if ($exchange->direction === 'outbound' && $exchange->integration === 'n8n' && $endpointUrl && ! \Illuminate\Support\Str::startsWith($endpointUrl, ['http://', 'https://'])) { $endpointUrl = rtrim((string) config('services.n8n.base_url'), '/').'/'.ltrim($endpointUrl, '/'); } @endphp
← Back to traffic
{{ ucfirst($exchange->direction) }} {{ ucfirst($exchange->transport ?: 'API') }} exchange #{{ $exchange->id }}

{{ $exchange->http_method ?: 'CALL' }} · {{ $endpointLabel }}

{{ $endpointUrl ?: $exchange->endpoint_key }} · Recorded {{ optional($exchange->occurred_at)->format('d M Y, H:i:s') ?: 'without a timestamp' }}

HTTP {{ $exchange->http_status ?: 'N/A' }} · {{ \Illuminate\Support\Str::of($exchange->outcome ?: 'unknown')->replace('_',' ')->headline() }}
@if($exchange->error_code || $exchange->error_message)
!
{{ $exchange->error_code ?: 'Exchange error' }}

{{ $exchange->error_message ?: 'The exchange returned an error response.' }}

@endif
Direction{{ $exchange->direction === 'inbound' ? 'n8n → Numu' : 'Numu → n8n' }}
Latency{{ $exchange->latency_ms === null ? 'Not recorded' : $exchange->latency_ms.' ms' }}
Correlation ID{{ $exchange->correlation_id ?: 'Not set' }}
Idempotency key{{ $exchange->idempotency_key ?: 'Not set' }}
→

Request payload

{{ $requestPayloadCaption ?? 'Persisted after sensitive-value redaction' }}
@if($requestJson !== false && $requestJson !== 'null')@endif
@if($requestJson !== false && $requestJson !== 'null')
{{ $requestJson }}
@else
No request body was recorded for this exchange.
@endif
Safe request headers
{{ $requestHeadersJson !== false && $requestHeadersJson !== 'null' ? $requestHeadersJson : '{}' }}
←

Response payload

Exact persisted API response after redaction
@if($responseJson !== false && $responseJson !== 'null')@endif
@if($responseJson !== false && $responseJson !== 'null')
{{ $responseJson }}
@else
No response body was recorded for this exchange.
@endif
Safe response headers
{{ $responseHeadersJson !== false && $responseHeadersJson !== 'null' ? $responseHeadersJson : '{}' }}

Linked context

Records associated with this exchange
Startup@if($exchange->startup){{ $exchange->startup->name }}@elseNot linked@endif
Agent@if($exchange->agent){{ $exchange->agent->agent_code ?: $exchange->agent->name }}@elseNot linked@endif
Agent run@if($exchange->agentRun)Run #{{ $exchange->agentRun->id }}@elseNot linked@endif
Request ID{{ $exchange->request_id ?: 'Not set' }}
Integration{{ $exchange->integration }} / {{ $exchange->transport }}
Endpoint key{{ $exchange->endpoint_key ?: 'Not set' }}
Request URL{{ $endpointUrl ?: 'Not recorded' }}
@if($attempt)
Outbound delivery attempt#{{ $attempt->attempt_number }} · {{ ucfirst($attempt->status) }} · HTTP {{ $attempt->http_status ?: 'N/A' }} · {{ $attempt->latency_ms === null ? 'No timing' : $attempt->latency_ms.' ms' }}@if($attempt->failure_reason)
{{ $attempt->failure_reason }}
@endif
@endif

Related Application activity

Latest events for the same Application
@if($activity->isEmpty())

No Application activity is linked to this exchange.

@else
    @foreach($activity as $entry)
  • {{ $entry->action }} · {{ $entry->description }}
  • @endforeach
@endif
Copied to clipboard
@endsection @push('scripts') @endpush