List courier messages
Query parameters
Number of messages per page (min: 1, max: 1000).
Token for the next page of results. Use the value from the
Link header in previous responses.Filter messages by delivery status:
queued: Message is waiting to be sentsent: Message was successfully deliveredprocessing: Message is currently being sentabandoned: Message delivery was abandoned after retries
Filter messages by recipient email address or phone number.
Response
Returns an array of message objects:Message UUID.
Message delivery channel:
email: Email messagephone: SMS message
Current delivery status:
queued, sent, processing, or abandoned.Email address or phone number of the recipient.
Email subject line (empty for SMS).
Message body content.
The template used for this message:
recovery_valid: Valid recovery email/SMSrecovery_invalid: Invalid recovery attempt notificationrecovery_code_valid: Recovery code messagerecovery_code_invalid: Invalid recovery code notificationverification_valid: Valid verification email/SMSverification_invalid: Invalid verification attemptverification_code_valid: Verification code messageverification_code_invalid: Invalid verification codelogin_code_valid: Login code messageregistration_code_valid: Registration code message
Number of delivery attempts made.
The delivery channel used.
Timestamp when the message was created (RFC3339 format).
Timestamp of the last status update.
Array of delivery attempts.
Example response
Error responses
- 400: Invalid query parameters
Get a courier message
Path parameters
The message UUID.
Response
Returns a single message object with the same structure as the list endpoint.Error responses
- 400: Invalid message ID format
- 404: Message not found
Understanding message statuses
Queued
The message is in the queue waiting to be processed and sent. Common reasons:- Message was just created
- Courier service is processing other messages
- Rate limiting is in effect
Processing
The message is currently being sent to the delivery provider. What happens:- Message is being transmitted to email/SMS gateway
- Waiting for delivery confirmation
Sent
The message was successfully delivered. Important notes:- For email: Accepted by recipient’s mail server (not necessarily delivered to inbox)
- For SMS: Accepted by SMS gateway (not necessarily delivered to device)
Abandoned
The message delivery was abandoned after multiple failed attempts. Common reasons:- Invalid recipient address
- Temporary delivery failures exceeded retry limit
- Email server rejection
- SMS gateway errors
Message templates
Kratos uses different templates for various message types:Recovery messages
recovery_valid: Valid recovery link/coderecovery_invalid: Notification of invalid recovery attemptrecovery_code_valid: Recovery code for code-based recoveryrecovery_code_invalid: Invalid code notification
Verification messages
verification_valid: Valid verification link/codeverification_invalid: Invalid verification attemptverification_code_valid: Verification codeverification_code_invalid: Invalid code notification
Authentication messages
login_code_valid: One-time login coderegistration_code_valid: Registration verification code
Best practices
Monitoring message delivery
Track delivery rates:- Monitor the ratio of sent vs abandoned messages
- Track send_count to identify retry patterns
- Review dispatch errors for abandoned messages
Debugging delivery issues
Check for specific recipient:- Check the
dispatchesarray for error details - Look for patterns in failed deliveries
- Verify recipient addresses are valid
Troubleshooting common issues
Messages stuck in queued:- Check courier service configuration
- Verify SMTP/SMS gateway credentials
- Review rate limiting settings
- Validate email addresses at registration
- Check sender reputation and SPF/DKIM records
- Review SMS gateway configuration
- Ensure recipient addresses are properly formatted
- Check spam folders (for email)
- Verify sender domain configuration
- Review message templates for compliance
- Check recipient’s provider restrictions
Configuration
Configure courier delivery in your Kratos configuration:Audit and compliance
Use courier message logs for:- Audit trails: Track what communications were sent to users
- Compliance: Prove notification delivery for regulatory requirements
- Debugging: Investigate user reports of missing emails
- Monitoring: Track system health and delivery rates
- Security: Detect unusual messaging patterns or abuse