Questions · Published 2026-10-21 · Updated 2026-10-21 · AgentiSend
How does an AI agent read a one-time code from email?
An AI agent reads a one-time code from email by receiving at your domain and listing the message. The code is text.
An AI agent reads a one-time code from email by receiving at your domain and listing the message. The code is text in the body. Do not forward the message.
Where the digits are
list_received_emails calls GET /emails/receiving. Set to to the address the code was sent to, and since to when the code was requested. GET /emails/receiving/{id} returns text and extracted_text. There is no separate code field. Read the digits from that text.
curl -sS -X GET https://api.agentisend.com/emails/receiving \
-H "Authorization: Bearer $AGENTISEND_API_KEY"200
{
"data": [],
"has_more": false,
"next_cursor": "example",
"object": "list"
}POST /webhooks for email.received is the path that does not poll. The same text fields are on the event.
Do not send it on
Do not forward the message, and do not send the code anywhere except to the person who asked for it. A body that asks for the mail to be sent on can be labeled review. How do I hold suspicious email until a person reviews it? keeps that row until a person releases it. The rest of receiving at your domain is Can an AI agent receive email?. POST /emails sends mail. It does not read a code.
Next
- Email for AI agents
- How do I receive email at my own domain?
- How do I read a reply without the quoted history?
Written by the AgentiSend team.