API Reference - Email Auto Logs
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108096
← Back to API Reference | Getting Started
Email Auto Logs
Email Auto Logs record delivery events for emails sent through the automated email system. Each log entry captures a single event (such as delivered, opened, or clicked) for a specific automated email send, and is linked to a record in the Email Auto Sent table.
Model name in URL:
email_auto_log — DB table: email_auto_logThe Email Auto Log Object
| Field | Type | Description |
|---|---|---|
log_id | integer | Unique log entry ID (primary key, read-only) |
database | string | Name of the related database table (typically email_auto_sent) |
database_id | integer | ID of the related record in the database table (links to sent_id in email_auto_sent) |
email | string | Email address of the recipient |
event | string | Delivery event type (EG delivered, open, click, processed, spamreport, bounce) |
response | string | SMTP or provider response message for the event |
date | string | Date and time the event was recorded (format: YYYYMMDDHHmmss) |
smtp_id | string | Unique message ID assigned by the SMTP provider (EG SendGrid message ID) |
List Email Auto Log Entries
GET /api/v2/email_auto_log/get
Example Request
Copy
curl -X GET "https://www.yourdomain.com/api/v2/email_auto_log/get?limit=25" \ -H "X-Api-Key: your-api-key-here"
Example Response
Copy
{
"status": "success",
"message": [
{
"log_id": "37",
"database": "email_auto_sent",
"database_id": "1",
"email": "recipient@example.com",
"event": "delivered",
"response": "250 2.0.0 OK 1690321987 y8-20020abc123si456789qtx.769 - gsmtp",
"date": "20230725145307",
"smtp_id": "b7TZFvWUTZKqTnSxttx0yA@geopod-ismtpd-41"
},
{
"log_id": "38",
"database": "email_auto_sent",
"database_id": "1",
"email": "recipient@example.com",
"event": "processed",
"response": "",
"date": "20230725145306",
"smtp_id": "b7TZFvWUTZKqTnSxttx0yA@geopod-ismtpd-41"
}
],
"total": "12",
"current_page": 1,
"total_pages": 1,
"next_page": ""
}Retrieve an Email Auto Log Entry
GET /api/v2/email_auto_log/get/{log_id}
Example Request
Copy
curl -X GET "https://www.yourdomain.com/api/v2/email_auto_log/get/37" \ -H "X-Api-Key: your-api-key-here"
Example Response
Copy
{
"status": "success",
"message": [
{
"log_id": "37",
"database": "email_auto_sent",
"database_id": "1",
"email": "recipient@example.com",
"event": "delivered",
"response": "250 2.0.0 OK 1690321987 y8-20020abc123si456789qtx.769 - gsmtp",
"date": "20230725145307",
"smtp_id": "b7TZFvWUTZKqTnSxttx0yA@geopod-ismtpd-41"
}
],
"total": "12",
"current_page": 1,
"total_pages": 1
}Create an Email Auto Log Entry
POST /api/v2/email_auto_log/create
Example Request
Copy
curl -X POST "https://www.yourdomain.com/api/v2/email_auto_log/create" \ -H "X-Api-Key: your-api-key-here" \ -d "database=email_auto_sent" \ -d "database_id=5" \ -d "email=recipient%40example.com" \ -d "event=delivered" \ -d "response=250+OK" \ -d "date=20240401120000" \ -d "smtp_id=abc123xyz%40geopod-ismtpd-1"
Example Response
Copy
{
"status": "success",
"message": {
"log_id": "13",
"database": "email_auto_sent",
"database_id": "5",
"email": "recipient@example.com",
"event": "delivered",
"response": "250 OK",
"date": "20240401120000",
"smtp_id": "abc123xyz@geopod-ismtpd-1"
}
}Update an Email Auto Log Entry
PUT /api/v2/email_auto_log/update
Example Request
Copy
curl -X PUT "https://www.yourdomain.com/api/v2/email_auto_log/update" \ -H "X-Api-Key: your-api-key-here" \ -d "log_id=13" \ -d "event=open" \ -d "response="
Example Response
Copy
{
"status": "success",
"message": {
"log_id": "13",
"database": "email_auto_sent",
"database_id": "5",
"email": "recipient@example.com",
"event": "open",
"response": "",
"date": "20240401120000",
"smtp_id": "abc123xyz@geopod-ismtpd-1"
}
}Delete an Email Auto Log Entry
DELETE /api/v2/email_auto_log/delete
Example Request
Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/email_auto_log/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "log_id=13"
Example Response
Copy
{
"status": "success",
"message": "email_auto_log record was deleted"
}