Skip to content

Stream logs for authenticated user domain in real-time

GET
/api/domains/{domain}/log/stream
curl --request GET \
--url 'https://smtp-app.kirim.email/api/domains/example.com/log/stream?start=2023-01-01T00%3A00%3A00Z&end=2023-12-31T23%3A59%3A59Z&sender=sender%40example.com&recipient=recipient%40example.com&subject=Welcome&event_type=delivered&tags=newsletter&limit=50000' \
--header 'Authorization: Basic <credentials>'

Stream email logs in real-time using Server-Sent Events for a domain owned by the authenticated user

domain
required
string
Example
example.com

Domain name that must be owned by the authenticated user. The domain must be verified and properly configured for email sending.

start
string format: date-time
Example
2023-01-01T00:00:00Z

Filter logs by start date (ISO8601)

end
string format: date-time
Example
2023-12-31T23:59:59Z

Filter logs by end date (ISO8601)

sender
string

Filter logs by sender email

recipient
string

Filter logs by recipient email

subject
string
Example
Welcome

Filter logs by subject (partial match)

event_type
string
Example
delivered

Filter logs by event type (queued, delivered, bounced, failed, opened, clicked, unsubscribed, temporary_fail, permanent_fail, deferred)

tags
string
Example
newsletter

Filter logs by tags (partial match)

limit
integer
default: 50000 >= 1 <= 500000

Maximum number of logs to stream

Server-Sent Events stream

Media typetext/event-stream

SSE stream with log data batches and completion events

string
X-RateLimit-Limit
integer

Maximum requests per minute

X-RateLimit-Remaining
integer

Remaining requests in current window

Bad Request - User authentication missing

Media typeapplication/json
object
error
string
Example
{
"error": "User authentication missing"
}

Unauthorized - Invalid or missing authentication

Media typeapplication/json
object
error
string
Example
{
"error": "Unauthorized"
}

Not Found - Domain or log not found

Media typeapplication/json
object
error
string
Example
{
"error": "Domain not found or you do not own this domain"
}

Too Many Requests - Rate limit exceeded. Retry after the specified time.

Media typeapplication/json
object
success
boolean
message
string
Example
{
"success": false,
"message": "Too many attempts. Please try again later."
}
Retry-After
integer

Seconds until rate limit resets

X-RateLimit-Limit
integer

Maximum requests per minute

X-RateLimit-Remaining
integer

Remaining requests in current window

Server Error - Unexpected error occurred

Media typeapplication/json
object
error
string
Example
{
"error": "Unknown error"
}