# MailToAPI MailToAPI converts inbound emails into structured JSON and POSTs that JSON to a customer's destination URL. ## Agent entrypoints - API guide: https://mailtoapi.app/docs/api.md - OpenAPI schema: https://mailtoapi.app/openapi.json - Agent skill: https://mailtoapi.app/skill/mailtoapi-agent.md - Dashboard: https://app.mailtoapi.app ## How an agent should set up MailToAPI 1. Ask the user to sign in at https://app.mailtoapi.app. 2. Ask the user to open Settings -> Agent, create an agent key, and paste the bearer token back. 3. Ask what email type they want to process, what JSON fields they need, and where the JSON should be POSTed. 4. If the destination endpoint does not exist yet, ask the user to use the dashboard Connect app snippet generator for their server framework and validation library. 5. Create the inbox with POST https://mailtoapi.app/api/v1/inboxes. 6. Return the generated inbox address to the user. 7. Ask the user to send one test email and poll GET https://mailtoapi.app/api/v1/runs to verify delivery. ## Security rules - Never ask for the user's magic-link URL. - Never ask for mailbox credentials. - Never invent API keys or destination URLs. - Only use a bearer token the user explicitly gives you. - Treat agent keys as setup-only credentials: they can manage inboxes/runs but cannot manage billing, admin, or other API keys. - Confirm JSON fields and destination URL before creating an inbox. ## Current delivery contract MailToAPI sends only extracted JSON to the destination URL. There is no envelope payload and no npm SDK required for v1.