Skip to main content
AgentMail logo

Overview

Add AgentMail to any ModuleX agent or workflow. API-first email for agents and automation: create inboxes, send and receive messages, reply to and forward threads, manage drafts, and organize conversations with labels — over the AgentMail REST API (api.agentmail.to).
Categories: Communication · Email · Automation · Auth: API Key · Actions: 21

Authentication

API Key Authentication

Authenticate using your AgentMail API key
1

Step 1

Sign up or log in at https://agentmail.to
2

Step 2

Open the dashboard and navigate to the API Keys section
3

Step 3

Create a new API key or copy your existing one
4

Step 4

Paste the API key below

Required Credentials

FieldDescriptionRequiredFormat
AgentMail API KeyYour AgentMail API keyYes-

Available Actions

Parameters

inbox_id
string
required
ID of the inbox to send from
to
string
required
Recipient email address (comma-separated for multiple)
subject
string
required
Email subject line
text
string
Plain text email body
html
string
HTML email body
cc
string
CC recipient email addresses (comma-separated)
bcc
string
BCC recipient email addresses (comma-separated)

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "thread_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Thread Id"
    },
    "message_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message Id"
    },
    "subject": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Subject"
    },
    "to": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "To"
    }
  },
  "required": [
    "success"
  ],
  "title": "SendMessageOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox to reply from
message_id
string
required
ID of the message to reply to
text
string
Plain text reply body
html
string
HTML reply body
to
string
Override recipient email addresses (comma-separated)
cc
string
CC email addresses (comma-separated)
bcc
string
BCC email addresses (comma-separated)
reply_all
boolean
Reply to all recipients of the original message (Default: false)

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message Id"
    },
    "thread_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Thread Id"
    }
  },
  "required": [
    "success"
  ],
  "title": "ReplyMessageOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox containing the message
message_id
string
required
ID of the message to forward
to
string
required
Recipient email addresses (comma-separated)
subject
string
Override subject line
text
string
Additional plain text to prepend
html
string
Additional HTML to prepend
cc
string
CC recipient email addresses (comma-separated)
bcc
string
BCC recipient email addresses (comma-separated)

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message Id"
    },
    "thread_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Thread Id"
    }
  },
  "required": [
    "success"
  ],
  "title": "ForwardMessageOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox to list messages from
limit
integer
Maximum number of results to return
page_token
string
Pagination token for the next page of results

Response

{
  "$defs": {
    "MessageSummary": {
      "additionalProperties": false,
      "description": "A single message row in ``list_messages``.",
      "properties": {
        "message_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Message Id"
        },
        "from_": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "From"
        },
        "to": {
          "items": {
            "type": "string"
          },
          "title": "To",
          "type": "array"
        },
        "subject": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Subject"
        },
        "preview": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Preview"
        },
        "timestamp": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Timestamp"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        }
      },
      "title": "MessageSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "messages": {
      "items": {
        "$ref": "#/$defs/MessageSummary"
      },
      "title": "Messages",
      "type": "array"
    },
    "count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Count"
    },
    "next_page_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Next Page Token"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListMessagesOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox containing the message
message_id
string
required
ID of the message to retrieve

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message Id"
    },
    "thread_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Thread Id"
    },
    "from_": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "From"
    },
    "to": {
      "items": {
        "type": "string"
      },
      "title": "To",
      "type": "array"
    },
    "cc": {
      "items": {
        "type": "string"
      },
      "title": "Cc",
      "type": "array"
    },
    "bcc": {
      "items": {
        "type": "string"
      },
      "title": "Bcc",
      "type": "array"
    },
    "subject": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Subject"
    },
    "text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Text"
    },
    "html": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Html"
    },
    "labels": {
      "items": {
        "type": "string"
      },
      "title": "Labels",
      "type": "array"
    },
    "timestamp": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Timestamp"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Created At"
    }
  },
  "required": [
    "success"
  ],
  "title": "GetMessageOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox containing the message
message_id
string
required
ID of the message to update
add_labels
string
Comma-separated labels to add to the message
remove_labels
string
Comma-separated labels to remove from the message

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message Id"
    },
    "labels": {
      "items": {
        "type": "string"
      },
      "title": "Labels",
      "type": "array"
    }
  },
  "required": [
    "success"
  ],
  "title": "UpdateMessageOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox to list threads from
limit
integer
Maximum number of results to return
page_token
string
Pagination token for the next page of results
labels
string
Comma-separated labels to filter threads by
before
string
Filter threads before this ISO 8601 timestamp
after
string
Filter threads after this ISO 8601 timestamp

Response

{
  "$defs": {
    "ThreadSummary": {
      "additionalProperties": false,
      "description": "A single thread row in ``list_threads``.",
      "properties": {
        "thread_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Thread Id"
        },
        "subject": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Subject"
        },
        "senders": {
          "items": {
            "type": "string"
          },
          "title": "Senders",
          "type": "array"
        },
        "recipients": {
          "items": {
            "type": "string"
          },
          "title": "Recipients",
          "type": "array"
        },
        "message_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Message Count"
        },
        "last_message_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Last Message At"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated At"
        }
      },
      "title": "ThreadSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "threads": {
      "items": {
        "$ref": "#/$defs/ThreadSummary"
      },
      "title": "Threads",
      "type": "array"
    },
    "count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Count"
    },
    "next_page_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Next Page Token"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListThreadsOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox containing the thread
thread_id
string
required
ID of the thread to retrieve

Response

{
  "$defs": {
    "ThreadMessage": {
      "additionalProperties": false,
      "description": "A single message inside ``get_thread``.",
      "properties": {
        "message_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Message Id"
        },
        "from_": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "From"
        },
        "to": {
          "items": {
            "type": "string"
          },
          "title": "To",
          "type": "array"
        },
        "cc": {
          "items": {
            "type": "string"
          },
          "title": "Cc",
          "type": "array"
        },
        "bcc": {
          "items": {
            "type": "string"
          },
          "title": "Bcc",
          "type": "array"
        },
        "subject": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Subject"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Text"
        },
        "html": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Html"
        },
        "labels": {
          "items": {
            "type": "string"
          },
          "title": "Labels",
          "type": "array"
        },
        "timestamp": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Timestamp"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        }
      },
      "title": "ThreadMessage",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "thread_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Thread Id"
    },
    "subject": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Subject"
    },
    "senders": {
      "items": {
        "type": "string"
      },
      "title": "Senders",
      "type": "array"
    },
    "recipients": {
      "items": {
        "type": "string"
      },
      "title": "Recipients",
      "type": "array"
    },
    "message_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message Count"
    },
    "labels": {
      "items": {
        "type": "string"
      },
      "title": "Labels",
      "type": "array"
    },
    "last_message_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Last Message At"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Created At"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Updated At"
    },
    "messages": {
      "items": {
        "$ref": "#/$defs/ThreadMessage"
      },
      "title": "Messages",
      "type": "array"
    }
  },
  "required": [
    "success"
  ],
  "title": "GetThreadOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox containing the thread
thread_id
string
required
ID of the thread to update
add_labels
string
Comma-separated labels to add to the thread
remove_labels
string
Comma-separated labels to remove from the thread

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "thread_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Thread Id"
    },
    "labels": {
      "items": {
        "type": "string"
      },
      "title": "Labels",
      "type": "array"
    }
  },
  "required": [
    "success"
  ],
  "title": "UpdateThreadOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox containing the thread
thread_id
string
required
ID of the thread to delete
permanent
boolean
Force permanent deletion instead of moving to trash (Default: false)

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "deleted": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Deleted"
    }
  },
  "required": [
    "success"
  ],
  "title": "DeleteThreadOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox to create the draft in
to
string
Recipient email addresses (comma-separated)
subject
string
Draft subject line
text
string
Plain text draft body
html
string
HTML draft body
cc
string
CC recipient email addresses (comma-separated)
bcc
string
BCC recipient email addresses (comma-separated)
in_reply_to
string
ID of message being replied to
send_at
string
ISO 8601 timestamp to schedule sending

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "draft_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Draft Id"
    },
    "inbox_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Inbox Id"
    },
    "subject": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Subject"
    },
    "to": {
      "items": {
        "type": "string"
      },
      "title": "To",
      "type": "array"
    },
    "cc": {
      "items": {
        "type": "string"
      },
      "title": "Cc",
      "type": "array"
    },
    "bcc": {
      "items": {
        "type": "string"
      },
      "title": "Bcc",
      "type": "array"
    },
    "text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Text"
    },
    "html": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Html"
    },
    "preview": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Preview"
    },
    "labels": {
      "items": {
        "type": "string"
      },
      "title": "Labels",
      "type": "array"
    },
    "in_reply_to": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "In Reply To"
    },
    "send_status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Send Status"
    },
    "send_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Send At"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Created At"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Updated At"
    }
  },
  "required": [
    "success"
  ],
  "title": "CreateDraftOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox to list drafts from
limit
integer
Maximum number of results to return
page_token
string
Pagination token for the next page of results

Response

{
  "$defs": {
    "DraftSummary": {
      "additionalProperties": false,
      "description": "A single draft row in ``list_drafts``.",
      "properties": {
        "draft_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Draft Id"
        },
        "inbox_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Inbox Id"
        },
        "subject": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Subject"
        },
        "to": {
          "items": {
            "type": "string"
          },
          "title": "To",
          "type": "array"
        },
        "cc": {
          "items": {
            "type": "string"
          },
          "title": "Cc",
          "type": "array"
        },
        "bcc": {
          "items": {
            "type": "string"
          },
          "title": "Bcc",
          "type": "array"
        },
        "preview": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Preview"
        },
        "send_status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Send Status"
        },
        "send_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Send At"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated At"
        }
      },
      "title": "DraftSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "drafts": {
      "items": {
        "$ref": "#/$defs/DraftSummary"
      },
      "title": "Drafts",
      "type": "array"
    },
    "count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Count"
    },
    "next_page_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Next Page Token"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListDraftsOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox the draft belongs to
draft_id
string
required
ID of the draft to retrieve

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "draft_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Draft Id"
    },
    "inbox_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Inbox Id"
    },
    "subject": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Subject"
    },
    "to": {
      "items": {
        "type": "string"
      },
      "title": "To",
      "type": "array"
    },
    "cc": {
      "items": {
        "type": "string"
      },
      "title": "Cc",
      "type": "array"
    },
    "bcc": {
      "items": {
        "type": "string"
      },
      "title": "Bcc",
      "type": "array"
    },
    "text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Text"
    },
    "html": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Html"
    },
    "preview": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Preview"
    },
    "labels": {
      "items": {
        "type": "string"
      },
      "title": "Labels",
      "type": "array"
    },
    "in_reply_to": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "In Reply To"
    },
    "send_status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Send Status"
    },
    "send_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Send At"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Created At"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Updated At"
    }
  },
  "required": [
    "success"
  ],
  "title": "GetDraftOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox containing the draft
draft_id
string
required
ID of the draft to update
to
string
Recipient email addresses (comma-separated)
subject
string
Draft subject line
text
string
Plain text draft body
html
string
HTML draft body
cc
string
CC recipient email addresses (comma-separated)
bcc
string
BCC recipient email addresses (comma-separated)
send_at
string
ISO 8601 timestamp to schedule sending

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "draft_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Draft Id"
    },
    "inbox_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Inbox Id"
    },
    "subject": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Subject"
    },
    "to": {
      "items": {
        "type": "string"
      },
      "title": "To",
      "type": "array"
    },
    "cc": {
      "items": {
        "type": "string"
      },
      "title": "Cc",
      "type": "array"
    },
    "bcc": {
      "items": {
        "type": "string"
      },
      "title": "Bcc",
      "type": "array"
    },
    "text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Text"
    },
    "html": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Html"
    },
    "preview": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Preview"
    },
    "labels": {
      "items": {
        "type": "string"
      },
      "title": "Labels",
      "type": "array"
    },
    "in_reply_to": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "In Reply To"
    },
    "send_status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Send Status"
    },
    "send_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Send At"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Created At"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Updated At"
    }
  },
  "required": [
    "success"
  ],
  "title": "UpdateDraftOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox containing the draft
draft_id
string
required
ID of the draft to delete

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "deleted": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Deleted"
    }
  },
  "required": [
    "success"
  ],
  "title": "DeleteDraftOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox containing the draft
draft_id
string
required
ID of the draft to send

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "message_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message Id"
    },
    "thread_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Thread Id"
    }
  },
  "required": [
    "success"
  ],
  "title": "SendDraftOutput",
  "type": "object"
}

Parameters

username
string
Username for the inbox email address
domain
string
Domain for the inbox email address
display_name
string
Display name for the inbox

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "inbox_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Inbox Id"
    },
    "email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Email"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Display Name"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Created At"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Updated At"
    }
  },
  "required": [
    "success"
  ],
  "title": "CreateInboxOutput",
  "type": "object"
}

Parameters

limit
integer
Maximum number of results to return
page_token
string
Pagination token for the next page of results

Response

{
  "$defs": {
    "InboxSummary": {
      "additionalProperties": false,
      "description": "A single inbox row in ``list_inboxes``.",
      "properties": {
        "inbox_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Inbox Id"
        },
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Email"
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Display Name"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated At"
        }
      },
      "title": "InboxSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "inboxes": {
      "items": {
        "$ref": "#/$defs/InboxSummary"
      },
      "title": "Inboxes",
      "type": "array"
    },
    "count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Count"
    },
    "next_page_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Next Page Token"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListInboxesOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox to retrieve

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "inbox_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Inbox Id"
    },
    "email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Email"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Display Name"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Created At"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Updated At"
    }
  },
  "required": [
    "success"
  ],
  "title": "GetInboxOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox to update
display_name
string
required
New display name for the inbox

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "inbox_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Inbox Id"
    },
    "email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Email"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Display Name"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Created At"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Updated At"
    }
  },
  "required": [
    "success"
  ],
  "title": "UpdateInboxOutput",
  "type": "object"
}

Parameters

inbox_id
string
required
ID of the inbox to delete

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "deleted": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Deleted"
    }
  },
  "required": [
    "success"
  ],
  "title": "DeleteInboxOutput",
  "type": "object"
}

Limits & Quotas

  • All calls go to https://api.agentmail.to/v0 over HTTPS with a 30s client timeout.
  • List endpoints are paginated: pass limit and the returned next_page_token (via page_token) to page through results.
  • Error model: non-2xx responses and timeouts are caught and returned as success=False + error rather than raising. Plan for retries on the agent side based on the error string.

Gmail

Klaviyo

Mailgun