> For the complete documentation index, see [llms.txt](https://docs.mailtrap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mailtrap.io/developers/email-sending/email-logs/get-an-email-log-message-by-id.md).

# Get an email log message by ID

Returns a single message by message UUID. Message must belong to the account and a domain the token can access.

```json
{"openapi":"3.1.0","info":{"title":"Email Sending","version":"2.0.0"},"tags":[{"name":"email-logs","description":"List and retrieve email sending logs for the account."}],"servers":[{"description":"Mailtrap account API (`mailtrap.io`) for domains, suppressions, tracking opt-outs, stats, and email logs.\nError JSON matches other account endpoints (`error` or string `errors`), not the `send.api` / `bulk.api` sending shape (`success` + `errors` array).\n","url":"https://mailtrap.io"}],"security":[{"HeaderAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"HeaderAuth":{"type":"apiKey","description":"API token in Api-Token header","in":"header","name":"Api-Token"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token authentication"}},"parameters":{"sending_message_id":{"name":"sending_message_id","in":"path","required":true,"description":"Message UUID","schema":{"type":"string","format":"uuid"}}},"schemas":{"SendingMessage":{"type":"object","properties":{"message_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["delivered","not_delivered","enqueued","opted_out"]},"subject":{"type":"string","nullable":true},"rfc_message_id":{"type":"string","nullable":true,"description":"Value of the RFC 5322 `Message-ID` header."},"in_reply_to":{"type":"string","nullable":true,"description":"Value of the RFC 5322 `In-Reply-To` header."},"references":{"type":"array","items":{"type":"string"},"description":"Values of the RFC 5322 `References` header."},"thread_id":{"type":"string","nullable":true,"description":"ID of the inbound thread this message belongs to, or null if the\nmessage is not part of one. Use it with the Inbound Threads\nendpoints to fetch the full conversation.\n"},"from":{"type":"string"},"to":{"type":"string"},"sent_at":{"type":"string","format":"date-time"},"client_ip":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"custom_variables":{"type":"object"},"sending_stream":{"type":"string","enum":["transactional","bulk"]},"domain_id":{"type":"integer"},"template_id":{"type":"integer","nullable":true},"template_variables":{"type":"object"},"opens_count":{"type":"integer"},"clicks_count":{"type":"integer"},"raw_message_url":{"type":"string","format":"uri","description":"Signed URL to download raw .eml message (temporary)."},"events":{"type":"array","items":{"$ref":"#/components/schemas/MessageEvent"}}}},"MessageEvent":{"description":"Event with type-specific details. Use event_type to determine which details schema applies.","discriminator":{"propertyName":"event_type","mapping":{"delivery":"#/components/schemas/MessageEventDelivery","open":"#/components/schemas/MessageEventOpen","click":"#/components/schemas/MessageEventClick","soft_bounce":"#/components/schemas/MessageEventBounce","bounce":"#/components/schemas/MessageEventBounce","spam":"#/components/schemas/MessageEventSpam","unsubscribe":"#/components/schemas/MessageEventUnsubscribe","suspension":"#/components/schemas/MessageEventReject","reject":"#/components/schemas/MessageEventReject"}},"oneOf":[{"$ref":"#/components/schemas/MessageEventDelivery"},{"$ref":"#/components/schemas/MessageEventOpen"},{"$ref":"#/components/schemas/MessageEventClick"},{"$ref":"#/components/schemas/MessageEventBounce"},{"$ref":"#/components/schemas/MessageEventSpam"},{"$ref":"#/components/schemas/MessageEventUnsubscribe"},{"$ref":"#/components/schemas/MessageEventReject"}]},"MessageEventDelivery":{"type":"object","required":["event_type","created_at","details"],"properties":{"event_type":{"type":"string","enum":["delivery"]},"created_at":{"type":"string","format":"date-time"},"details":{"$ref":"#/components/schemas/EventDetailsDelivery"}}},"EventDetailsDelivery":{"type":"object","description":"For event_type = delivery","additionalProperties":false,"properties":{"sending_ip":{"type":"string","nullable":true},"recipient_mx":{"type":"string","nullable":true},"email_service_provider":{"type":"string","nullable":true}}},"MessageEventOpen":{"type":"object","required":["event_type","created_at","details"],"properties":{"event_type":{"type":"string","enum":["open"]},"created_at":{"type":"string","format":"date-time"},"details":{"$ref":"#/components/schemas/EventDetailsOpen"}}},"EventDetailsOpen":{"type":"object","description":"For event_type = open","additionalProperties":false,"properties":{"web_ip_address":{"type":"string","nullable":true}}},"MessageEventClick":{"type":"object","required":["event_type","created_at","details"],"properties":{"event_type":{"type":"string","enum":["click"]},"created_at":{"type":"string","format":"date-time"},"details":{"$ref":"#/components/schemas/EventDetailsClick"}}},"EventDetailsClick":{"type":"object","description":"For event_type = click","additionalProperties":false,"properties":{"click_url":{"type":"string","nullable":true},"web_ip_address":{"type":"string","nullable":true}}},"MessageEventBounce":{"type":"object","required":["event_type","created_at","details"],"properties":{"event_type":{"type":"string","enum":["soft_bounce","bounce"]},"created_at":{"type":"string","format":"date-time"},"details":{"$ref":"#/components/schemas/EventDetailsBounce"}}},"EventDetailsBounce":{"type":"object","description":"For event_type = soft_bounce or bounce","additionalProperties":false,"properties":{"sending_ip":{"type":"string","nullable":true},"recipient_mx":{"type":"string","nullable":true},"email_service_provider":{"type":"string","nullable":true},"email_service_provider_status":{"type":"string","nullable":true},"email_service_provider_response":{"type":"string","nullable":true},"bounce_category":{"type":"string","nullable":true}}},"MessageEventSpam":{"type":"object","required":["event_type","created_at","details"],"properties":{"event_type":{"type":"string","enum":["spam"]},"created_at":{"type":"string","format":"date-time"},"details":{"$ref":"#/components/schemas/EventDetailsSpam"}}},"EventDetailsSpam":{"type":"object","description":"For event_type = spam","additionalProperties":false,"properties":{"spam_feedback_type":{"type":"string","nullable":true}}},"MessageEventUnsubscribe":{"type":"object","required":["event_type","created_at","details"],"properties":{"event_type":{"type":"string","enum":["unsubscribe"]},"created_at":{"type":"string","format":"date-time"},"details":{"$ref":"#/components/schemas/EventDetailsUnsubscribe"}}},"EventDetailsUnsubscribe":{"type":"object","description":"For event_type = unsubscribe","additionalProperties":false,"properties":{"web_ip_address":{"type":"string","nullable":true}}},"MessageEventReject":{"type":"object","required":["event_type","created_at","details"],"properties":{"event_type":{"type":"string","enum":["suspension","reject"]},"created_at":{"type":"string","format":"date-time"},"details":{"$ref":"#/components/schemas/EventDetailsReject"}}},"EventDetailsReject":{"type":"object","description":"For event_type = suspension or reject","additionalProperties":false,"properties":{"reject_reason":{"type":"string","nullable":true}}},"UnauthenticatedResponse":{"title":"UnauthenticatedResponse","type":"object","properties":{"error":{"type":"string","description":"Error message"}}},"NotFoundResponse":{"title":"NotFoundResponse","type":"object","properties":{"error":{"type":"string","description":"Error message"}}},"RateLimitExceededResponse":{"title":"RateLimitExceededResponse","type":"object","properties":{"errors":{"type":"string","description":"Error message"}}}},"responses":{"Unauthorized":{"description":"Returns unauthorized error message. Check your credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnauthenticatedResponse"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}},"LIMIT_EXCEEDED":{"description":"Rate limit exceeded for the current account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitExceededResponse"}}}}}},"paths":{"/api/email_logs/{sending_message_id}":{"get":{"operationId":"getEmailLogMessage","summary":"Get an email log message by ID","description":"Returns a single message by message UUID. Message must belong to the account and a domain the token can access.","tags":["email-logs"],"parameters":[{"$ref":"#/components/parameters/sending_message_id"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendingMessage"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/LIMIT_EXCEEDED"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mailtrap.io/developers/email-sending/email-logs/get-an-email-log-message-by-id.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
