{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"List recent messages within Email Logs, or search for messages using a filter.\n","properties":{"body":{"$ref":"#/definitions/EmailLogsGetMessagesByFilterRequest"}},"required":["body"],"additionalProperties":false,"definitions":{"EmailLogsGetMessagesByFilterRequest":{"type":"object","properties":{"query":{"type":"string","description":"**Allowed event fields and operators**\n\n- sg_message_id: `=`\n- subject: `=`\n- to_email: `=`\n- status: `IN`\n- reason: `=`\n- categories: `IN`\n- sg_message_id_created_at: `>`, `<`, `>=`, `<=`\n\n**Notes:**\n\n- multiple conditions (up to 160) can be combined with `AND`\n- nesting is not allowed\n- `IN` operator accepts a list of string values: `field IN ('value1', 'value2')`\n","examples":["sg_message_id_created_at > TIMESTAMP \"2025-01-01T00:00:00Z\" AND sg_message_id_created_at < TIMESTAMP \"2025-02-01T00:00:00Z\" AND status IN ('delivered', 'processed') AND categories IN ('newsletter', 'marketing')"]},"limit":{"type":"integer","description":"Number of messages to return (1–1000).","minimum":1,"maximum":1000,"default":10},"subusers":{"description":"For requests authenticated as the parent account,\nthis argument must be passed if the desired messages belong to a subuser.\nYou can only call this endpoint for 1 subuser at a time.\n","type":"array","items":{"type":"string"},"maxItems":1,"examples":[["20223230"]]}}}}},"name":"Search all messages using the provided query filters.","id":"sendgrid.logs.listmessagesbyfilter","example":{"body":{}},"maxRequests":1,"summary":false}}