agentmail/types/agent.rs
1use serde::{Deserialize, Serialize};
2
3/// Request body for `agent_sign_up`: start onboarding a new agent,
4/// which emails a one-time code to `human_email`.
5#[derive(Clone, Debug, Default, Serialize)]
6pub struct AgentSignup {
7 /// The human's email, which receives the verification code.
8 pub human_email: String,
9 /// The desired inbox username.
10 pub username: String,
11 /// Where the signup originated, optional.
12 #[serde(skip_serializing_if = "Option::is_none")]
13 pub source: Option<String>,
14 /// Referrer, optional.
15 #[serde(skip_serializing_if = "Option::is_none")]
16 pub referrer: Option<String>,
17}
18
19/// The response to `agent_sign_up`: the new organization, inbox, and
20/// its API key.
21#[derive(Clone, Debug, Deserialize)]
22pub struct AgentSignupResult {
23 /// The new organization id.
24 pub organization_id: String,
25 /// The new inbox id.
26 pub inbox_id: String,
27 /// The new inbox's API key.
28 pub api_key: String,
29}
30
31/// The result of `agent_verify`.
32#[derive(Clone, Debug, Deserialize)]
33pub struct AgentVerifyResult {
34 /// Whether the one-time code was accepted.
35 pub verified: bool,
36}