diff --git a/.agents/skills/custom-commands/SKILL.md b/.agents/skills/custom-commands/SKILL.md index afa8fa0..06bf73f 100644 --- a/.agents/skills/custom-commands/SKILL.md +++ b/.agents/skills/custom-commands/SKILL.md @@ -67,7 +67,6 @@ with the following sub-clients: |-------|------|-------------| | `client.inboxes` | `agentmail_sdk::api::InboxesClient` | inboxes operations | | `client.api_keys` | `agentmail_sdk::api::ApiKeysClient2` | api_keys operations | -| `client.browser_credentials` | `agentmail_sdk::api::BrowserCredentialsClient` | browser_credentials operations | | `client.drafts` | `agentmail_sdk::api::DraftsClient2` | drafts operations | | `client.events` | `agentmail_sdk::api::EventsClient` | events operations | | `client.lists` | `agentmail_sdk::api::ListsClient2` | lists operations | diff --git a/.fern/replay.lock b/.fern/replay.lock index f47b18c..3d7e024 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -30,7 +30,13 @@ generations: cli_version: unknown generator_versions: fernapi/fern-cli-generator: 0.38.10 -current_generation: 9ffa115712526f3977b3d302149975d4c63a71aa + - commit_sha: 4239de6d236d263c688b76d9a5db8558b30c3d12 + tree_hash: ce54aa56da43ea45168cb8146e81e2e464916141 + timestamp: 2026-09-14T19:53:49.832Z + cli_version: unknown + generator_versions: + fernapi/fern-cli-generator: 0.38.10 +current_generation: 4239de6d236d263c688b76d9a5db8558b30c3d12 patches: - id: patch-bf63549e content_hash: sha256:a660ef1be2e6211b2d9aee152022a339ffd879d56f0e8b0b557ce0fb5e4d9b5c diff --git a/Cargo.lock b/Cargo.lock index 15528ce..c809724 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -569,7 +569,7 @@ checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" [[package]] name = "agentmail-cli" -version = "1.3.0" +version = "1.4.0" dependencies = [ "agentmail_sdk", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 3aa607e..40a6d68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "agentmail-cli" -version = "1.3.0" +version = "1.4.0" edition = "2021" description = "Command-line interface for the AgentMail API. Send, receive, reply, and manage threaded email conversations from your terminal." license = "MIT" diff --git a/agentmail-sdk/src/api/resources/api_keys/api_keys.rs b/agentmail-sdk/src/api/resources/api_keys/api_keys.rs index 8b0ac64..fff6971 100644 --- a/agentmail-sdk/src/api/resources/api_keys/api_keys.rs +++ b/agentmail-sdk/src/api/resources/api_keys/api_keys.rs @@ -13,6 +13,10 @@ impl ApiKeysClient { }) } + /// Lists every credential, newest first. Filter one family with `type`. + /// Page to token exhaustion: a page can be empty and still carry a + /// `next_page_token`. + /// /// **CLI:** /// ```bash /// agentmail api-keys list @@ -20,6 +24,7 @@ impl ApiKeysClient { /// /// # Arguments /// + /// * `type_` - Restrict the list to one credential family. Omit for every family. /// * `options` - Additional request options such as headers, timeout, etc. /// /// # Returns @@ -60,6 +65,7 @@ impl ApiKeysClient { "v0/api-keys", None, QueryBuilder::new() + .serialize("type", request.r#type.clone()) .serialize("limit", request.limit.clone()) .serialize("page_token", request.page_token.clone()) .serialize("ascending", request.ascending.clone()) @@ -69,6 +75,9 @@ impl ApiKeysClient { .await } + /// Creates a bearer key, or registers a public key when the body carries + /// `public_key`. The route selects the scope. Bearer secrets are returned once. + /// /// **CLI:** /// ```bash /// agentmail api-keys create --name "My Key" @@ -97,9 +106,11 @@ impl ApiKeysClient { /// client /// .api_keys /// .create( - /// &CreateAPIKeyRequest { - /// ..Default::default() - /// }, + /// &CreateAPIKeyRequest::CreateBearerAPIKeyRequest(CreateBearerAPIKeyRequest( + /// APIKeyMutableFields { + /// ..Default::default() + /// }, + /// )), /// None, /// ) /// .await; @@ -109,7 +120,7 @@ impl ApiKeysClient { &self, request: &CreateApiKeyRequest, options: Option, - ) -> Result { + ) -> Result { self.http_client .execute_request( Method::POST, @@ -121,10 +132,8 @@ impl ApiKeysClient { .await } - /// **CLI:** - /// ```bash - /// agentmail api-keys delete --api-key-id - /// ``` + /// Returns one credential of any family. Public keys also resolve by + /// `client_id`. Poll a sign-in key until `status` is `active`. /// /// # Arguments /// @@ -132,7 +141,7 @@ impl ApiKeysClient { /// /// # Returns /// - /// Empty response + /// JSON response from the API /// /// # Examples /// @@ -148,18 +157,18 @@ impl ApiKeysClient { /// let client = AgentmailClient::new(config).expect("Failed to build client"); /// client /// .api_keys - /// .delete(&APIKeyID("api_key_id".to_string()), None) + /// .get(&APIKeyID("api_key_id".to_string()), None) /// .await; /// } /// ``` - pub async fn delete( + pub async fn get( &self, api_key_id: &ApiKeyId, options: Option, - ) -> Result<(), ApiError> { + ) -> Result { self.http_client .execute_request( - Method::DELETE, + Method::GET, &format!("v0/api-keys/{}", api_key_id.0), None, None, @@ -168,128 +177,16 @@ impl ApiKeysClient { .await } - /// List only public-key credentials visible to the bearer caller's scope. - /// Bearer credentials are never returned, even though both credential types - /// share storage and pagination indexes. Requires `api_key_read`. - /// - /// # Arguments - /// - /// * `options` - Additional request options such as headers, timeout, etc. - /// - /// # Returns - /// - /// JSON response from the API - /// - /// # Examples + /// Deletes one credential of any family. A pending sign-in key is + /// cancelled; an active one is revoked. Public keys also resolve by `client_id`. /// - /// ```no_run - /// use agentmail_sdk::prelude::*; - /// - /// #[tokio::main] - /// async fn main() { - /// let config = ClientConfig { - /// token: Some("".to_string()), - /// ..Default::default() - /// }; - /// let client = AgentmailClient::new(config).expect("Failed to build client"); - /// client - /// .api_keys - /// .list_public_keys( - /// &ListPublicKeysQueryRequest { - /// ..Default::default() - /// }, - /// None, - /// ) - /// .await; - /// } - /// ``` - pub async fn list_public_keys( - &self, - request: &ListPublicKeysQueryRequest, - options: Option, - ) -> Result { - self.http_client - .execute_request( - Method::GET, - "v0/api-keys/public-keys", - None, - QueryBuilder::new() - .serialize("limit", request.limit.clone()) - .serialize("page_token", request.page_token.clone()) - .serialize("ascending", request.ascending.clone()) - .build(), - options, - ) - .await - } - - /// Register a public P-256 JWK using an existing AgentMail bearer API key - /// with `api_key_create`. Re-registering the same JWK creates a new - /// credential ID; it does not replace or recover an earlier credential. - /// The private key must never be sent to AgentMail. - /// - /// # Arguments - /// - /// * `options` - Additional request options such as headers, timeout, etc. - /// - /// # Returns - /// - /// JSON response from the API - /// - /// # Examples - /// - /// ```no_run - /// use agentmail_sdk::prelude::*; - /// - /// #[tokio::main] - /// async fn main() { - /// let config = ClientConfig { - /// token: Some("".to_string()), - /// ..Default::default() - /// }; - /// let client = AgentmailClient::new(config).expect("Failed to build client"); - /// client - /// .api_keys - /// .create_public_key( - /// &CreatePublicKeyRequest { - /// public_key: PublicJwk { - /// kty: PublicJwkKty::Ec, - /// crv: PublicJwkCrv::P256, - /// x: PublicJwkCoordinate("x".to_string()), - /// y: PublicJwkCoordinate("y".to_string()), - /// }, - /// name: None, - /// scope: None, - /// expires_at: None, - /// }, - /// None, - /// ) - /// .await; - /// } + /// **CLI:** + /// ```bash + /// agentmail api-keys delete --api-key-id /// ``` - pub async fn create_public_key( - &self, - request: &CreatePublicKeyRequest, - options: Option, - ) -> Result { - self.http_client - .execute_request( - Method::POST, - "v0/api-keys/public-keys", - Some(serde_json::to_value(request).map_err(ApiError::Serialization)?), - None, - options, - ) - .await - } - - /// Permanently revoke one public-key credential. This hard-deletes the - /// credential; repeating the request returns not found. Requires - /// `api_key_delete`. /// /// # Arguments /// - /// * `api_key_id` - Public-key credential ID returned by registration. /// * `options` - Additional request options such as headers, timeout, etc. /// /// # Returns @@ -310,19 +207,19 @@ impl ApiKeysClient { /// let client = AgentmailClient::new(config).expect("Failed to build client"); /// client /// .api_keys - /// .revoke_public_key(&"api_key_id".to_string(), None) + /// .delete(&APIKeyID("api_key_id".to_string()), None) /// .await; /// } /// ``` - pub async fn revoke_public_key( + pub async fn delete( &self, - api_key_id: &str, + api_key_id: &ApiKeyId, options: Option, ) -> Result<(), ApiError> { self.http_client .execute_request( Method::DELETE, - &format!("v0/api-keys/public-keys/{}", api_key_id), + &format!("v0/api-keys/{}", api_key_id.0), None, None, options, @@ -330,12 +227,12 @@ impl ApiKeysClient { .await } - /// Rename the credential. All security-relevant fields are immutable. - /// Requires `api_key_update`. + /// Renames a credential or changes its permissions. Public keys also resolve + /// by `client_id`; a sign-in key accepts only `provider_connect` and + /// `provider_share_owner`. /// /// # Arguments /// - /// * `api_key_id` - Public-key credential ID returned by registration. /// * `options` - Additional request options such as headers, timeout, etc. /// /// # Returns @@ -356,377 +253,30 @@ impl ApiKeysClient { /// let client = AgentmailClient::new(config).expect("Failed to build client"); /// client /// .api_keys - /// .update_public_key_name( - /// &"api_key_id".to_string(), - /// &UpdatePublicKeyNameRequest { - /// name: "name".to_string(), - /// }, + /// .update( + /// &APIKeyID("api_key_id".to_string()), + /// &UpdateAPIKeyRequest(APIKeyMutableFields { + /// ..Default::default() + /// }), /// None, /// ) /// .await; /// } /// ``` - pub async fn update_public_key_name( + pub async fn update( &self, - api_key_id: &str, - request: &UpdatePublicKeyNameRequest, + api_key_id: &ApiKeyId, + request: &UpdateApiKeyRequest, options: Option, - ) -> Result { + ) -> Result { self.http_client .execute_request( Method::PATCH, - &format!("v0/api-keys/public-keys/{}", api_key_id), + &format!("v0/api-keys/{}", api_key_id.0), Some(serde_json::to_value(request).map_err(ApiError::Serialization)?), None, options, ) .await } - - /// Invalidate every current public-key credential in the caller's - /// organization by advancing its AgentID key generation. The caller must be - /// organization-scoped and either have `api_key_delete` or, for a verified - /// self-serve agent organization, use an unrestricted unmanaged bearer - /// credential. No request body is accepted. - /// - /// `Idempotency-Key` is required and must be a UUID. Reusing the same UUID - /// returns the original permanent receipt without advancing the generation - /// again. A new UUID performs a new generation advance. - /// - /// # Arguments - /// - /// * `options` - Additional request options such as headers, timeout, etc. - /// - /// # Returns - /// - /// JSON response from the API - /// - /// # Examples - /// - /// ```no_run - /// use agentmail_sdk::prelude::*; - /// - /// #[tokio::main] - /// async fn main() { - /// let config = ClientConfig { - /// token: Some("".to_string()), - /// ..Default::default() - /// }; - /// let client = AgentmailClient::new(config).expect("Failed to build client"); - /// client - /// .api_keys - /// .revoke_all_agent_id_sign_in_keys(Some( - /// RequestOptions::new().additional_header("Idempotency-Key", "Idempotency-Key"), - /// )) - /// .await; - /// } - /// ``` - pub async fn revoke_all_agent_id_sign_in_keys( - &self, - options: Option, - ) -> Result { - self.http_client - .execute_request( - Method::POST, - "v0/api-keys/public-keys/agentid-sign-in/revoke-all", - None, - None, - options, - ) - .await - } - - /// List active browser credentials visible to the caller's scope. Requires `api_key_read`. - /// - /// # Arguments - /// - /// * `options` - Additional request options such as headers, timeout, etc. - /// - /// # Returns - /// - /// JSON response from the API - /// - /// # Examples - /// - /// ```no_run - /// use agentmail_sdk::prelude::*; - /// - /// #[tokio::main] - /// async fn main() { - /// let config = ClientConfig { - /// token: Some("".to_string()), - /// ..Default::default() - /// }; - /// let client = AgentmailClient::new(config).expect("Failed to build client"); - /// client - /// .api_keys - /// .list_browser_credentials( - /// &ListBrowserCredentialsQueryRequest { - /// ..Default::default() - /// }, - /// None, - /// ) - /// .await; - /// } - /// ``` - pub async fn list_browser_credentials( - &self, - request: &ListBrowserCredentialsQueryRequest, - options: Option, - ) -> Result { - self.http_client - .execute_request( - Method::GET, - "v0/api-keys/browser-credentials", - None, - QueryBuilder::new() - .serialize("limit", request.limit.clone()) - .serialize("page_token", request.page_token.clone()) - .build(), - options, - ) - .await - } - - /// List owner-facing browser credential and consent lifecycle events. Requires `api_key_read`. - /// - /// # Arguments - /// - /// * `options` - Additional request options such as headers, timeout, etc. - /// - /// # Returns - /// - /// JSON response from the API - /// - /// # Examples - /// - /// ```no_run - /// use agentmail_sdk::prelude::*; - /// - /// #[tokio::main] - /// async fn main() { - /// let config = ClientConfig { - /// token: Some("".to_string()), - /// ..Default::default() - /// }; - /// let client = AgentmailClient::new(config).expect("Failed to build client"); - /// client - /// .api_keys - /// .list_browser_credential_events( - /// &ListBrowserCredentialEventsQueryRequest { - /// ..Default::default() - /// }, - /// None, - /// ) - /// .await; - /// } - /// ``` - pub async fn list_browser_credential_events( - &self, - request: &ListBrowserCredentialEventsQueryRequest, - options: Option, - ) -> Result { - self.http_client - .execute_request( - Method::GET, - "v0/api-keys/browser-credentials/events", - None, - QueryBuilder::new() - .serialize("limit", request.limit.clone()) - .serialize("page_token", request.page_token.clone()) - .build(), - options, - ) - .await - } - - /// Permanently revoke one active browser credential. Requires `api_key_delete`. - /// - /// # Arguments - /// - /// * `options` - Additional request options such as headers, timeout, etc. - /// - /// # Returns - /// - /// Empty response - /// - /// # Examples - /// - /// ```no_run - /// use agentmail_sdk::prelude::*; - /// - /// #[tokio::main] - /// async fn main() { - /// let config = ClientConfig { - /// token: Some("".to_string()), - /// ..Default::default() - /// }; - /// let client = AgentmailClient::new(config).expect("Failed to build client"); - /// client - /// .api_keys - /// .delete_browser_credential(&"credential_id".to_string(), None) - /// .await; - /// } - /// ``` - pub async fn delete_browser_credential( - &self, - credential_id: &str, - options: Option, - ) -> Result<(), ApiError> { - self.http_client - .execute_request( - Method::DELETE, - &format!("v0/api-keys/browser-credentials/{}", credential_id), - None, - None, - options, - ) - .await - } - - /// Cancel one pending, unexpired browser enrollment intent. Requires `api_key_delete`. - /// - /// # Arguments - /// - /// * `options` - Additional request options such as headers, timeout, etc. - /// - /// # Returns - /// - /// Empty response - /// - /// # Examples - /// - /// ```no_run - /// use agentmail_sdk::prelude::*; - /// - /// #[tokio::main] - /// async fn main() { - /// let config = ClientConfig { - /// token: Some("".to_string()), - /// ..Default::default() - /// }; - /// let client = AgentmailClient::new(config).expect("Failed to build client"); - /// client - /// .api_keys - /// .cancel_browser_enrollment(&"enrollment_id".to_string(), None) - /// .await; - /// } - /// ``` - pub async fn cancel_browser_enrollment( - &self, - enrollment_id: &str, - options: Option, - ) -> Result<(), ApiError> { - self.http_client - .execute_request( - Method::DELETE, - &format!( - "v0/api-keys/browser-credentials/enrollments/{}", - enrollment_id - ), - None, - None, - options, - ) - .await - } - - /// List remembered AgentID client approvals for one live inbox. Requires `api_key_read`. - /// - /// # Arguments - /// - /// * `options` - Additional request options such as headers, timeout, etc. - /// - /// # Returns - /// - /// JSON response from the API - /// - /// # Examples - /// - /// ```no_run - /// use agentmail_sdk::prelude::*; - /// - /// #[tokio::main] - /// async fn main() { - /// let config = ClientConfig { - /// token: Some("".to_string()), - /// ..Default::default() - /// }; - /// let client = AgentmailClient::new(config).expect("Failed to build client"); - /// client - /// .api_keys - /// .list_browser_consents( - /// &ListBrowserConsentsQueryRequest { - /// inbox_id: "inbox_id".to_string(), - /// limit: None, - /// page_token: None, - /// }, - /// None, - /// ) - /// .await; - /// } - /// ``` - pub async fn list_browser_consents( - &self, - request: &ListBrowserConsentsQueryRequest, - options: Option, - ) -> Result { - self.http_client - .execute_request( - Method::GET, - "v0/api-keys/browser-consents", - None, - QueryBuilder::new() - .string("inbox_id", request.inbox_id.clone()) - .serialize("limit", request.limit.clone()) - .serialize("page_token", request.page_token.clone()) - .build(), - options, - ) - .await - } - - /// Revoke one remembered AgentID client approval. Requires `api_key_delete`. - /// - /// # Arguments - /// - /// * `options` - Additional request options such as headers, timeout, etc. - /// - /// # Returns - /// - /// Empty response - /// - /// # Examples - /// - /// ```no_run - /// use agentmail_sdk::prelude::*; - /// - /// #[tokio::main] - /// async fn main() { - /// let config = ClientConfig { - /// token: Some("".to_string()), - /// ..Default::default() - /// }; - /// let client = AgentmailClient::new(config).expect("Failed to build client"); - /// client - /// .api_keys - /// .delete_browser_consent(&"consent_id".to_string(), None) - /// .await; - /// } - /// ``` - pub async fn delete_browser_consent( - &self, - consent_id: &str, - options: Option, - ) -> Result<(), ApiError> { - self.http_client - .execute_request( - Method::DELETE, - &format!("v0/api-keys/browser-consents/{}", consent_id), - None, - None, - options, - ) - .await - } } diff --git a/agentmail-sdk/src/api/resources/inboxes/api_keys/inboxes_api_keys.rs b/agentmail-sdk/src/api/resources/inboxes/api_keys/inboxes_api_keys.rs index 7fb90ed..e2fb5ad 100644 --- a/agentmail-sdk/src/api/resources/inboxes/api_keys/inboxes_api_keys.rs +++ b/agentmail-sdk/src/api/resources/inboxes/api_keys/inboxes_api_keys.rs @@ -101,9 +101,11 @@ impl ApiKeysClient2 { /// .api_keys /// .create( /// &InboxesInboxID("inbox_id".to_string()), - /// &CreateAPIKeyRequest { - /// ..Default::default() - /// }, + /// &CreateAPIKeyRequest::CreateBearerAPIKeyRequest(CreateBearerAPIKeyRequest( + /// APIKeyMutableFields { + /// ..Default::default() + /// }, + /// )), /// None, /// ) /// .await; @@ -114,7 +116,7 @@ impl ApiKeysClient2 { inbox_id: &InboxesInboxId, request: &CreateApiKeyRequest, options: Option, - ) -> Result { + ) -> Result { self.http_client .execute_request( Method::POST, @@ -178,4 +180,61 @@ impl ApiKeysClient2 { ) .await } + + /// **CLI:** + /// ```bash + /// agentmail inboxes api-keys update --inbox-id --api-key-id --name "Renamed" + /// ``` + /// + /// # Arguments + /// + /// * `options` - Additional request options such as headers, timeout, etc. + /// + /// # Returns + /// + /// JSON response from the API + /// + /// # Examples + /// + /// ```no_run + /// use agentmail_sdk::prelude::*; + /// + /// #[tokio::main] + /// async fn main() { + /// let config = ClientConfig { + /// token: Some("".to_string()), + /// ..Default::default() + /// }; + /// let client = AgentmailClient::new(config).expect("Failed to build client"); + /// client + /// .inboxes + /// .api_keys + /// .update( + /// &InboxesInboxID("inbox_id".to_string()), + /// &APIKeyID("api_key_id".to_string()), + /// &UpdateAPIKeyRequest(APIKeyMutableFields { + /// ..Default::default() + /// }), + /// None, + /// ) + /// .await; + /// } + /// ``` + pub async fn update( + &self, + inbox_id: &InboxesInboxId, + api_key_id: &ApiKeyId, + request: &UpdateApiKeyRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::PATCH, + &format!("v0/inboxes/{}/api-keys/{}", inbox_id.0, api_key_id.0), + Some(serde_json::to_value(request).map_err(ApiError::Serialization)?), + None, + options, + ) + .await + } } diff --git a/agentmail-sdk/src/api/resources/inboxes/browser_credentials/inboxes_browser_credentials.rs b/agentmail-sdk/src/api/resources/inboxes/browser_credentials/inboxes_browser_credentials.rs deleted file mode 100644 index 7f81d5d..0000000 --- a/agentmail-sdk/src/api/resources/inboxes/browser_credentials/inboxes_browser_credentials.rs +++ /dev/null @@ -1,91 +0,0 @@ -use crate::api::*; -use crate::{ApiError, ClientConfig, HttpClient, RequestOptions}; -use reqwest::Method; - -pub struct BrowserCredentialsClient { - pub http_client: HttpClient, -} - -impl BrowserCredentialsClient { - pub fn new(config: ClientConfig) -> Result { - Ok(Self { - http_client: HttpClient::new(config.clone())?, - }) - } - - /// Attach a browser enrollment intent to the inbox. Requires - /// `api_key_create`. Before submitting `transaction_jti`, independently - /// verify that the browser page's final origin is exactly - /// `https://auth.agentid.com`. - /// - /// This endpoint is available to every organization using US production. - /// It is not available in EU production. - /// - /// Select `inbox_id` from trusted AgentMail configuration. An AgentID - /// `login_hint` is not authoritative for selecting the inbox; when the - /// transaction includes one, it must match the path inbox. - /// - /// **AgentMail API keys are sent only to `https://api.agentmail.to`; AgentID never requests them.** - /// - /// A new intent returns `202`; an idempotent retry for the same pending - /// transaction, inbox, and bearer key returns `200` with the same receipt. - /// An intent lasts at most five minutes. An activated credential lasts at - /// most 30 days and cannot outlive its authorizing bearer API key. - /// - /// Creation is limited to 20 intents per bearer API key per hour, 100 per - /// organization per hour, and five live unused intents per bearer API key. - /// Browser activation is separately limited to 20 activations per - /// authorizing bearer API key per UTC day. Either kind of limit can return - /// `429`; honor the `Retry-After` header. Cancelling an enrollment releases - /// its live-intent slot but does not reset the daily activation counter. - /// - /// # Arguments - /// - /// * `options` - Additional request options such as headers, timeout, etc. - /// - /// # Returns - /// - /// JSON response from the API - /// - /// # Examples - /// - /// ```no_run - /// use agentmail_sdk::prelude::*; - /// - /// #[tokio::main] - /// async fn main() { - /// let config = ClientConfig { - /// token: Some("".to_string()), - /// ..Default::default() - /// }; - /// let client = AgentmailClient::new(config).expect("Failed to build client"); - /// client - /// .inboxes - /// .browser_credentials - /// .create_enrollment( - /// &InboxesInboxID("inbox_id".to_string()), - /// &CreateBrowserEnrollmentRequest { - /// transaction_jti: BrowserEnrollmentTransactionJti("transaction_jti".to_string()), - /// }, - /// None, - /// ) - /// .await; - /// } - /// ``` - pub async fn create_enrollment( - &self, - inbox_id: &InboxesInboxId, - request: &CreateBrowserEnrollmentRequest, - options: Option, - ) -> Result { - self.http_client - .execute_request( - Method::POST, - &format!("v0/inboxes/{}/browser-credentials/enrollments", inbox_id.0), - Some(serde_json::to_value(request).map_err(ApiError::Serialization)?), - None, - options, - ) - .await - } -} diff --git a/agentmail-sdk/src/api/resources/inboxes/browser_credentials/mod.rs b/agentmail-sdk/src/api/resources/inboxes/browser_credentials/mod.rs deleted file mode 100644 index 78ab2e6..0000000 --- a/agentmail-sdk/src/api/resources/inboxes/browser_credentials/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod inboxes_browser_credentials; -pub use inboxes_browser_credentials::BrowserCredentialsClient; diff --git a/agentmail-sdk/src/api/resources/inboxes/mod.rs b/agentmail-sdk/src/api/resources/inboxes/mod.rs index f2a23f5..4d8fab7 100644 --- a/agentmail-sdk/src/api/resources/inboxes/mod.rs +++ b/agentmail-sdk/src/api/resources/inboxes/mod.rs @@ -4,8 +4,6 @@ use reqwest::Method; pub mod api_keys; pub use api_keys::ApiKeysClient2; -pub mod browser_credentials; -pub use browser_credentials::BrowserCredentialsClient; pub mod drafts; pub use drafts::DraftsClient2; pub mod events; @@ -23,7 +21,6 @@ pub use webhooks::WebhooksClient2; pub struct InboxesClient { pub http_client: HttpClient, pub api_keys: ApiKeysClient2, - pub browser_credentials: BrowserCredentialsClient, pub drafts: DraftsClient2, pub events: EventsClient, pub lists: ListsClient2, @@ -38,7 +35,6 @@ impl InboxesClient { Ok(Self { http_client: HttpClient::new(config.clone())?, api_keys: ApiKeysClient2::new(config.clone())?, - browser_credentials: BrowserCredentialsClient::new(config.clone())?, drafts: DraftsClient2::new(config.clone())?, events: EventsClient::new(config.clone())?, lists: ListsClient2::new(config.clone())?, @@ -157,6 +153,67 @@ impl InboxesClient { .await } + /// Searches inboxes in the organization by address or display name, ranked + /// by relevance. Each word in the query matches the start of a word in the + /// address or display name, so `sup` matches `support@example.com` but + /// `port` does not. An exact address match always ranks first. `limit` + /// cannot exceed 100. A page can be empty and still carry a + /// `next_page_token`; keep paging until the token is absent. + /// + /// # Arguments + /// + /// * `q` - Address or display name to search for. Matches word prefixes. Must be 2 to 256 characters. + /// * `options` - Additional request options such as headers, timeout, etc. + /// + /// # Returns + /// + /// JSON response from the API + /// + /// # Examples + /// + /// ```no_run + /// use agentmail_sdk::prelude::*; + /// + /// #[tokio::main] + /// async fn main() { + /// let config = ClientConfig { + /// token: Some("".to_string()), + /// ..Default::default() + /// }; + /// let client = AgentmailClient::new(config).expect("Failed to build client"); + /// client + /// .inboxes + /// .search( + /// &InboxesSearchQueryRequest { + /// q: "q".to_string(), + /// limit: None, + /// page_token: None, + /// }, + /// None, + /// ) + /// .await; + /// } + /// ``` + pub async fn search( + &self, + request: &InboxesSearchQueryRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::GET, + "v0/inboxes/search", + None, + QueryBuilder::new() + .string("q", request.q.clone()) + .serialize("limit", request.limit.clone()) + .serialize("page_token", request.page_token.clone()) + .build(), + options, + ) + .await + } + /// **CLI:** /// ```bash /// agentmail inboxes get --inbox-id @@ -304,4 +361,58 @@ impl InboxesClient { ) .await } + + /// Authorizes the AgentID sign-in a client is already waiting in, for the + /// inbox in the path, and returns the pending public key it will activate. A + /// repeat for the same token, inbox, and bearer returns the same key. + /// + /// # Arguments + /// + /// * `options` - Additional request options such as headers, timeout, etc. + /// + /// # Returns + /// + /// JSON response from the API + /// + /// # Examples + /// + /// ```no_run + /// use agentmail_sdk::prelude::*; + /// + /// #[tokio::main] + /// async fn main() { + /// let config = ClientConfig { + /// token: Some("".to_string()), + /// ..Default::default() + /// }; + /// let client = AgentmailClient::new(config).expect("Failed to build client"); + /// client + /// .inboxes + /// .authorize( + /// &InboxesInboxID("inbox_id".to_string()), + /// &InboxesAuthorizeInboxRequest { + /// auth_token: AuthToken("auth_token".to_string()), + /// accept_disclosure: None, + /// }, + /// None, + /// ) + /// .await; + /// } + /// ``` + pub async fn authorize( + &self, + inbox_id: &InboxesInboxId, + request: &InboxesAuthorizeInboxRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::POST, + &format!("v0/inboxes/{}/authorize", inbox_id.0), + Some(serde_json::to_value(request).map_err(ApiError::Serialization)?), + None, + options, + ) + .await + } } diff --git a/agentmail-sdk/src/api/resources/inboxes/threads/inboxes_threads.rs b/agentmail-sdk/src/api/resources/inboxes/threads/inboxes_threads.rs index 5e051a6..117583e 100644 --- a/agentmail-sdk/src/api/resources/inboxes/threads/inboxes_threads.rs +++ b/agentmail-sdk/src/api/resources/inboxes/threads/inboxes_threads.rs @@ -177,6 +177,8 @@ impl ThreadsClient2 { /// /// # Arguments /// + /// * `limit` - Maximum number of messages to return. Cannot exceed 100. + /// * `page_token` - Token returned by the previous response for retrieving the next, older page. /// * `options` - Additional request options such as headers, timeout, etc. /// /// # Returns @@ -201,6 +203,9 @@ impl ThreadsClient2 { /// .get( /// &InboxesInboxID("inbox_id".to_string()), /// &ThreadID("thread_id".to_string()), + /// &InboxesThreadsGetQueryRequest { + /// ..Default::default() + /// }, /// None, /// ) /// .await; @@ -210,6 +215,7 @@ impl ThreadsClient2 { &self, inbox_id: &InboxesInboxId, thread_id: &ThreadId, + request: &InboxesThreadsGetQueryRequest, options: Option, ) -> Result { self.http_client @@ -217,7 +223,10 @@ impl ThreadsClient2 { Method::GET, &format!("v0/inboxes/{}/threads/{}", inbox_id.0, thread_id.0), None, - None, + QueryBuilder::new() + .serialize("limit", request.limit.clone()) + .serialize("page_token", request.page_token.clone()) + .build(), options, ) .await diff --git a/agentmail-sdk/src/api/resources/pods/api_keys/pods_api_keys.rs b/agentmail-sdk/src/api/resources/pods/api_keys/pods_api_keys.rs index 8813ffe..f985c51 100644 --- a/agentmail-sdk/src/api/resources/pods/api_keys/pods_api_keys.rs +++ b/agentmail-sdk/src/api/resources/pods/api_keys/pods_api_keys.rs @@ -101,9 +101,11 @@ impl ApiKeysClient3 { /// .api_keys /// .create( /// &PodsPodID("pod_id".to_string()), - /// &CreateAPIKeyRequest { - /// ..Default::default() - /// }, + /// &CreateAPIKeyRequest::CreateBearerAPIKeyRequest(CreateBearerAPIKeyRequest( + /// APIKeyMutableFields { + /// ..Default::default() + /// }, + /// )), /// None, /// ) /// .await; @@ -178,4 +180,61 @@ impl ApiKeysClient3 { ) .await } + + /// **CLI:** + /// ```bash + /// agentmail pods api-keys update --pod-id --api-key-id --name "Renamed" + /// ``` + /// + /// # Arguments + /// + /// * `options` - Additional request options such as headers, timeout, etc. + /// + /// # Returns + /// + /// JSON response from the API + /// + /// # Examples + /// + /// ```no_run + /// use agentmail_sdk::prelude::*; + /// + /// #[tokio::main] + /// async fn main() { + /// let config = ClientConfig { + /// token: Some("".to_string()), + /// ..Default::default() + /// }; + /// let client = AgentmailClient::new(config).expect("Failed to build client"); + /// client + /// .pods + /// .api_keys + /// .update( + /// &PodsPodID("pod_id".to_string()), + /// &APIKeyID("api_key_id".to_string()), + /// &UpdateAPIKeyRequest(APIKeyMutableFields { + /// ..Default::default() + /// }), + /// None, + /// ) + /// .await; + /// } + /// ``` + pub async fn update( + &self, + pod_id: &PodsPodId, + api_key_id: &ApiKeyId, + request: &UpdateApiKeyRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::PATCH, + &format!("v0/pods/{}/api-keys/{}", pod_id.0, api_key_id.0), + Some(serde_json::to_value(request).map_err(ApiError::Serialization)?), + None, + options, + ) + .await + } } diff --git a/agentmail-sdk/src/api/resources/pods/inboxes/pods_inboxes.rs b/agentmail-sdk/src/api/resources/pods/inboxes/pods_inboxes.rs index a032c67..2aa8972 100644 --- a/agentmail-sdk/src/api/resources/pods/inboxes/pods_inboxes.rs +++ b/agentmail-sdk/src/api/resources/pods/inboxes/pods_inboxes.rs @@ -127,6 +127,70 @@ impl InboxesClient2 { .await } + /// Searches inboxes in the pod by address or display name, ranked by + /// relevance. Each word in the query matches the start of a word in the + /// address or display name, so `sup` matches `support@example.com` but + /// `port` does not. An exact address match always ranks first. `limit` + /// cannot exceed 100. A page can be empty and still carry a + /// `next_page_token`; keep paging until the token is absent. + /// + /// # Arguments + /// + /// * `q` - Address or display name to search for. Matches word prefixes. Must be 2 to 256 characters. + /// * `options` - Additional request options such as headers, timeout, etc. + /// + /// # Returns + /// + /// JSON response from the API + /// + /// # Examples + /// + /// ```no_run + /// use agentmail_sdk::prelude::*; + /// + /// #[tokio::main] + /// async fn main() { + /// let config = ClientConfig { + /// token: Some("".to_string()), + /// ..Default::default() + /// }; + /// let client = AgentmailClient::new(config).expect("Failed to build client"); + /// client + /// .pods + /// .inboxes + /// .search( + /// &PodsPodID("pod_id".to_string()), + /// &PodsInboxesSearchQueryRequest { + /// q: "q".to_string(), + /// limit: None, + /// page_token: None, + /// }, + /// None, + /// ) + /// .await; + /// } + /// ``` + pub async fn search( + &self, + pod_id: &PodsPodId, + request: &PodsInboxesSearchQueryRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::GET, + &format!("v0/pods/{}/inboxes/search", pod_id.0), + None, + QueryBuilder::new() + .string("q", request.q.clone()) + .serialize("limit", request.limit.clone()) + .serialize("page_token", request.page_token.clone()) + .build(), + options, + ) + .await + } + /// **CLI:** /// ```bash /// agentmail pods inboxes get --pod-id --inbox-id diff --git a/agentmail-sdk/src/api/resources/pods/threads/pods_threads.rs b/agentmail-sdk/src/api/resources/pods/threads/pods_threads.rs index 5b2bd08..0cdda9d 100644 --- a/agentmail-sdk/src/api/resources/pods/threads/pods_threads.rs +++ b/agentmail-sdk/src/api/resources/pods/threads/pods_threads.rs @@ -177,6 +177,8 @@ impl ThreadsClient3 { /// /// # Arguments /// + /// * `limit` - Maximum number of messages to return. Cannot exceed 100. + /// * `page_token` - Token returned by the previous response for retrieving the next, older page. /// * `options` - Additional request options such as headers, timeout, etc. /// /// # Returns @@ -201,6 +203,9 @@ impl ThreadsClient3 { /// .get( /// &PodsPodID("pod_id".to_string()), /// &ThreadID("thread_id".to_string()), + /// &PodsThreadsGetQueryRequest { + /// ..Default::default() + /// }, /// None, /// ) /// .await; @@ -210,6 +215,7 @@ impl ThreadsClient3 { &self, pod_id: &PodsPodId, thread_id: &ThreadId, + request: &PodsThreadsGetQueryRequest, options: Option, ) -> Result { self.http_client @@ -217,7 +223,10 @@ impl ThreadsClient3 { Method::GET, &format!("v0/pods/{}/threads/{}", pod_id.0, thread_id.0), None, - None, + QueryBuilder::new() + .serialize("limit", request.limit.clone()) + .serialize("page_token", request.page_token.clone()) + .build(), options, ) .await diff --git a/agentmail-sdk/src/api/resources/providers/providers.rs b/agentmail-sdk/src/api/resources/providers/providers.rs index 08dd1cb..75c714d 100644 --- a/agentmail-sdk/src/api/resources/providers/providers.rs +++ b/agentmail-sdk/src/api/resources/providers/providers.rs @@ -207,9 +207,10 @@ impl ProvidersClient { .await } - /// Starts signing an inbox in to a provider. Returns a `magic_url` valid - /// for five minutes; open it in the browser that will hold the sign-in. - /// Requires `api_key_create` and an `Idempotency-Key` header. + /// Starts signing an inbox in to a provider. Returns a single-use `magic_url`, + /// valid for five minutes, to open in the client that will hold the sign-in; + /// the client enrolls as the inbox and continues to the provider. Poll + /// [Get API Key](/api-reference/api-keys/get) with `api_key_id` for `status`. /// /// # Arguments /// @@ -248,7 +249,7 @@ impl ProvidersClient { provider_id: &ProviderId, request: &ConnectProviderBody, options: Option, - ) -> Result { + ) -> Result { self.http_client .execute_request( Method::POST, diff --git a/agentmail-sdk/src/api/resources/threads/threads.rs b/agentmail-sdk/src/api/resources/threads/threads.rs index 3cb6756..1b2da7b 100644 --- a/agentmail-sdk/src/api/resources/threads/threads.rs +++ b/agentmail-sdk/src/api/resources/threads/threads.rs @@ -173,6 +173,8 @@ impl ThreadsClient { /// /// # Arguments /// + /// * `limit` - Maximum number of messages to return. Cannot exceed 100. + /// * `page_token` - Token returned by the previous response for retrieving the next, older page. /// * `options` - Additional request options such as headers, timeout, etc. /// /// # Returns @@ -193,13 +195,20 @@ impl ThreadsClient { /// let client = AgentmailClient::new(config).expect("Failed to build client"); /// client /// .threads - /// .get(&ThreadID("thread_id".to_string()), None) + /// .get( + /// &ThreadID("thread_id".to_string()), + /// &ThreadsGetQueryRequest { + /// ..Default::default() + /// }, + /// None, + /// ) /// .await; /// } /// ``` pub async fn get( &self, thread_id: &ThreadId, + request: &ThreadsGetQueryRequest, options: Option, ) -> Result { self.http_client @@ -207,7 +216,10 @@ impl ThreadsClient { Method::GET, &format!("v0/threads/{}", thread_id.0), None, - None, + QueryBuilder::new() + .serialize("limit", request.limit.clone()) + .serialize("page_token", request.page_token.clone()) + .build(), options, ) .await diff --git a/agentmail-types/src/types/browser_authorization_list_limit.rs b/agentmail-types/src/types/accept_disclosure.rs similarity index 74% rename from agentmail-types/src/types/browser_authorization_list_limit.rs rename to agentmail-types/src/types/accept_disclosure.rs index 65b055d..e3354bb 100644 --- a/agentmail-types/src/types/browser_authorization_list_limit.rs +++ b/agentmail-types/src/types/accept_disclosure.rs @@ -3,4 +3,4 @@ pub use crate::prelude::*; use super::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] -pub struct BrowserAuthorizationListLimit(pub i64); \ No newline at end of file +pub struct AcceptDisclosure(pub bool); \ No newline at end of file diff --git a/agentmail-types/src/types/api_key.rs b/agentmail-types/src/types/api_key.rs index 5e42b66..011c8ad 100644 --- a/agentmail-types/src/types/api_key.rs +++ b/agentmail-types/src/types/api_key.rs @@ -2,105 +2,79 @@ pub use crate::prelude::*; #[allow(unused_imports)] use super::*; -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct ApiKey { - #[serde(default)] - pub api_key_id: ApiKeyId, - #[serde(default)] - pub prefix: Prefix, - #[serde(default)] - pub name: Name, - /// Pod ID the api key is scoped to. If set, the key can only access resources within this pod. - #[serde(skip_serializing_if = "Option::is_none")] - pub pod_id: Option, - /// Inbox ID the api key is scoped to. If set, the key can only access resources within this inbox. - #[serde(skip_serializing_if = "Option::is_none")] - pub inbox_id: Option, - /// Time at which api key was last used. - #[serde(skip_serializing_if = "Option::is_none")] - pub used_at: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option, - #[serde(default)] - pub created_at: CreatedAt, -} +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +#[serde(tag = "type")] +#[non_exhaustive] +pub enum ApiKey { + #[serde(rename = "bearer")] + #[non_exhaustive] + Bearer { + #[serde(default)] + api_key_id: ApiKeyId, + #[serde(default)] + prefix: Prefix, + #[serde(default)] + name: Name, + #[serde(skip_serializing_if = "Option::is_none")] + pod_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + inbox_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + used_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + permissions: Option, + #[serde(default)] + created_at: CreatedAt, + #[serde(default)] + updated_at: UpdatedAt, + #[serde(skip_serializing_if = "Option::is_none")] + expires_at: Option, + }, -impl ApiKey { - pub fn builder() -> ApiKeyBuilder { - ::default() - } -} + #[serde(rename = "public_key")] + #[non_exhaustive] + PublicKey { + #[serde(flatten)] + data: PublicKeyCredential, + }, -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct ApiKeyBuilder { - api_key_id: Option, - prefix: Option, - name: Option, - pod_id: Option, - inbox_id: Option, - used_at: Option>, - permissions: Option, - created_at: Option, + /// Catch-all variant for unrecognized discriminant values. + /// If the server sends a discriminant not recognized by the current SDK + /// version, the raw payload is captured here so callers can still inspect it. + #[serde(untagged)] + __Unknown(serde_json::Value), } -impl ApiKeyBuilder { - pub fn api_key_id(mut self, value: ApiKeyId) -> Self { - self.api_key_id = Some(value); - self - } - - pub fn prefix(mut self, value: Prefix) -> Self { - self.prefix = Some(value); - self +impl ApiKey { + pub fn bearer(api_key_id: ApiKeyId, prefix: Prefix, name: Name, created_at: CreatedAt, updated_at: UpdatedAt) -> Self { + Self::Bearer { api_key_id, prefix, name, pod_id: None, inbox_id: None, used_at: None, permissions: None, created_at, updated_at, expires_at: None } } - pub fn name(mut self, value: Name) -> Self { - self.name = Some(value); - self + pub fn public_key(data: PublicKeyCredential) -> Self { + Self::PublicKey { data } } - pub fn pod_id(mut self, value: impl Into) -> Self { - self.pod_id = Some(value.into()); - self + pub fn bearer_with_pod_id(api_key_id: ApiKeyId, prefix: Prefix, name: Name, pod_id: PodScopeId, inbox_id: Option, used_at: Option, permissions: Option, created_at: CreatedAt, updated_at: UpdatedAt, expires_at: Option) -> Self { + Self::Bearer { api_key_id, prefix, name, pod_id: Some(pod_id), inbox_id, used_at, permissions, created_at, updated_at, expires_at } } - pub fn inbox_id(mut self, value: impl Into) -> Self { - self.inbox_id = Some(value.into()); - self + pub fn bearer_with_inbox_id(api_key_id: ApiKeyId, prefix: Prefix, name: Name, pod_id: Option, inbox_id: InboxScopeId, used_at: Option, permissions: Option, created_at: CreatedAt, updated_at: UpdatedAt, expires_at: Option) -> Self { + Self::Bearer { api_key_id, prefix, name, pod_id, inbox_id: Some(inbox_id), used_at, permissions, created_at, updated_at, expires_at } } - pub fn used_at(mut self, value: DateTime) -> Self { - self.used_at = Some(value); - self + pub fn bearer_with_used_at(api_key_id: ApiKeyId, prefix: Prefix, name: Name, pod_id: Option, inbox_id: Option, used_at: UsedAt, permissions: Option, created_at: CreatedAt, updated_at: UpdatedAt, expires_at: Option) -> Self { + Self::Bearer { api_key_id, prefix, name, pod_id, inbox_id, used_at: Some(used_at), permissions, created_at, updated_at, expires_at } } - pub fn permissions(mut self, value: ApiKeyPermissions) -> Self { - self.permissions = Some(value); - self + pub fn bearer_with_permissions(api_key_id: ApiKeyId, prefix: Prefix, name: Name, pod_id: Option, inbox_id: Option, used_at: Option, permissions: ApiKeyPermissions, created_at: CreatedAt, updated_at: UpdatedAt, expires_at: Option) -> Self { + Self::Bearer { api_key_id, prefix, name, pod_id, inbox_id, used_at, permissions: Some(permissions), created_at, updated_at, expires_at } } - pub fn created_at(mut self, value: CreatedAt) -> Self { - self.created_at = Some(value); - self + pub fn bearer_with_expires_at(api_key_id: ApiKeyId, prefix: Prefix, name: Name, pod_id: Option, inbox_id: Option, used_at: Option, permissions: Option, created_at: CreatedAt, updated_at: UpdatedAt, expires_at: ExpiresAt) -> Self { + Self::Bearer { api_key_id, prefix, name, pod_id, inbox_id, used_at, permissions, created_at, updated_at, expires_at: Some(expires_at) } } - /// Consumes the builder and constructs a [`ApiKey`]. - /// This method will fail if any of the following fields are not set: - /// - [`api_key_id`](ApiKeyBuilder::api_key_id) - /// - [`prefix`](ApiKeyBuilder::prefix) - /// - [`name`](ApiKeyBuilder::name) - /// - [`created_at`](ApiKeyBuilder::created_at) - pub fn build(self) -> Result { - Ok(ApiKey { - api_key_id: self.api_key_id.ok_or_else(|| BuildError::missing_field("api_key_id"))?, - prefix: self.prefix.ok_or_else(|| BuildError::missing_field("prefix"))?, - name: self.name.ok_or_else(|| BuildError::missing_field("name"))?, - pod_id: self.pod_id, - inbox_id: self.inbox_id, - used_at: self.used_at, - permissions: self.permissions, - created_at: self.created_at.ok_or_else(|| BuildError::missing_field("created_at"))?, - }) + pub fn unknown(value: serde_json::Value) -> Self { + Self::__Unknown(value) } } diff --git a/agentmail-types/src/types/api_key_creator.rs b/agentmail-types/src/types/api_key_creator.rs new file mode 100644 index 0000000..beb0090 --- /dev/null +++ b/agentmail-types/src/types/api_key_creator.rs @@ -0,0 +1,38 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// The bearer API key that created the credential. Provenance only; the credential outlives it. +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct ApiKeyCreator { + #[serde(default)] + pub api_key_id: ApiKeyId, +} + +impl ApiKeyCreator { + pub fn builder() -> ApiKeyCreatorBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct ApiKeyCreatorBuilder { + api_key_id: Option, +} + +impl ApiKeyCreatorBuilder { + pub fn api_key_id(mut self, value: ApiKeyId) -> Self { + self.api_key_id = Some(value); + self + } + + /// Consumes the builder and constructs a [`ApiKeyCreator`]. + /// This method will fail if any of the following fields are not set: + /// - [`api_key_id`](ApiKeyCreatorBuilder::api_key_id) + pub fn build(self) -> Result { + Ok(ApiKeyCreator { + api_key_id: self.api_key_id.ok_or_else(|| BuildError::missing_field("api_key_id"))?, + }) + } +} diff --git a/agentmail-types/src/types/api_key_mutable_fields.rs b/agentmail-types/src/types/api_key_mutable_fields.rs new file mode 100644 index 0000000..bef5d72 --- /dev/null +++ b/agentmail-types/src/types/api_key_mutable_fields.rs @@ -0,0 +1,45 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// The fields a caller may set on a bearer key at creation and change afterward. +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct ApiKeyMutableFields { + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option, +} + +impl ApiKeyMutableFields { + pub fn builder() -> ApiKeyMutableFieldsBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct ApiKeyMutableFieldsBuilder { + name: Option, + permissions: Option, +} + +impl ApiKeyMutableFieldsBuilder { + pub fn name(mut self, value: Name) -> Self { + self.name = Some(value); + self + } + + pub fn permissions(mut self, value: ApiKeyPermissions) -> Self { + self.permissions = Some(value); + self + } + + /// Consumes the builder and constructs a [`ApiKeyMutableFields`]. + pub fn build(self) -> Result { + Ok(ApiKeyMutableFields { + name: self.name, + permissions: self.permissions, + }) + } +} diff --git a/agentmail-types/src/types/api_key_permissions.rs b/agentmail-types/src/types/api_key_permissions.rs index f9aa785..8b5b7c4 100644 --- a/agentmail-types/src/types/api_key_permissions.rs +++ b/agentmail-types/src/types/api_key_permissions.rs @@ -104,6 +104,14 @@ pub struct ApiKeyPermissions { /// Delete API keys. #[serde(skip_serializing_if = "Option::is_none")] pub api_key_delete: Option, + /// Sign in to providers as an inbox: connect a provider, authorize an inbox, and mint the + /// sign-in keys. Omitted on a new bearer key means false, whatever else the key holds. + #[serde(skip_serializing_if = "Option::is_none")] + pub provider_connect: Option, + /// Share the organization owner's name and email with providers at sign-in. One permission + /// for both values. + #[serde(skip_serializing_if = "Option::is_none")] + pub provider_share_owner: Option, /// Read pods. #[serde(skip_serializing_if = "Option::is_none")] pub pod_read: Option, @@ -157,6 +165,8 @@ pub struct ApiKeyPermissionsBuilder { api_key_create: Option, api_key_update: Option, api_key_delete: Option, + provider_connect: Option, + provider_share_owner: Option, pod_read: Option, pod_create: Option, pod_delete: Option, @@ -328,6 +338,16 @@ impl ApiKeyPermissionsBuilder { self } + pub fn provider_connect(mut self, value: bool) -> Self { + self.provider_connect = Some(value); + self + } + + pub fn provider_share_owner(mut self, value: bool) -> Self { + self.provider_share_owner = Some(value); + self + } + pub fn pod_read(mut self, value: bool) -> Self { self.pod_read = Some(value); self @@ -379,6 +399,8 @@ impl ApiKeyPermissionsBuilder { api_key_create: self.api_key_create, api_key_update: self.api_key_update, api_key_delete: self.api_key_delete, + provider_connect: self.provider_connect, + provider_share_owner: self.provider_share_owner, pod_read: self.pod_read, pod_create: self.pod_create, pod_delete: self.pod_delete, diff --git a/agentmail-types/src/types/api_key_type.rs b/agentmail-types/src/types/api_key_type.rs new file mode 100644 index 0000000..e374383 --- /dev/null +++ b/agentmail-types/src/types/api_key_type.rs @@ -0,0 +1,44 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ApiKeyType { + Bearer, + PublicKey, + /// This variant is used for forward compatibility. + /// If the server sends a value not recognized by the current SDK version, + /// it will be captured here with the raw string value. + __Unknown(String), +} +impl Serialize for ApiKeyType { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::Bearer => serializer.serialize_str("bearer"), + Self::PublicKey => serializer.serialize_str("public_key"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for ApiKeyType { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "bearer" => Ok(Self::Bearer), + "public_key" => Ok(Self::PublicKey), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for ApiKeyType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Bearer => write!(f, "bearer"), + Self::PublicKey => write!(f, "public_key"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/api_keys_list_query_request.rs b/agentmail-types/src/types/api_keys_list_query_request.rs index 8b17c8e..29644c9 100644 --- a/agentmail-types/src/types/api_keys_list_query_request.rs +++ b/agentmail-types/src/types/api_keys_list_query_request.rs @@ -5,6 +5,9 @@ use super::*; /// Query parameters for list #[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] pub struct ApiKeysListQueryRequest { + /// Restrict the list to one credential family. Omit for every family. + #[serde(skip_serializing_if = "Option::is_none")] + pub r#type: Option, #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -22,12 +25,18 @@ impl ApiKeysListQueryRequest { #[derive(Clone, PartialEq, Default, Debug)] #[non_exhaustive] pub struct ApiKeysListQueryRequestBuilder { + r#type: Option, limit: Option, page_token: Option, ascending: Option, } impl ApiKeysListQueryRequestBuilder { + pub fn r#type(mut self, value: ApiKeyType) -> Self { + self.r#type = Some(value); + self + } + pub fn limit(mut self, value: Limit) -> Self { self.limit = Some(value); self @@ -46,6 +55,7 @@ impl ApiKeysListQueryRequestBuilder { /// Consumes the builder and constructs a [`ApiKeysListQueryRequest`]. pub fn build(self) -> Result { Ok(ApiKeysListQueryRequest { + r#type: self.r#type, limit: self.limit, page_token: self.page_token, ascending: self.ascending, diff --git a/agentmail-types/src/types/browser_enrollment_transaction_jti.rs b/agentmail-types/src/types/auth_token.rs similarity index 72% rename from agentmail-types/src/types/browser_enrollment_transaction_jti.rs rename to agentmail-types/src/types/auth_token.rs index b15a314..05e6777 100644 --- a/agentmail-types/src/types/browser_enrollment_transaction_jti.rs +++ b/agentmail-types/src/types/auth_token.rs @@ -3,4 +3,4 @@ pub use crate::prelude::*; use super::*; #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] -pub struct BrowserEnrollmentTransactionJti(pub String); \ No newline at end of file +pub struct AuthToken(pub String); \ No newline at end of file diff --git a/agentmail-types/src/types/browser_consent.rs b/agentmail-types/src/types/browser_consent.rs deleted file mode 100644 index 4cdfb3d..0000000 --- a/agentmail-types/src/types/browser_consent.rs +++ /dev/null @@ -1,121 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -/// Remembered approval for one closed AgentID client and inbox. -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub struct BrowserConsent { - #[serde(default)] - pub consent_id: String, - #[serde(default)] - pub inbox_id: String, - pub client_type: BrowserConsentClientType, - #[serde(default)] - pub client_id: String, - /// Registered client URL, when one is available. - #[serde(skip_serializing_if = "Option::is_none")] - pub client_url: Option, - /// At least one non-empty scope approved for this client. - #[serde(default)] - pub approved_scopes: Vec, - #[serde(default)] - #[serde(with = "crate::core::flexible_datetime::offset")] - pub created_at: DateTime, - #[serde(default)] - #[serde(with = "crate::core::flexible_datetime::offset")] - pub updated_at: DateTime, - #[serde(default)] - #[serde(with = "crate::core::flexible_datetime::offset")] - pub expires_at: DateTime, -} - -impl BrowserConsent { - pub fn builder() -> BrowserConsentBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct BrowserConsentBuilder { - consent_id: Option, - inbox_id: Option, - client_type: Option, - client_id: Option, - client_url: Option, - approved_scopes: Option>, - created_at: Option>, - updated_at: Option>, - expires_at: Option>, -} - -impl BrowserConsentBuilder { - pub fn consent_id(mut self, value: impl Into) -> Self { - self.consent_id = Some(value.into()); - self - } - - pub fn inbox_id(mut self, value: impl Into) -> Self { - self.inbox_id = Some(value.into()); - self - } - - pub fn client_type(mut self, value: BrowserConsentClientType) -> Self { - self.client_type = Some(value); - self - } - - pub fn client_id(mut self, value: impl Into) -> Self { - self.client_id = Some(value.into()); - self - } - - pub fn client_url(mut self, value: impl Into) -> Self { - self.client_url = Some(value.into()); - self - } - - pub fn approved_scopes(mut self, value: Vec) -> Self { - self.approved_scopes = Some(value); - self - } - - pub fn created_at(mut self, value: DateTime) -> Self { - self.created_at = Some(value); - self - } - - pub fn updated_at(mut self, value: DateTime) -> Self { - self.updated_at = Some(value); - self - } - - pub fn expires_at(mut self, value: DateTime) -> Self { - self.expires_at = Some(value); - self - } - - /// Consumes the builder and constructs a [`BrowserConsent`]. - /// This method will fail if any of the following fields are not set: - /// - [`consent_id`](BrowserConsentBuilder::consent_id) - /// - [`inbox_id`](BrowserConsentBuilder::inbox_id) - /// - [`client_type`](BrowserConsentBuilder::client_type) - /// - [`client_id`](BrowserConsentBuilder::client_id) - /// - [`approved_scopes`](BrowserConsentBuilder::approved_scopes) - /// - [`created_at`](BrowserConsentBuilder::created_at) - /// - [`updated_at`](BrowserConsentBuilder::updated_at) - /// - [`expires_at`](BrowserConsentBuilder::expires_at) - pub fn build(self) -> Result { - Ok(BrowserConsent { - consent_id: self.consent_id.ok_or_else(|| BuildError::missing_field("consent_id"))?, - inbox_id: self.inbox_id.ok_or_else(|| BuildError::missing_field("inbox_id"))?, - client_type: self.client_type.ok_or_else(|| BuildError::missing_field("client_type"))?, - client_id: self.client_id.ok_or_else(|| BuildError::missing_field("client_id"))?, - client_url: self.client_url, - approved_scopes: self.approved_scopes.ok_or_else(|| BuildError::missing_field("approved_scopes"))?, - created_at: self.created_at.ok_or_else(|| BuildError::missing_field("created_at"))?, - updated_at: self.updated_at.ok_or_else(|| BuildError::missing_field("updated_at"))?, - expires_at: self.expires_at.ok_or_else(|| BuildError::missing_field("expires_at"))?, - }) - } -} diff --git a/agentmail-types/src/types/browser_consent_client_type.rs b/agentmail-types/src/types/browser_consent_client_type.rs deleted file mode 100644 index 79b540b..0000000 --- a/agentmail-types/src/types/browser_consent_client_type.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub enum BrowserConsentClientType { - #[serde(rename = "closed")] - Closed, -} -impl fmt::Display for BrowserConsentClientType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let s = match self { - Self::Closed => "closed", - }; - write!(f, "{}", s) - } -} diff --git a/agentmail-types/src/types/browser_consent_lifecycle_event.rs b/agentmail-types/src/types/browser_consent_lifecycle_event.rs deleted file mode 100644 index 7d533c1..0000000 --- a/agentmail-types/src/types/browser_consent_lifecycle_event.rs +++ /dev/null @@ -1,125 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub struct BrowserConsentLifecycleEvent { - pub r#type: BrowserConsentLifecycleEventType, - #[serde(default)] - pub trace_id: String, - #[serde(default)] - pub event_id: String, - #[serde(default)] - #[serde(with = "crate::core::flexible_datetime::offset")] - pub occurred_at: DateTime, - #[serde(default)] - pub organization_id: String, - #[serde(default)] - pub pod_id: String, - pub actor: BrowserLifecycleActor, - #[serde(default)] - pub consent_id: String, - pub client_type: BrowserConsentLifecycleEventClientType, - #[serde(default)] - pub client_id: String, -} - -impl BrowserConsentLifecycleEvent { - pub fn builder() -> BrowserConsentLifecycleEventBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct BrowserConsentLifecycleEventBuilder { - r#type: Option, - trace_id: Option, - event_id: Option, - occurred_at: Option>, - organization_id: Option, - pod_id: Option, - actor: Option, - consent_id: Option, - client_type: Option, - client_id: Option, -} - -impl BrowserConsentLifecycleEventBuilder { - pub fn r#type(mut self, value: BrowserConsentLifecycleEventType) -> Self { - self.r#type = Some(value); - self - } - - pub fn trace_id(mut self, value: impl Into) -> Self { - self.trace_id = Some(value.into()); - self - } - - pub fn event_id(mut self, value: impl Into) -> Self { - self.event_id = Some(value.into()); - self - } - - pub fn occurred_at(mut self, value: DateTime) -> Self { - self.occurred_at = Some(value); - self - } - - pub fn organization_id(mut self, value: impl Into) -> Self { - self.organization_id = Some(value.into()); - self - } - - pub fn pod_id(mut self, value: impl Into) -> Self { - self.pod_id = Some(value.into()); - self - } - - pub fn actor(mut self, value: BrowserLifecycleActor) -> Self { - self.actor = Some(value); - self - } - - pub fn consent_id(mut self, value: impl Into) -> Self { - self.consent_id = Some(value.into()); - self - } - - pub fn client_type(mut self, value: BrowserConsentLifecycleEventClientType) -> Self { - self.client_type = Some(value); - self - } - - pub fn client_id(mut self, value: impl Into) -> Self { - self.client_id = Some(value.into()); - self - } - - /// Consumes the builder and constructs a [`BrowserConsentLifecycleEvent`]. - /// This method will fail if any of the following fields are not set: - /// - [`r#type`](BrowserConsentLifecycleEventBuilder::r#type) - /// - [`trace_id`](BrowserConsentLifecycleEventBuilder::trace_id) - /// - [`event_id`](BrowserConsentLifecycleEventBuilder::event_id) - /// - [`occurred_at`](BrowserConsentLifecycleEventBuilder::occurred_at) - /// - [`organization_id`](BrowserConsentLifecycleEventBuilder::organization_id) - /// - [`pod_id`](BrowserConsentLifecycleEventBuilder::pod_id) - /// - [`actor`](BrowserConsentLifecycleEventBuilder::actor) - /// - [`consent_id`](BrowserConsentLifecycleEventBuilder::consent_id) - /// - [`client_type`](BrowserConsentLifecycleEventBuilder::client_type) - /// - [`client_id`](BrowserConsentLifecycleEventBuilder::client_id) - pub fn build(self) -> Result { - Ok(BrowserConsentLifecycleEvent { - r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, - trace_id: self.trace_id.ok_or_else(|| BuildError::missing_field("trace_id"))?, - event_id: self.event_id.ok_or_else(|| BuildError::missing_field("event_id"))?, - occurred_at: self.occurred_at.ok_or_else(|| BuildError::missing_field("occurred_at"))?, - organization_id: self.organization_id.ok_or_else(|| BuildError::missing_field("organization_id"))?, - pod_id: self.pod_id.ok_or_else(|| BuildError::missing_field("pod_id"))?, - actor: self.actor.ok_or_else(|| BuildError::missing_field("actor"))?, - consent_id: self.consent_id.ok_or_else(|| BuildError::missing_field("consent_id"))?, - client_type: self.client_type.ok_or_else(|| BuildError::missing_field("client_type"))?, - client_id: self.client_id.ok_or_else(|| BuildError::missing_field("client_id"))?, - }) - } -} diff --git a/agentmail-types/src/types/browser_consent_lifecycle_event_client_type.rs b/agentmail-types/src/types/browser_consent_lifecycle_event_client_type.rs deleted file mode 100644 index 18876cf..0000000 --- a/agentmail-types/src/types/browser_consent_lifecycle_event_client_type.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub enum BrowserConsentLifecycleEventClientType { - #[serde(rename = "closed")] - Closed, -} -impl fmt::Display for BrowserConsentLifecycleEventClientType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let s = match self { - Self::Closed => "closed", - }; - write!(f, "{}", s) - } -} diff --git a/agentmail-types/src/types/browser_consent_lifecycle_event_type.rs b/agentmail-types/src/types/browser_consent_lifecycle_event_type.rs deleted file mode 100644 index 928a930..0000000 --- a/agentmail-types/src/types/browser_consent_lifecycle_event_type.rs +++ /dev/null @@ -1,52 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[non_exhaustive] -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum BrowserConsentLifecycleEventType { - BrowserConsentCreated, - BrowserConsentUpdated, - BrowserConsentReused, - BrowserConsentRevoked, - /// This variant is used for forward compatibility. - /// If the server sends a value not recognized by the current SDK version, - /// it will be captured here with the raw string value. - __Unknown(String), -} -impl Serialize for BrowserConsentLifecycleEventType { - fn serialize(&self, serializer: S) -> Result { - match self { - Self::BrowserConsentCreated => serializer.serialize_str("browser_consent_created"), - Self::BrowserConsentUpdated => serializer.serialize_str("browser_consent_updated"), - Self::BrowserConsentReused => serializer.serialize_str("browser_consent_reused"), - Self::BrowserConsentRevoked => serializer.serialize_str("browser_consent_revoked"), - Self::__Unknown(val) => serializer.serialize_str(val), - } - } -} - -impl<'de> Deserialize<'de> for BrowserConsentLifecycleEventType { - fn deserialize>(deserializer: D) -> Result { - let value = String::deserialize(deserializer)?; - match value.as_str() { - "browser_consent_created" => Ok(Self::BrowserConsentCreated), - "browser_consent_updated" => Ok(Self::BrowserConsentUpdated), - "browser_consent_reused" => Ok(Self::BrowserConsentReused), - "browser_consent_revoked" => Ok(Self::BrowserConsentRevoked), - _ => Ok(Self::__Unknown(value)), - } - } -} - -impl fmt::Display for BrowserConsentLifecycleEventType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::BrowserConsentCreated => write!(f, "browser_consent_created"), - Self::BrowserConsentUpdated => write!(f, "browser_consent_updated"), - Self::BrowserConsentReused => write!(f, "browser_consent_reused"), - Self::BrowserConsentRevoked => write!(f, "browser_consent_revoked"), - Self::__Unknown(val) => write!(f, "{}", val), - } - } -} diff --git a/agentmail-types/src/types/browser_credential.rs b/agentmail-types/src/types/browser_credential.rs deleted file mode 100644 index 1de1daf..0000000 --- a/agentmail-types/src/types/browser_credential.rs +++ /dev/null @@ -1,109 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -/// Owner-facing metadata for an active browser credential. Private key material never leaves the browser. -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub struct BrowserCredential { - #[serde(default)] - pub credential_id: String, - #[serde(default)] - pub public_key_fingerprint_prefix: String, - #[serde(default)] - pub organization_id: String, - #[serde(default)] - pub pod_id: String, - #[serde(default)] - pub inbox_id: String, - pub created_by: BrowserCredentialCreator, - #[serde(default)] - #[serde(with = "crate::core::flexible_datetime::offset")] - pub created_at: DateTime, - #[serde(default)] - #[serde(with = "crate::core::flexible_datetime::offset")] - pub expires_at: DateTime, -} - -impl BrowserCredential { - pub fn builder() -> BrowserCredentialBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct BrowserCredentialBuilder { - credential_id: Option, - public_key_fingerprint_prefix: Option, - organization_id: Option, - pod_id: Option, - inbox_id: Option, - created_by: Option, - created_at: Option>, - expires_at: Option>, -} - -impl BrowserCredentialBuilder { - pub fn credential_id(mut self, value: impl Into) -> Self { - self.credential_id = Some(value.into()); - self - } - - pub fn public_key_fingerprint_prefix(mut self, value: impl Into) -> Self { - self.public_key_fingerprint_prefix = Some(value.into()); - self - } - - pub fn organization_id(mut self, value: impl Into) -> Self { - self.organization_id = Some(value.into()); - self - } - - pub fn pod_id(mut self, value: impl Into) -> Self { - self.pod_id = Some(value.into()); - self - } - - pub fn inbox_id(mut self, value: impl Into) -> Self { - self.inbox_id = Some(value.into()); - self - } - - pub fn created_by(mut self, value: BrowserCredentialCreator) -> Self { - self.created_by = Some(value); - self - } - - pub fn created_at(mut self, value: DateTime) -> Self { - self.created_at = Some(value); - self - } - - pub fn expires_at(mut self, value: DateTime) -> Self { - self.expires_at = Some(value); - self - } - - /// Consumes the builder and constructs a [`BrowserCredential`]. - /// This method will fail if any of the following fields are not set: - /// - [`credential_id`](BrowserCredentialBuilder::credential_id) - /// - [`public_key_fingerprint_prefix`](BrowserCredentialBuilder::public_key_fingerprint_prefix) - /// - [`organization_id`](BrowserCredentialBuilder::organization_id) - /// - [`pod_id`](BrowserCredentialBuilder::pod_id) - /// - [`inbox_id`](BrowserCredentialBuilder::inbox_id) - /// - [`created_by`](BrowserCredentialBuilder::created_by) - /// - [`created_at`](BrowserCredentialBuilder::created_at) - /// - [`expires_at`](BrowserCredentialBuilder::expires_at) - pub fn build(self) -> Result { - Ok(BrowserCredential { - credential_id: self.credential_id.ok_or_else(|| BuildError::missing_field("credential_id"))?, - public_key_fingerprint_prefix: self.public_key_fingerprint_prefix.ok_or_else(|| BuildError::missing_field("public_key_fingerprint_prefix"))?, - organization_id: self.organization_id.ok_or_else(|| BuildError::missing_field("organization_id"))?, - pod_id: self.pod_id.ok_or_else(|| BuildError::missing_field("pod_id"))?, - inbox_id: self.inbox_id.ok_or_else(|| BuildError::missing_field("inbox_id"))?, - created_by: self.created_by.ok_or_else(|| BuildError::missing_field("created_by"))?, - created_at: self.created_at.ok_or_else(|| BuildError::missing_field("created_at"))?, - expires_at: self.expires_at.ok_or_else(|| BuildError::missing_field("expires_at"))?, - }) - } -} diff --git a/agentmail-types/src/types/browser_credential_creator.rs b/agentmail-types/src/types/browser_credential_creator.rs deleted file mode 100644 index 4e47547..0000000 --- a/agentmail-types/src/types/browser_credential_creator.rs +++ /dev/null @@ -1,59 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub struct BrowserCredentialCreator { - pub kind: BrowserCredentialCreatorKind, - /// Bearer API key that authorized creation of the browser credential. - #[serde(default)] - pub api_key_id: String, - /// Incarnation timestamp of the authorizing bearer API key. - #[serde(default)] - #[serde(with = "crate::core::flexible_datetime::offset")] - pub created_at: DateTime, -} - -impl BrowserCredentialCreator { - pub fn builder() -> BrowserCredentialCreatorBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct BrowserCredentialCreatorBuilder { - kind: Option, - api_key_id: Option, - created_at: Option>, -} - -impl BrowserCredentialCreatorBuilder { - pub fn kind(mut self, value: BrowserCredentialCreatorKind) -> Self { - self.kind = Some(value); - self - } - - pub fn api_key_id(mut self, value: impl Into) -> Self { - self.api_key_id = Some(value.into()); - self - } - - pub fn created_at(mut self, value: DateTime) -> Self { - self.created_at = Some(value); - self - } - - /// Consumes the builder and constructs a [`BrowserCredentialCreator`]. - /// This method will fail if any of the following fields are not set: - /// - [`kind`](BrowserCredentialCreatorBuilder::kind) - /// - [`api_key_id`](BrowserCredentialCreatorBuilder::api_key_id) - /// - [`created_at`](BrowserCredentialCreatorBuilder::created_at) - pub fn build(self) -> Result { - Ok(BrowserCredentialCreator { - kind: self.kind.ok_or_else(|| BuildError::missing_field("kind"))?, - api_key_id: self.api_key_id.ok_or_else(|| BuildError::missing_field("api_key_id"))?, - created_at: self.created_at.ok_or_else(|| BuildError::missing_field("created_at"))?, - }) - } -} diff --git a/agentmail-types/src/types/browser_credential_creator_kind.rs b/agentmail-types/src/types/browser_credential_creator_kind.rs deleted file mode 100644 index f24ba62..0000000 --- a/agentmail-types/src/types/browser_credential_creator_kind.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub enum BrowserCredentialCreatorKind { - #[serde(rename = "bearer_api_key")] - BearerApiKey, -} -impl fmt::Display for BrowserCredentialCreatorKind { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let s = match self { - Self::BearerApiKey => "bearer_api_key", - }; - write!(f, "{}", s) - } -} diff --git a/agentmail-types/src/types/browser_enrollment_accepted.rs b/agentmail-types/src/types/browser_enrollment_accepted.rs deleted file mode 100644 index 3640f22..0000000 --- a/agentmail-types/src/types/browser_enrollment_accepted.rs +++ /dev/null @@ -1,60 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -/// Pending enrollment receipt. The browser completes key creation and proof -/// on the existing AgentID page. This response contains no URL, token, or -/// navigation instruction. -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub struct BrowserEnrollmentAccepted { - pub status: BrowserEnrollmentAcceptedStatus, - #[serde(default)] - pub enrollment_id: String, - /// Unix timestamp after which the pending enrollment cannot be activated. - #[serde(default)] - pub expires_at: i64, -} - -impl BrowserEnrollmentAccepted { - pub fn builder() -> BrowserEnrollmentAcceptedBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct BrowserEnrollmentAcceptedBuilder { - status: Option, - enrollment_id: Option, - expires_at: Option, -} - -impl BrowserEnrollmentAcceptedBuilder { - pub fn status(mut self, value: BrowserEnrollmentAcceptedStatus) -> Self { - self.status = Some(value); - self - } - - pub fn enrollment_id(mut self, value: impl Into) -> Self { - self.enrollment_id = Some(value.into()); - self - } - - pub fn expires_at(mut self, value: i64) -> Self { - self.expires_at = Some(value); - self - } - - /// Consumes the builder and constructs a [`BrowserEnrollmentAccepted`]. - /// This method will fail if any of the following fields are not set: - /// - [`status`](BrowserEnrollmentAcceptedBuilder::status) - /// - [`enrollment_id`](BrowserEnrollmentAcceptedBuilder::enrollment_id) - /// - [`expires_at`](BrowserEnrollmentAcceptedBuilder::expires_at) - pub fn build(self) -> Result { - Ok(BrowserEnrollmentAccepted { - status: self.status.ok_or_else(|| BuildError::missing_field("status"))?, - enrollment_id: self.enrollment_id.ok_or_else(|| BuildError::missing_field("enrollment_id"))?, - expires_at: self.expires_at.ok_or_else(|| BuildError::missing_field("expires_at"))?, - }) - } -} diff --git a/agentmail-types/src/types/browser_enrollment_accepted_status.rs b/agentmail-types/src/types/browser_enrollment_accepted_status.rs deleted file mode 100644 index 13ce663..0000000 --- a/agentmail-types/src/types/browser_enrollment_accepted_status.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub enum BrowserEnrollmentAcceptedStatus { - #[serde(rename = "pending")] - Pending, -} -impl fmt::Display for BrowserEnrollmentAcceptedStatus { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let s = match self { - Self::Pending => "pending", - }; - write!(f, "{}", s) - } -} diff --git a/agentmail-types/src/types/browser_enrollment_lifecycle_event.rs b/agentmail-types/src/types/browser_enrollment_lifecycle_event.rs deleted file mode 100644 index c88c94d..0000000 --- a/agentmail-types/src/types/browser_enrollment_lifecycle_event.rs +++ /dev/null @@ -1,116 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub struct BrowserEnrollmentLifecycleEvent { - pub r#type: BrowserEnrollmentLifecycleEventType, - #[serde(default)] - pub trace_id: String, - #[serde(default)] - pub event_id: String, - #[serde(default)] - #[serde(with = "crate::core::flexible_datetime::offset")] - pub occurred_at: DateTime, - #[serde(default)] - pub organization_id: String, - #[serde(default)] - pub pod_id: String, - pub actor: BrowserLifecycleActor, - #[serde(default)] - pub enrollment_id: String, - #[serde(default)] - pub credential_id: String, -} - -impl BrowserEnrollmentLifecycleEvent { - pub fn builder() -> BrowserEnrollmentLifecycleEventBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct BrowserEnrollmentLifecycleEventBuilder { - r#type: Option, - trace_id: Option, - event_id: Option, - occurred_at: Option>, - organization_id: Option, - pod_id: Option, - actor: Option, - enrollment_id: Option, - credential_id: Option, -} - -impl BrowserEnrollmentLifecycleEventBuilder { - pub fn r#type(mut self, value: BrowserEnrollmentLifecycleEventType) -> Self { - self.r#type = Some(value); - self - } - - pub fn trace_id(mut self, value: impl Into) -> Self { - self.trace_id = Some(value.into()); - self - } - - pub fn event_id(mut self, value: impl Into) -> Self { - self.event_id = Some(value.into()); - self - } - - pub fn occurred_at(mut self, value: DateTime) -> Self { - self.occurred_at = Some(value); - self - } - - pub fn organization_id(mut self, value: impl Into) -> Self { - self.organization_id = Some(value.into()); - self - } - - pub fn pod_id(mut self, value: impl Into) -> Self { - self.pod_id = Some(value.into()); - self - } - - pub fn actor(mut self, value: BrowserLifecycleActor) -> Self { - self.actor = Some(value); - self - } - - pub fn enrollment_id(mut self, value: impl Into) -> Self { - self.enrollment_id = Some(value.into()); - self - } - - pub fn credential_id(mut self, value: impl Into) -> Self { - self.credential_id = Some(value.into()); - self - } - - /// Consumes the builder and constructs a [`BrowserEnrollmentLifecycleEvent`]. - /// This method will fail if any of the following fields are not set: - /// - [`r#type`](BrowserEnrollmentLifecycleEventBuilder::r#type) - /// - [`trace_id`](BrowserEnrollmentLifecycleEventBuilder::trace_id) - /// - [`event_id`](BrowserEnrollmentLifecycleEventBuilder::event_id) - /// - [`occurred_at`](BrowserEnrollmentLifecycleEventBuilder::occurred_at) - /// - [`organization_id`](BrowserEnrollmentLifecycleEventBuilder::organization_id) - /// - [`pod_id`](BrowserEnrollmentLifecycleEventBuilder::pod_id) - /// - [`actor`](BrowserEnrollmentLifecycleEventBuilder::actor) - /// - [`enrollment_id`](BrowserEnrollmentLifecycleEventBuilder::enrollment_id) - /// - [`credential_id`](BrowserEnrollmentLifecycleEventBuilder::credential_id) - pub fn build(self) -> Result { - Ok(BrowserEnrollmentLifecycleEvent { - r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, - trace_id: self.trace_id.ok_or_else(|| BuildError::missing_field("trace_id"))?, - event_id: self.event_id.ok_or_else(|| BuildError::missing_field("event_id"))?, - occurred_at: self.occurred_at.ok_or_else(|| BuildError::missing_field("occurred_at"))?, - organization_id: self.organization_id.ok_or_else(|| BuildError::missing_field("organization_id"))?, - pod_id: self.pod_id.ok_or_else(|| BuildError::missing_field("pod_id"))?, - actor: self.actor.ok_or_else(|| BuildError::missing_field("actor"))?, - enrollment_id: self.enrollment_id.ok_or_else(|| BuildError::missing_field("enrollment_id"))?, - credential_id: self.credential_id.ok_or_else(|| BuildError::missing_field("credential_id"))?, - }) - } -} diff --git a/agentmail-types/src/types/browser_enrollment_lifecycle_event_type.rs b/agentmail-types/src/types/browser_enrollment_lifecycle_event_type.rs deleted file mode 100644 index 223840d..0000000 --- a/agentmail-types/src/types/browser_enrollment_lifecycle_event_type.rs +++ /dev/null @@ -1,52 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[non_exhaustive] -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum BrowserEnrollmentLifecycleEventType { - BrowserEnrollmentIntentCreated, - BrowserCredentialActivated, - BrowserEnrollmentCancelled, - BrowserCredentialDeleted, - /// This variant is used for forward compatibility. - /// If the server sends a value not recognized by the current SDK version, - /// it will be captured here with the raw string value. - __Unknown(String), -} -impl Serialize for BrowserEnrollmentLifecycleEventType { - fn serialize(&self, serializer: S) -> Result { - match self { - Self::BrowserEnrollmentIntentCreated => serializer.serialize_str("browser_enrollment_intent_created"), - Self::BrowserCredentialActivated => serializer.serialize_str("browser_credential_activated"), - Self::BrowserEnrollmentCancelled => serializer.serialize_str("browser_enrollment_cancelled"), - Self::BrowserCredentialDeleted => serializer.serialize_str("browser_credential_deleted"), - Self::__Unknown(val) => serializer.serialize_str(val), - } - } -} - -impl<'de> Deserialize<'de> for BrowserEnrollmentLifecycleEventType { - fn deserialize>(deserializer: D) -> Result { - let value = String::deserialize(deserializer)?; - match value.as_str() { - "browser_enrollment_intent_created" => Ok(Self::BrowserEnrollmentIntentCreated), - "browser_credential_activated" => Ok(Self::BrowserCredentialActivated), - "browser_enrollment_cancelled" => Ok(Self::BrowserEnrollmentCancelled), - "browser_credential_deleted" => Ok(Self::BrowserCredentialDeleted), - _ => Ok(Self::__Unknown(value)), - } - } -} - -impl fmt::Display for BrowserEnrollmentLifecycleEventType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::BrowserEnrollmentIntentCreated => write!(f, "browser_enrollment_intent_created"), - Self::BrowserCredentialActivated => write!(f, "browser_credential_activated"), - Self::BrowserEnrollmentCancelled => write!(f, "browser_enrollment_cancelled"), - Self::BrowserCredentialDeleted => write!(f, "browser_credential_deleted"), - Self::__Unknown(val) => write!(f, "{}", val), - } - } -} diff --git a/agentmail-types/src/types/browser_lifecycle_actor.rs b/agentmail-types/src/types/browser_lifecycle_actor.rs deleted file mode 100644 index 75d9667..0000000 --- a/agentmail-types/src/types/browser_lifecycle_actor.rs +++ /dev/null @@ -1,59 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -#[serde(untagged)] -pub enum BrowserLifecycleActor { - BrowserLifecycleActorZero(BrowserLifecycleActorZero), - - BrowserLifecycleActorOne(BrowserLifecycleActorOne), -} - -impl BrowserLifecycleActor { - pub fn is_browser_lifecycle_actor_zero(&self) -> bool { - matches!(self, Self::BrowserLifecycleActorZero(_)) - } - - pub fn is_browser_lifecycle_actor_one(&self) -> bool { - matches!(self, Self::BrowserLifecycleActorOne(_)) - } - - - pub fn as_browser_lifecycle_actor_zero(&self) -> Option<&BrowserLifecycleActorZero> { - match self { - Self::BrowserLifecycleActorZero(value) => Some(value), - _ => None, - } - } - - pub fn into_browser_lifecycle_actor_zero(self) -> Option { - match self { - Self::BrowserLifecycleActorZero(value) => Some(value), - _ => None, - } - } - - pub fn as_browser_lifecycle_actor_one(&self) -> Option<&BrowserLifecycleActorOne> { - match self { - Self::BrowserLifecycleActorOne(value) => Some(value), - _ => None, - } - } - - pub fn into_browser_lifecycle_actor_one(self) -> Option { - match self { - Self::BrowserLifecycleActorOne(value) => Some(value), - _ => None, - } - } -} - -impl fmt::Display for BrowserLifecycleActor { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::BrowserLifecycleActorZero(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), - Self::BrowserLifecycleActorOne(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), - } - } -} diff --git a/agentmail-types/src/types/browser_lifecycle_actor_one.rs b/agentmail-types/src/types/browser_lifecycle_actor_one.rs deleted file mode 100644 index facdead..0000000 --- a/agentmail-types/src/types/browser_lifecycle_actor_one.rs +++ /dev/null @@ -1,46 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub struct BrowserLifecycleActorOne { - #[serde(flatten)] - pub browser_lifecycle_credential_actor_fields: BrowserLifecycleCredentialActor, - pub r#type: BrowserLifecycleActorOneType, -} - -impl BrowserLifecycleActorOne { - pub fn builder() -> BrowserLifecycleActorOneBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct BrowserLifecycleActorOneBuilder { - browser_lifecycle_credential_actor_fields: Option, - r#type: Option, -} - -impl BrowserLifecycleActorOneBuilder { - pub fn browser_lifecycle_credential_actor_fields(mut self, value: BrowserLifecycleCredentialActor) -> Self { - self.browser_lifecycle_credential_actor_fields = Some(value); - self - } - - pub fn r#type(mut self, value: BrowserLifecycleActorOneType) -> Self { - self.r#type = Some(value); - self - } - - /// Consumes the builder and constructs a [`BrowserLifecycleActorOne`]. - /// This method will fail if any of the following fields are not set: - /// - [`browser_lifecycle_credential_actor_fields`](BrowserLifecycleActorOneBuilder::browser_lifecycle_credential_actor_fields) - /// - [`r#type`](BrowserLifecycleActorOneBuilder::r#type) - pub fn build(self) -> Result { - Ok(BrowserLifecycleActorOne { - browser_lifecycle_credential_actor_fields: self.browser_lifecycle_credential_actor_fields.ok_or_else(|| BuildError::missing_field("browser_lifecycle_credential_actor_fields"))?, - r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, - }) - } -} diff --git a/agentmail-types/src/types/browser_lifecycle_actor_one_type.rs b/agentmail-types/src/types/browser_lifecycle_actor_one_type.rs deleted file mode 100644 index ea40bed..0000000 --- a/agentmail-types/src/types/browser_lifecycle_actor_one_type.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub enum BrowserLifecycleActorOneType { - #[serde(rename = "browser_credential")] - BrowserCredential, -} -impl fmt::Display for BrowserLifecycleActorOneType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let s = match self { - Self::BrowserCredential => "browser_credential", - }; - write!(f, "{}", s) - } -} diff --git a/agentmail-types/src/types/browser_lifecycle_actor_zero.rs b/agentmail-types/src/types/browser_lifecycle_actor_zero.rs deleted file mode 100644 index 2db4012..0000000 --- a/agentmail-types/src/types/browser_lifecycle_actor_zero.rs +++ /dev/null @@ -1,46 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub struct BrowserLifecycleActorZero { - #[serde(flatten)] - pub browser_lifecycle_api_key_actor_fields: BrowserLifecycleApiKeyActor, - pub r#type: BrowserLifecycleActorZeroType, -} - -impl BrowserLifecycleActorZero { - pub fn builder() -> BrowserLifecycleActorZeroBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct BrowserLifecycleActorZeroBuilder { - browser_lifecycle_api_key_actor_fields: Option, - r#type: Option, -} - -impl BrowserLifecycleActorZeroBuilder { - pub fn browser_lifecycle_api_key_actor_fields(mut self, value: BrowserLifecycleApiKeyActor) -> Self { - self.browser_lifecycle_api_key_actor_fields = Some(value); - self - } - - pub fn r#type(mut self, value: BrowserLifecycleActorZeroType) -> Self { - self.r#type = Some(value); - self - } - - /// Consumes the builder and constructs a [`BrowserLifecycleActorZero`]. - /// This method will fail if any of the following fields are not set: - /// - [`browser_lifecycle_api_key_actor_fields`](BrowserLifecycleActorZeroBuilder::browser_lifecycle_api_key_actor_fields) - /// - [`r#type`](BrowserLifecycleActorZeroBuilder::r#type) - pub fn build(self) -> Result { - Ok(BrowserLifecycleActorZero { - browser_lifecycle_api_key_actor_fields: self.browser_lifecycle_api_key_actor_fields.ok_or_else(|| BuildError::missing_field("browser_lifecycle_api_key_actor_fields"))?, - r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, - }) - } -} diff --git a/agentmail-types/src/types/browser_lifecycle_actor_zero_type.rs b/agentmail-types/src/types/browser_lifecycle_actor_zero_type.rs deleted file mode 100644 index 5544c66..0000000 --- a/agentmail-types/src/types/browser_lifecycle_actor_zero_type.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub enum BrowserLifecycleActorZeroType { - #[serde(rename = "api_key")] - ApiKey, -} -impl fmt::Display for BrowserLifecycleActorZeroType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let s = match self { - Self::ApiKey => "api_key", - }; - write!(f, "{}", s) - } -} diff --git a/agentmail-types/src/types/browser_lifecycle_api_key_actor.rs b/agentmail-types/src/types/browser_lifecycle_api_key_actor.rs deleted file mode 100644 index 64bc33d..0000000 --- a/agentmail-types/src/types/browser_lifecycle_api_key_actor.rs +++ /dev/null @@ -1,37 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct BrowserLifecycleApiKeyActor { - #[serde(default)] - pub api_key_id: String, -} - -impl BrowserLifecycleApiKeyActor { - pub fn builder() -> BrowserLifecycleApiKeyActorBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct BrowserLifecycleApiKeyActorBuilder { - api_key_id: Option, -} - -impl BrowserLifecycleApiKeyActorBuilder { - pub fn api_key_id(mut self, value: impl Into) -> Self { - self.api_key_id = Some(value.into()); - self - } - - /// Consumes the builder and constructs a [`BrowserLifecycleApiKeyActor`]. - /// This method will fail if any of the following fields are not set: - /// - [`api_key_id`](BrowserLifecycleApiKeyActorBuilder::api_key_id) - pub fn build(self) -> Result { - Ok(BrowserLifecycleApiKeyActor { - api_key_id: self.api_key_id.ok_or_else(|| BuildError::missing_field("api_key_id"))?, - }) - } -} diff --git a/agentmail-types/src/types/browser_lifecycle_credential_actor.rs b/agentmail-types/src/types/browser_lifecycle_credential_actor.rs deleted file mode 100644 index 4206dda..0000000 --- a/agentmail-types/src/types/browser_lifecycle_credential_actor.rs +++ /dev/null @@ -1,47 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct BrowserLifecycleCredentialActor { - #[serde(default)] - pub credential_id: String, - #[serde(default)] - pub authorizing_api_key_id: String, -} - -impl BrowserLifecycleCredentialActor { - pub fn builder() -> BrowserLifecycleCredentialActorBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct BrowserLifecycleCredentialActorBuilder { - credential_id: Option, - authorizing_api_key_id: Option, -} - -impl BrowserLifecycleCredentialActorBuilder { - pub fn credential_id(mut self, value: impl Into) -> Self { - self.credential_id = Some(value.into()); - self - } - - pub fn authorizing_api_key_id(mut self, value: impl Into) -> Self { - self.authorizing_api_key_id = Some(value.into()); - self - } - - /// Consumes the builder and constructs a [`BrowserLifecycleCredentialActor`]. - /// This method will fail if any of the following fields are not set: - /// - [`credential_id`](BrowserLifecycleCredentialActorBuilder::credential_id) - /// - [`authorizing_api_key_id`](BrowserLifecycleCredentialActorBuilder::authorizing_api_key_id) - pub fn build(self) -> Result { - Ok(BrowserLifecycleCredentialActor { - credential_id: self.credential_id.ok_or_else(|| BuildError::missing_field("credential_id"))?, - authorizing_api_key_id: self.authorizing_api_key_id.ok_or_else(|| BuildError::missing_field("authorizing_api_key_id"))?, - }) - } -} diff --git a/agentmail-types/src/types/browser_lifecycle_event.rs b/agentmail-types/src/types/browser_lifecycle_event.rs deleted file mode 100644 index 84ec85f..0000000 --- a/agentmail-types/src/types/browser_lifecycle_event.rs +++ /dev/null @@ -1,59 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -#[serde(untagged)] -pub enum BrowserLifecycleEvent { - BrowserEnrollmentLifecycleEvent(BrowserEnrollmentLifecycleEvent), - - BrowserConsentLifecycleEvent(BrowserConsentLifecycleEvent), -} - -impl BrowserLifecycleEvent { - pub fn is_browser_enrollment_lifecycle_event(&self) -> bool { - matches!(self, Self::BrowserEnrollmentLifecycleEvent(_)) - } - - pub fn is_browser_consent_lifecycle_event(&self) -> bool { - matches!(self, Self::BrowserConsentLifecycleEvent(_)) - } - - - pub fn as_browser_enrollment_lifecycle_event(&self) -> Option<&BrowserEnrollmentLifecycleEvent> { - match self { - Self::BrowserEnrollmentLifecycleEvent(value) => Some(value), - _ => None, - } - } - - pub fn into_browser_enrollment_lifecycle_event(self) -> Option { - match self { - Self::BrowserEnrollmentLifecycleEvent(value) => Some(value), - _ => None, - } - } - - pub fn as_browser_consent_lifecycle_event(&self) -> Option<&BrowserConsentLifecycleEvent> { - match self { - Self::BrowserConsentLifecycleEvent(value) => Some(value), - _ => None, - } - } - - pub fn into_browser_consent_lifecycle_event(self) -> Option { - match self { - Self::BrowserConsentLifecycleEvent(value) => Some(value), - _ => None, - } - } -} - -impl fmt::Display for BrowserLifecycleEvent { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::BrowserEnrollmentLifecycleEvent(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), - Self::BrowserConsentLifecycleEvent(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), - } - } -} diff --git a/agentmail-types/src/types/connect_accepted.rs b/agentmail-types/src/types/connect_accepted.rs new file mode 100644 index 0000000..591004c --- /dev/null +++ b/agentmail-types/src/types/connect_accepted.rs @@ -0,0 +1,58 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// The pending sign-in key the client will activate. Poll Get API Key with `api_key_id` for `status`. +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct ConnectAccepted { + #[serde(default)] + pub api_key_id: ApiKeyId, + #[serde(default)] + pub magic_url: MagicUrl, + #[serde(default)] + pub expires_at: ExpiresAt, +} + +impl ConnectAccepted { + pub fn builder() -> ConnectAcceptedBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct ConnectAcceptedBuilder { + api_key_id: Option, + magic_url: Option, + expires_at: Option, +} + +impl ConnectAcceptedBuilder { + pub fn api_key_id(mut self, value: ApiKeyId) -> Self { + self.api_key_id = Some(value); + self + } + + pub fn magic_url(mut self, value: MagicUrl) -> Self { + self.magic_url = Some(value); + self + } + + pub fn expires_at(mut self, value: ExpiresAt) -> Self { + self.expires_at = Some(value); + self + } + + /// Consumes the builder and constructs a [`ConnectAccepted`]. + /// This method will fail if any of the following fields are not set: + /// - [`api_key_id`](ConnectAcceptedBuilder::api_key_id) + /// - [`magic_url`](ConnectAcceptedBuilder::magic_url) + /// - [`expires_at`](ConnectAcceptedBuilder::expires_at) + pub fn build(self) -> Result { + Ok(ConnectAccepted { + api_key_id: self.api_key_id.ok_or_else(|| BuildError::missing_field("api_key_id"))?, + magic_url: self.magic_url.ok_or_else(|| BuildError::missing_field("magic_url"))?, + expires_at: self.expires_at.ok_or_else(|| BuildError::missing_field("expires_at"))?, + }) + } +} diff --git a/agentmail-types/src/types/connect_inbox_id.rs b/agentmail-types/src/types/connect_inbox_id.rs new file mode 100644 index 0000000..632095b --- /dev/null +++ b/agentmail-types/src/types/connect_inbox_id.rs @@ -0,0 +1,6 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] +pub struct ConnectInboxId(pub InboxesInboxId); \ No newline at end of file diff --git a/agentmail-types/src/types/connect_provider_accepted.rs b/agentmail-types/src/types/connect_provider_accepted.rs deleted file mode 100644 index bb4f009..0000000 --- a/agentmail-types/src/types/connect_provider_accepted.rs +++ /dev/null @@ -1,61 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct ConnectProviderAccepted { - /// ID of session. - #[serde(default)] - pub session_id: String, - /// Single-use URL to open in the browser that will hold the sign-in. - #[serde(default)] - pub magic_url: String, - /// Time at which the URL expires. - #[serde(default)] - #[serde(with = "crate::core::flexible_datetime::offset")] - pub expires_at: DateTime, -} - -impl ConnectProviderAccepted { - pub fn builder() -> ConnectProviderAcceptedBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct ConnectProviderAcceptedBuilder { - session_id: Option, - magic_url: Option, - expires_at: Option>, -} - -impl ConnectProviderAcceptedBuilder { - pub fn session_id(mut self, value: impl Into) -> Self { - self.session_id = Some(value.into()); - self - } - - pub fn magic_url(mut self, value: impl Into) -> Self { - self.magic_url = Some(value.into()); - self - } - - pub fn expires_at(mut self, value: DateTime) -> Self { - self.expires_at = Some(value); - self - } - - /// Consumes the builder and constructs a [`ConnectProviderAccepted`]. - /// This method will fail if any of the following fields are not set: - /// - [`session_id`](ConnectProviderAcceptedBuilder::session_id) - /// - [`magic_url`](ConnectProviderAcceptedBuilder::magic_url) - /// - [`expires_at`](ConnectProviderAcceptedBuilder::expires_at) - pub fn build(self) -> Result { - Ok(ConnectProviderAccepted { - session_id: self.session_id.ok_or_else(|| BuildError::missing_field("session_id"))?, - magic_url: self.magic_url.ok_or_else(|| BuildError::missing_field("magic_url"))?, - expires_at: self.expires_at.ok_or_else(|| BuildError::missing_field("expires_at"))?, - }) - } -} diff --git a/agentmail-types/src/types/connect_provider_body.rs b/agentmail-types/src/types/connect_provider_body.rs index 047afb3..cf49aab 100644 --- a/agentmail-types/src/types/connect_provider_body.rs +++ b/agentmail-types/src/types/connect_provider_body.rs @@ -4,12 +4,10 @@ use super::*; #[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] pub struct ConnectProviderBody { - /// Inbox to connect. Required unless the API key is scoped to an inbox. #[serde(skip_serializing_if = "Option::is_none")] - pub inbox_id: Option, - /// Authorize the provider for this inbox, skipping the first-use disclosure page. + pub inbox_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub authorize: Option, + pub accept_disclosure: Option, } impl ConnectProviderBody { @@ -21,18 +19,18 @@ impl ConnectProviderBody { #[derive(Clone, PartialEq, Default, Debug)] #[non_exhaustive] pub struct ConnectProviderBodyBuilder { - inbox_id: Option, - authorize: Option, + inbox_id: Option, + accept_disclosure: Option, } impl ConnectProviderBodyBuilder { - pub fn inbox_id(mut self, value: InboxesInboxId) -> Self { + pub fn inbox_id(mut self, value: ConnectInboxId) -> Self { self.inbox_id = Some(value); self } - pub fn authorize(mut self, value: bool) -> Self { - self.authorize = Some(value); + pub fn accept_disclosure(mut self, value: AcceptDisclosure) -> Self { + self.accept_disclosure = Some(value); self } @@ -40,7 +38,7 @@ impl ConnectProviderBodyBuilder { pub fn build(self) -> Result { Ok(ConnectProviderBody { inbox_id: self.inbox_id, - authorize: self.authorize, + accept_disclosure: self.accept_disclosure, }) } } diff --git a/agentmail-types/src/types/create_api_key_request.rs b/agentmail-types/src/types/create_api_key_request.rs index a2c6b83..98c6eb8 100644 --- a/agentmail-types/src/types/create_api_key_request.rs +++ b/agentmail-types/src/types/create_api_key_request.rs @@ -2,43 +2,58 @@ pub use crate::prelude::*; #[allow(unused_imports)] use super::*; -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct CreateApiKeyRequest { - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option, +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[serde(untagged)] +pub enum CreateApiKeyRequest { + CreateBearerApiKeyRequest(CreateBearerApiKeyRequest), + + CreatePublicKeyRequest(CreatePublicKeyRequest), } impl CreateApiKeyRequest { - pub fn builder() -> CreateApiKeyRequestBuilder { - ::default() + pub fn is_create_bearer_api_key_request(&self) -> bool { + matches!(self, Self::CreateBearerApiKeyRequest(_)) + } + + pub fn is_create_public_key_request(&self) -> bool { + matches!(self, Self::CreatePublicKeyRequest(_)) } -} -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct CreateApiKeyRequestBuilder { - name: Option, - permissions: Option, -} -impl CreateApiKeyRequestBuilder { - pub fn name(mut self, value: Name) -> Self { - self.name = Some(value); - self + pub fn as_create_bearer_api_key_request(&self) -> Option<&CreateBearerApiKeyRequest> { + match self { + Self::CreateBearerApiKeyRequest(value) => Some(value), + _ => None, + } } - pub fn permissions(mut self, value: ApiKeyPermissions) -> Self { - self.permissions = Some(value); - self + pub fn into_create_bearer_api_key_request(self) -> Option { + match self { + Self::CreateBearerApiKeyRequest(value) => Some(value), + _ => None, + } } - /// Consumes the builder and constructs a [`CreateApiKeyRequest`]. - pub fn build(self) -> Result { - Ok(CreateApiKeyRequest { - name: self.name, - permissions: self.permissions, - }) + pub fn as_create_public_key_request(&self) -> Option<&CreatePublicKeyRequest> { + match self { + Self::CreatePublicKeyRequest(value) => Some(value), + _ => None, + } + } + + pub fn into_create_public_key_request(self) -> Option { + match self { + Self::CreatePublicKeyRequest(value) => Some(value), + _ => None, + } + } +} + +impl fmt::Display for CreateApiKeyRequest { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::CreateBearerApiKeyRequest(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), + Self::CreatePublicKeyRequest(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), + } } } diff --git a/agentmail-types/src/types/create_api_key_response.rs b/agentmail-types/src/types/create_api_key_response.rs index 7d8a07b..fd3b967 100644 --- a/agentmail-types/src/types/create_api_key_response.rs +++ b/agentmail-types/src/types/create_api_key_response.rs @@ -13,12 +13,10 @@ pub struct CreateApiKeyResponse { pub prefix: Prefix, #[serde(default)] pub name: Name, - /// Pod ID the api key is scoped to. #[serde(skip_serializing_if = "Option::is_none")] - pub pod_id: Option, - /// Inbox ID the api key is scoped to. + pub pod_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub inbox_id: Option, + pub inbox_id: Option, #[serde(skip_serializing_if = "Option::is_none")] pub permissions: Option, #[serde(default)] @@ -38,8 +36,8 @@ pub struct CreateApiKeyResponseBuilder { api_key: Option, prefix: Option, name: Option, - pod_id: Option, - inbox_id: Option, + pod_id: Option, + inbox_id: Option, permissions: Option, created_at: Option, } @@ -65,13 +63,13 @@ impl CreateApiKeyResponseBuilder { self } - pub fn pod_id(mut self, value: impl Into) -> Self { - self.pod_id = Some(value.into()); + pub fn pod_id(mut self, value: PodScopeId) -> Self { + self.pod_id = Some(value); self } - pub fn inbox_id(mut self, value: impl Into) -> Self { - self.inbox_id = Some(value.into()); + pub fn inbox_id(mut self, value: InboxScopeId) -> Self { + self.inbox_id = Some(value); self } diff --git a/agentmail-types/src/types/create_api_key_result.rs b/agentmail-types/src/types/create_api_key_result.rs new file mode 100644 index 0000000..4f27d61 --- /dev/null +++ b/agentmail-types/src/types/create_api_key_result.rs @@ -0,0 +1,59 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +#[serde(untagged)] +pub enum CreateApiKeyResult { + CreateApiKeyResponse(CreateApiKeyResponse), + + PublicKeyCredential(PublicKeyCredential), +} + +impl CreateApiKeyResult { + pub fn is_create_api_key_response(&self) -> bool { + matches!(self, Self::CreateApiKeyResponse(_)) + } + + pub fn is_public_key_credential(&self) -> bool { + matches!(self, Self::PublicKeyCredential(_)) + } + + + pub fn as_create_api_key_response(&self) -> Option<&CreateApiKeyResponse> { + match self { + Self::CreateApiKeyResponse(value) => Some(value), + _ => None, + } + } + + pub fn into_create_api_key_response(self) -> Option { + match self { + Self::CreateApiKeyResponse(value) => Some(value), + _ => None, + } + } + + pub fn as_public_key_credential(&self) -> Option<&PublicKeyCredential> { + match self { + Self::PublicKeyCredential(value) => Some(value), + _ => None, + } + } + + pub fn into_public_key_credential(self) -> Option { + match self { + Self::PublicKeyCredential(value) => Some(value), + _ => None, + } + } +} + +impl fmt::Display for CreateApiKeyResult { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::CreateApiKeyResponse(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), + Self::PublicKeyCredential(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), + } + } +} diff --git a/agentmail-types/src/types/create_bearer_api_key_request.rs b/agentmail-types/src/types/create_bearer_api_key_request.rs new file mode 100644 index 0000000..0439c13 --- /dev/null +++ b/agentmail-types/src/types/create_bearer_api_key_request.rs @@ -0,0 +1,6 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] +pub struct CreateBearerApiKeyRequest(pub ApiKeyMutableFields); \ No newline at end of file diff --git a/agentmail-types/src/types/create_browser_enrollment_request.rs b/agentmail-types/src/types/create_browser_enrollment_request.rs deleted file mode 100644 index 026cfb3..0000000 --- a/agentmail-types/src/types/create_browser_enrollment_request.rs +++ /dev/null @@ -1,38 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct CreateBrowserEnrollmentRequest { - #[serde(default)] - pub transaction_jti: BrowserEnrollmentTransactionJti, -} - -impl CreateBrowserEnrollmentRequest { - pub fn builder() -> CreateBrowserEnrollmentRequestBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct CreateBrowserEnrollmentRequestBuilder { - transaction_jti: Option, -} - -impl CreateBrowserEnrollmentRequestBuilder { - pub fn transaction_jti(mut self, value: BrowserEnrollmentTransactionJti) -> Self { - self.transaction_jti = Some(value); - self - } - - /// Consumes the builder and constructs a [`CreateBrowserEnrollmentRequest`]. - /// This method will fail if any of the following fields are not set: - /// - [`transaction_jti`](CreateBrowserEnrollmentRequestBuilder::transaction_jti) - pub fn build(self) -> Result { - Ok(CreateBrowserEnrollmentRequest { - transaction_jti: self.transaction_jti.ok_or_else(|| BuildError::missing_field("transaction_jti"))?, - }) - } -} - diff --git a/agentmail-types/src/types/create_public_key_request.rs b/agentmail-types/src/types/create_public_key_request.rs index 371d859..054d826 100644 --- a/agentmail-types/src/types/create_public_key_request.rs +++ b/agentmail-types/src/types/create_public_key_request.rs @@ -2,20 +2,23 @@ pub use crate::prelude::*; #[allow(unused_imports)] use super::*; +/// Registers a public P-256 JWK at the route's scope. `type` and +/// `api_key_id` are server-owned. `name` defaults to +/// `AgentID key {first eight fingerprint characters}`; `permissions` +/// defaults to the registering key's, and only grants it holds may be +/// true; `expires_at` defaults to the registering key's expiry and is +/// independent of that key afterward. #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] pub struct CreatePublicKeyRequest { pub public_key: PublicJwk, - /// Defaults to `AgentID key {first eight fingerprint characters}`. #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Omit to inherit the registering bearer key's exact scope. An explicit - /// scope must be the caller's scope or a live descendant. + pub client_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub scope: Option, - /// Future absolute expiry. Omit to inherit the registering bearer key's - /// expiry. A child credential cannot outlive its creator. + pub name: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option>, + pub permissions: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, } impl CreatePublicKeyRequest { @@ -28,9 +31,10 @@ impl CreatePublicKeyRequest { #[non_exhaustive] pub struct CreatePublicKeyRequestBuilder { public_key: Option, - name: Option, - scope: Option, - expires_at: Option>, + client_id: Option, + name: Option, + permissions: Option, + expires_at: Option, } impl CreatePublicKeyRequestBuilder { @@ -39,17 +43,22 @@ impl CreatePublicKeyRequestBuilder { self } - pub fn name(mut self, value: impl Into) -> Self { - self.name = Some(value.into()); + pub fn client_id(mut self, value: PublicKeyClientId) -> Self { + self.client_id = Some(value); self } - pub fn scope(mut self, value: PublicKeyScope) -> Self { - self.scope = Some(value); + pub fn name(mut self, value: Name) -> Self { + self.name = Some(value); self } - pub fn expires_at(mut self, value: DateTime) -> Self { + pub fn permissions(mut self, value: ApiKeyPermissions) -> Self { + self.permissions = Some(value); + self + } + + pub fn expires_at(mut self, value: ExpiresAt) -> Self { self.expires_at = Some(value); self } @@ -60,10 +69,10 @@ impl CreatePublicKeyRequestBuilder { pub fn build(self) -> Result { Ok(CreatePublicKeyRequest { public_key: self.public_key.ok_or_else(|| BuildError::missing_field("public_key"))?, + client_id: self.client_id, name: self.name, - scope: self.scope, + permissions: self.permissions, expires_at: self.expires_at, }) } } - diff --git a/agentmail-types/src/types/expires_at.rs b/agentmail-types/src/types/expires_at.rs new file mode 100644 index 0000000..ab1f263 --- /dev/null +++ b/agentmail-types/src/types/expires_at.rs @@ -0,0 +1,9 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] +pub struct ExpiresAt( + #[serde(deserialize_with = "crate::core::flexible_datetime::offset::deserialize")] + pub DateTime +); \ No newline at end of file diff --git a/agentmail-types/src/types/inbox_public_key_scope.rs b/agentmail-types/src/types/inbox_public_key_scope.rs deleted file mode 100644 index 696b945..0000000 --- a/agentmail-types/src/types/inbox_public_key_scope.rs +++ /dev/null @@ -1,39 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -/// Authority over one live inbox incarnation. -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct InboxPublicKeyScope { - /// ID of the inbox. - #[serde(default)] - pub id: String, -} - -impl InboxPublicKeyScope { - pub fn builder() -> InboxPublicKeyScopeBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct InboxPublicKeyScopeBuilder { - id: Option, -} - -impl InboxPublicKeyScopeBuilder { - pub fn id(mut self, value: impl Into) -> Self { - self.id = Some(value.into()); - self - } - - /// Consumes the builder and constructs a [`InboxPublicKeyScope`]. - /// This method will fail if any of the following fields are not set: - /// - [`id`](InboxPublicKeyScopeBuilder::id) - pub fn build(self) -> Result { - Ok(InboxPublicKeyScope { - id: self.id.ok_or_else(|| BuildError::missing_field("id"))?, - }) - } -} diff --git a/agentmail-types/src/types/inbox_scope_id.rs b/agentmail-types/src/types/inbox_scope_id.rs new file mode 100644 index 0000000..09598ec --- /dev/null +++ b/agentmail-types/src/types/inbox_scope_id.rs @@ -0,0 +1,6 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] +pub struct InboxScopeId(pub String); \ No newline at end of file diff --git a/agentmail-types/src/types/inboxes_authorize_inbox_request.rs b/agentmail-types/src/types/inboxes_authorize_inbox_request.rs new file mode 100644 index 0000000..9ea4f12 --- /dev/null +++ b/agentmail-types/src/types/inboxes_authorize_inbox_request.rs @@ -0,0 +1,47 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct InboxesAuthorizeInboxRequest { + #[serde(default)] + pub auth_token: AuthToken, + #[serde(skip_serializing_if = "Option::is_none")] + pub accept_disclosure: Option, +} + +impl InboxesAuthorizeInboxRequest { + pub fn builder() -> InboxesAuthorizeInboxRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct InboxesAuthorizeInboxRequestBuilder { + auth_token: Option, + accept_disclosure: Option, +} + +impl InboxesAuthorizeInboxRequestBuilder { + pub fn auth_token(mut self, value: AuthToken) -> Self { + self.auth_token = Some(value); + self + } + + pub fn accept_disclosure(mut self, value: AcceptDisclosure) -> Self { + self.accept_disclosure = Some(value); + self + } + + /// Consumes the builder and constructs a [`InboxesAuthorizeInboxRequest`]. + /// This method will fail if any of the following fields are not set: + /// - [`auth_token`](InboxesAuthorizeInboxRequestBuilder::auth_token) + pub fn build(self) -> Result { + Ok(InboxesAuthorizeInboxRequest { + auth_token: self.auth_token.ok_or_else(|| BuildError::missing_field("auth_token"))?, + accept_disclosure: self.accept_disclosure, + }) + } +} + diff --git a/agentmail-types/src/types/inboxes_search_inboxes_response.rs b/agentmail-types/src/types/inboxes_search_inboxes_response.rs new file mode 100644 index 0000000..8b4ff49 --- /dev/null +++ b/agentmail-types/src/types/inboxes_search_inboxes_response.rs @@ -0,0 +1,66 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] +pub struct InboxesSearchInboxesResponse { + #[serde(default)] + pub count: Count, + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub next_page_token: Option, + /// Ordered by relevance, best match first. + #[serde(default)] + pub inboxes: Vec, +} + +impl InboxesSearchInboxesResponse { + pub fn builder() -> InboxesSearchInboxesResponseBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct InboxesSearchInboxesResponseBuilder { + count: Option, + limit: Option, + next_page_token: Option, + inboxes: Option>, +} + +impl InboxesSearchInboxesResponseBuilder { + pub fn count(mut self, value: Count) -> Self { + self.count = Some(value); + self + } + + pub fn limit(mut self, value: Limit) -> Self { + self.limit = Some(value); + self + } + + pub fn next_page_token(mut self, value: PageToken) -> Self { + self.next_page_token = Some(value); + self + } + + pub fn inboxes(mut self, value: Vec) -> Self { + self.inboxes = Some(value); + self + } + + /// Consumes the builder and constructs a [`InboxesSearchInboxesResponse`]. + /// This method will fail if any of the following fields are not set: + /// - [`count`](InboxesSearchInboxesResponseBuilder::count) + /// - [`inboxes`](InboxesSearchInboxesResponseBuilder::inboxes) + pub fn build(self) -> Result { + Ok(InboxesSearchInboxesResponse { + count: self.count.ok_or_else(|| BuildError::missing_field("count"))?, + limit: self.limit, + next_page_token: self.next_page_token, + inboxes: self.inboxes.ok_or_else(|| BuildError::missing_field("inboxes"))?, + }) + } +} diff --git a/agentmail-types/src/types/inboxes_search_query_request.rs b/agentmail-types/src/types/inboxes_search_query_request.rs new file mode 100644 index 0000000..bbafd5d --- /dev/null +++ b/agentmail-types/src/types/inboxes_search_query_request.rs @@ -0,0 +1,58 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Query parameters for search +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct InboxesSearchQueryRequest { + /// Address or display name to search for. Matches word prefixes. Must be 2 to 256 characters. + #[serde(default)] + pub q: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub page_token: Option, +} + +impl InboxesSearchQueryRequest { + pub fn builder() -> InboxesSearchQueryRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct InboxesSearchQueryRequestBuilder { + q: Option, + limit: Option, + page_token: Option, +} + +impl InboxesSearchQueryRequestBuilder { + pub fn q(mut self, value: impl Into) -> Self { + self.q = Some(value.into()); + self + } + + pub fn limit(mut self, value: Limit) -> Self { + self.limit = Some(value); + self + } + + pub fn page_token(mut self, value: PageToken) -> Self { + self.page_token = Some(value); + self + } + + /// Consumes the builder and constructs a [`InboxesSearchQueryRequest`]. + /// This method will fail if any of the following fields are not set: + /// - [`q`](InboxesSearchQueryRequestBuilder::q) + pub fn build(self) -> Result { + Ok(InboxesSearchQueryRequest { + q: self.q.ok_or_else(|| BuildError::missing_field("q"))?, + limit: self.limit, + page_token: self.page_token, + }) + } +} + diff --git a/agentmail-types/src/types/inboxes_threads_get_query_request.rs b/agentmail-types/src/types/inboxes_threads_get_query_request.rs new file mode 100644 index 0000000..5697efc --- /dev/null +++ b/agentmail-types/src/types/inboxes_threads_get_query_request.rs @@ -0,0 +1,48 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Query parameters for get +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct InboxesThreadsGetQueryRequest { + /// Maximum number of messages to return. Cannot exceed 100. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Token returned by the previous response for retrieving the next, older page. + #[serde(skip_serializing_if = "Option::is_none")] + pub page_token: Option, +} + +impl InboxesThreadsGetQueryRequest { + pub fn builder() -> InboxesThreadsGetQueryRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct InboxesThreadsGetQueryRequestBuilder { + limit: Option, + page_token: Option, +} + +impl InboxesThreadsGetQueryRequestBuilder { + pub fn limit(mut self, value: Limit) -> Self { + self.limit = Some(value); + self + } + + pub fn page_token(mut self, value: PageToken) -> Self { + self.page_token = Some(value); + self + } + + /// Consumes the builder and constructs a [`InboxesThreadsGetQueryRequest`]. + pub fn build(self) -> Result { + Ok(InboxesThreadsGetQueryRequest { + limit: self.limit, + page_token: self.page_token, + }) + } +} + diff --git a/agentmail-types/src/types/list_api_keys_response.rs b/agentmail-types/src/types/list_api_keys_response.rs index dc6468b..2639ef5 100644 --- a/agentmail-types/src/types/list_api_keys_response.rs +++ b/agentmail-types/src/types/list_api_keys_response.rs @@ -2,13 +2,14 @@ pub use crate::prelude::*; #[allow(unused_imports)] use super::*; -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] pub struct ListApiKeysResponse { #[serde(default)] pub count: Count, #[serde(skip_serializing_if = "Option::is_none")] pub next_page_token: Option, - /// Ordered by `created_at` descending. + /// Every credential family, ordered by `created_at`. `type` restricts + /// to one family. #[serde(default)] pub api_keys: Vec, } diff --git a/agentmail-types/src/types/list_browser_consents_query_request.rs b/agentmail-types/src/types/list_browser_consents_query_request.rs deleted file mode 100644 index 77a9737..0000000 --- a/agentmail-types/src/types/list_browser_consents_query_request.rs +++ /dev/null @@ -1,57 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -/// Query parameters for list-browser-consents -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct ListBrowserConsentsQueryRequest { - #[serde(default)] - pub inbox_id: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page_token: Option, -} - -impl ListBrowserConsentsQueryRequest { - pub fn builder() -> ListBrowserConsentsQueryRequestBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct ListBrowserConsentsQueryRequestBuilder { - inbox_id: Option, - limit: Option, - page_token: Option, -} - -impl ListBrowserConsentsQueryRequestBuilder { - pub fn inbox_id(mut self, value: impl Into) -> Self { - self.inbox_id = Some(value.into()); - self - } - - pub fn limit(mut self, value: BrowserAuthorizationListLimit) -> Self { - self.limit = Some(value); - self - } - - pub fn page_token(mut self, value: PageToken) -> Self { - self.page_token = Some(value); - self - } - - /// Consumes the builder and constructs a [`ListBrowserConsentsQueryRequest`]. - /// This method will fail if any of the following fields are not set: - /// - [`inbox_id`](ListBrowserConsentsQueryRequestBuilder::inbox_id) - pub fn build(self) -> Result { - Ok(ListBrowserConsentsQueryRequest { - inbox_id: self.inbox_id.ok_or_else(|| BuildError::missing_field("inbox_id"))?, - limit: self.limit, - page_token: self.page_token, - }) - } -} - diff --git a/agentmail-types/src/types/list_browser_consents_response.rs b/agentmail-types/src/types/list_browser_consents_response.rs deleted file mode 100644 index 2d88a87..0000000 --- a/agentmail-types/src/types/list_browser_consents_response.rs +++ /dev/null @@ -1,66 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct ListBrowserConsentsResponse { - #[serde(default)] - pub count: Count, - #[serde(default)] - pub limit: BrowserAuthorizationListLimit, - #[serde(skip_serializing_if = "Option::is_none")] - pub next_page_token: Option, - #[serde(default)] - pub consents: Vec, -} - -impl ListBrowserConsentsResponse { - pub fn builder() -> ListBrowserConsentsResponseBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct ListBrowserConsentsResponseBuilder { - count: Option, - limit: Option, - next_page_token: Option, - consents: Option>, -} - -impl ListBrowserConsentsResponseBuilder { - pub fn count(mut self, value: Count) -> Self { - self.count = Some(value); - self - } - - pub fn limit(mut self, value: BrowserAuthorizationListLimit) -> Self { - self.limit = Some(value); - self - } - - pub fn next_page_token(mut self, value: PageToken) -> Self { - self.next_page_token = Some(value); - self - } - - pub fn consents(mut self, value: Vec) -> Self { - self.consents = Some(value); - self - } - - /// Consumes the builder and constructs a [`ListBrowserConsentsResponse`]. - /// This method will fail if any of the following fields are not set: - /// - [`count`](ListBrowserConsentsResponseBuilder::count) - /// - [`limit`](ListBrowserConsentsResponseBuilder::limit) - /// - [`consents`](ListBrowserConsentsResponseBuilder::consents) - pub fn build(self) -> Result { - Ok(ListBrowserConsentsResponse { - count: self.count.ok_or_else(|| BuildError::missing_field("count"))?, - limit: self.limit.ok_or_else(|| BuildError::missing_field("limit"))?, - next_page_token: self.next_page_token, - consents: self.consents.ok_or_else(|| BuildError::missing_field("consents"))?, - }) - } -} diff --git a/agentmail-types/src/types/list_browser_credential_events_query_request.rs b/agentmail-types/src/types/list_browser_credential_events_query_request.rs deleted file mode 100644 index 6a2da05..0000000 --- a/agentmail-types/src/types/list_browser_credential_events_query_request.rs +++ /dev/null @@ -1,46 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -/// Query parameters for list-browser-credential-events -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct ListBrowserCredentialEventsQueryRequest { - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page_token: Option, -} - -impl ListBrowserCredentialEventsQueryRequest { - pub fn builder() -> ListBrowserCredentialEventsQueryRequestBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct ListBrowserCredentialEventsQueryRequestBuilder { - limit: Option, - page_token: Option, -} - -impl ListBrowserCredentialEventsQueryRequestBuilder { - pub fn limit(mut self, value: BrowserAuthorizationListLimit) -> Self { - self.limit = Some(value); - self - } - - pub fn page_token(mut self, value: PageToken) -> Self { - self.page_token = Some(value); - self - } - - /// Consumes the builder and constructs a [`ListBrowserCredentialEventsQueryRequest`]. - pub fn build(self) -> Result { - Ok(ListBrowserCredentialEventsQueryRequest { - limit: self.limit, - page_token: self.page_token, - }) - } -} - diff --git a/agentmail-types/src/types/list_browser_credentials_query_request.rs b/agentmail-types/src/types/list_browser_credentials_query_request.rs deleted file mode 100644 index 814498d..0000000 --- a/agentmail-types/src/types/list_browser_credentials_query_request.rs +++ /dev/null @@ -1,46 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -/// Query parameters for list-browser-credentials -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct ListBrowserCredentialsQueryRequest { - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page_token: Option, -} - -impl ListBrowserCredentialsQueryRequest { - pub fn builder() -> ListBrowserCredentialsQueryRequestBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct ListBrowserCredentialsQueryRequestBuilder { - limit: Option, - page_token: Option, -} - -impl ListBrowserCredentialsQueryRequestBuilder { - pub fn limit(mut self, value: BrowserAuthorizationListLimit) -> Self { - self.limit = Some(value); - self - } - - pub fn page_token(mut self, value: PageToken) -> Self { - self.page_token = Some(value); - self - } - - /// Consumes the builder and constructs a [`ListBrowserCredentialsQueryRequest`]. - pub fn build(self) -> Result { - Ok(ListBrowserCredentialsQueryRequest { - limit: self.limit, - page_token: self.page_token, - }) - } -} - diff --git a/agentmail-types/src/types/list_browser_credentials_response.rs b/agentmail-types/src/types/list_browser_credentials_response.rs deleted file mode 100644 index b02e3f6..0000000 --- a/agentmail-types/src/types/list_browser_credentials_response.rs +++ /dev/null @@ -1,66 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct ListBrowserCredentialsResponse { - #[serde(default)] - pub count: Count, - #[serde(default)] - pub limit: BrowserAuthorizationListLimit, - #[serde(skip_serializing_if = "Option::is_none")] - pub next_page_token: Option, - #[serde(default)] - pub credentials: Vec, -} - -impl ListBrowserCredentialsResponse { - pub fn builder() -> ListBrowserCredentialsResponseBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct ListBrowserCredentialsResponseBuilder { - count: Option, - limit: Option, - next_page_token: Option, - credentials: Option>, -} - -impl ListBrowserCredentialsResponseBuilder { - pub fn count(mut self, value: Count) -> Self { - self.count = Some(value); - self - } - - pub fn limit(mut self, value: BrowserAuthorizationListLimit) -> Self { - self.limit = Some(value); - self - } - - pub fn next_page_token(mut self, value: PageToken) -> Self { - self.next_page_token = Some(value); - self - } - - pub fn credentials(mut self, value: Vec) -> Self { - self.credentials = Some(value); - self - } - - /// Consumes the builder and constructs a [`ListBrowserCredentialsResponse`]. - /// This method will fail if any of the following fields are not set: - /// - [`count`](ListBrowserCredentialsResponseBuilder::count) - /// - [`limit`](ListBrowserCredentialsResponseBuilder::limit) - /// - [`credentials`](ListBrowserCredentialsResponseBuilder::credentials) - pub fn build(self) -> Result { - Ok(ListBrowserCredentialsResponse { - count: self.count.ok_or_else(|| BuildError::missing_field("count"))?, - limit: self.limit.ok_or_else(|| BuildError::missing_field("limit"))?, - next_page_token: self.next_page_token, - credentials: self.credentials.ok_or_else(|| BuildError::missing_field("credentials"))?, - }) - } -} diff --git a/agentmail-types/src/types/list_browser_lifecycle_events_response.rs b/agentmail-types/src/types/list_browser_lifecycle_events_response.rs deleted file mode 100644 index 0fdce23..0000000 --- a/agentmail-types/src/types/list_browser_lifecycle_events_response.rs +++ /dev/null @@ -1,66 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct ListBrowserLifecycleEventsResponse { - #[serde(default)] - pub count: Count, - #[serde(default)] - pub limit: BrowserAuthorizationListLimit, - #[serde(skip_serializing_if = "Option::is_none")] - pub next_page_token: Option, - #[serde(default)] - pub events: Vec, -} - -impl ListBrowserLifecycleEventsResponse { - pub fn builder() -> ListBrowserLifecycleEventsResponseBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct ListBrowserLifecycleEventsResponseBuilder { - count: Option, - limit: Option, - next_page_token: Option, - events: Option>, -} - -impl ListBrowserLifecycleEventsResponseBuilder { - pub fn count(mut self, value: Count) -> Self { - self.count = Some(value); - self - } - - pub fn limit(mut self, value: BrowserAuthorizationListLimit) -> Self { - self.limit = Some(value); - self - } - - pub fn next_page_token(mut self, value: PageToken) -> Self { - self.next_page_token = Some(value); - self - } - - pub fn events(mut self, value: Vec) -> Self { - self.events = Some(value); - self - } - - /// Consumes the builder and constructs a [`ListBrowserLifecycleEventsResponse`]. - /// This method will fail if any of the following fields are not set: - /// - [`count`](ListBrowserLifecycleEventsResponseBuilder::count) - /// - [`limit`](ListBrowserLifecycleEventsResponseBuilder::limit) - /// - [`events`](ListBrowserLifecycleEventsResponseBuilder::events) - pub fn build(self) -> Result { - Ok(ListBrowserLifecycleEventsResponse { - count: self.count.ok_or_else(|| BuildError::missing_field("count"))?, - limit: self.limit.ok_or_else(|| BuildError::missing_field("limit"))?, - next_page_token: self.next_page_token, - events: self.events.ok_or_else(|| BuildError::missing_field("events"))?, - }) - } -} diff --git a/agentmail-types/src/types/list_public_keys_response.rs b/agentmail-types/src/types/list_public_keys_response.rs deleted file mode 100644 index a611e80..0000000 --- a/agentmail-types/src/types/list_public_keys_response.rs +++ /dev/null @@ -1,57 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct ListPublicKeysResponse { - #[serde(default)] - pub count: Count, - #[serde(skip_serializing_if = "Option::is_none")] - pub next_page_token: Option, - /// Public-key credentials only, ordered by creation time descending by default. - #[serde(default)] - pub public_keys: Vec, -} - -impl ListPublicKeysResponse { - pub fn builder() -> ListPublicKeysResponseBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct ListPublicKeysResponseBuilder { - count: Option, - next_page_token: Option, - public_keys: Option>, -} - -impl ListPublicKeysResponseBuilder { - pub fn count(mut self, value: Count) -> Self { - self.count = Some(value); - self - } - - pub fn next_page_token(mut self, value: PageToken) -> Self { - self.next_page_token = Some(value); - self - } - - pub fn public_keys(mut self, value: Vec) -> Self { - self.public_keys = Some(value); - self - } - - /// Consumes the builder and constructs a [`ListPublicKeysResponse`]. - /// This method will fail if any of the following fields are not set: - /// - [`count`](ListPublicKeysResponseBuilder::count) - /// - [`public_keys`](ListPublicKeysResponseBuilder::public_keys) - pub fn build(self) -> Result { - Ok(ListPublicKeysResponse { - count: self.count.ok_or_else(|| BuildError::missing_field("count"))?, - next_page_token: self.next_page_token, - public_keys: self.public_keys.ok_or_else(|| BuildError::missing_field("public_keys"))?, - }) - } -} diff --git a/agentmail-types/src/types/magic_url.rs b/agentmail-types/src/types/magic_url.rs new file mode 100644 index 0000000..695ca4a --- /dev/null +++ b/agentmail-types/src/types/magic_url.rs @@ -0,0 +1,6 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] +pub struct MagicUrl(pub String); \ No newline at end of file diff --git a/agentmail-types/src/types/mod.rs b/agentmail-types/src/types/mod.rs index 1d20a63..6bbfe9d 100644 --- a/agentmail-types/src/types/mod.rs +++ b/agentmail-types/src/types/mod.rs @@ -5,8 +5,8 @@ //! //! ## Type Categories //! -//! - **Request/Response Types**: 107 types for API operations -//! - **Model Types**: 250 types for data representation +//! - **Request/Response Types**: 105 types for API operations +//! - **Model Types**: 233 types for data representation pub mod limit; pub mod count; @@ -37,6 +37,7 @@ pub mod inboxes_metadata; pub mod inboxes_update_metadata; pub mod inboxes_inbox; pub mod inboxes_list_inboxes_response; +pub mod inboxes_search_inboxes_response; pub mod inboxes_create_inbox_request; pub mod inboxes_update_inbox_request; pub mod pods_pod_id; @@ -68,55 +69,34 @@ pub mod api_key_id; pub mod prefix; pub mod name; pub mod created_at; +pub mod updated_at; +pub mod expires_at; +pub mod used_at; +pub mod pod_scope_id; +pub mod inbox_scope_id; +pub mod public_key_client_id; +pub mod accept_disclosure; pub mod public_jwk_coordinate; pub mod public_jwk_kty; pub mod public_jwk_crv; pub mod public_jwk; -pub mod organization_public_key_scope; -pub mod pod_public_key_scope; -pub mod inbox_public_key_scope; -pub mod public_key_scope_zero_type; -pub mod public_key_scope_zero; -pub mod public_key_scope_one_type; -pub mod public_key_scope_one; -pub mod public_key_scope_two_type; -pub mod public_key_scope_two; -pub mod public_key_scope; pub mod public_key_material; pub mod public_key_credential_type; pub mod public_key_credential; -pub mod list_public_keys_response; -pub mod revoke_all_agent_id_sign_in_keys_response; -pub mod browser_enrollment_transaction_jti; -pub mod browser_enrollment_accepted_status; -pub mod browser_enrollment_accepted; -pub mod browser_credential_creator_kind; -pub mod browser_credential_creator; -pub mod browser_credential; -pub mod browser_consent_client_type; -pub mod browser_consent; -pub mod browser_lifecycle_api_key_actor; -pub mod browser_lifecycle_credential_actor; -pub mod browser_lifecycle_actor_zero_type; -pub mod browser_lifecycle_actor_zero; -pub mod browser_lifecycle_actor_one_type; -pub mod browser_lifecycle_actor_one; -pub mod browser_lifecycle_actor; -pub mod browser_enrollment_lifecycle_event_type; -pub mod browser_consent_lifecycle_event_type; -pub mod browser_enrollment_lifecycle_event; -pub mod browser_consent_lifecycle_event_client_type; -pub mod browser_consent_lifecycle_event; -pub mod browser_lifecycle_event; -pub mod browser_authorization_list_limit; -pub mod list_browser_credentials_response; -pub mod list_browser_consents_response; -pub mod list_browser_lifecycle_events_response; +pub mod create_public_key_request; +pub mod auth_token; pub mod api_key_permissions; +pub mod api_key_creator; +pub mod public_key_status; pub mod api_key; +pub mod api_key_type; pub mod create_api_key_response; pub mod list_api_keys_response; +pub mod api_key_mutable_fields; +pub mod create_bearer_api_key_request; pub mod create_api_key_request; +pub mod create_api_key_result; +pub mod update_api_key_request; pub mod attachment_id; pub mod attachment_filename; pub mod attachment_size; @@ -277,7 +257,9 @@ pub mod provider; pub mod list_providers_response; pub mod search_providers_response; pub mod list_provider_accounts_response; -pub mod connect_provider_accepted; +pub mod connect_inbox_id; +pub mod magic_url; +pub mod connect_accepted; pub mod thread_id; pub mod thread_labels; pub mod thread_timestamp; @@ -310,15 +292,13 @@ pub mod subscribed_type; pub mod subscribed; pub mod error_type; pub mod error_model; +pub mod inboxes_authorize_inbox_request; pub mod pods_create_pod_request; pub mod webhooks_create_webhook_request; pub mod webhooks_update_webhook_request; pub mod agent_signup_request; pub mod agent_verify_request; -pub mod create_public_key_request; -pub mod update_public_key_name_request; pub mod connect_provider_body; -pub mod create_browser_enrollment_request; pub mod create_draft_request; pub mod update_draft_request; pub mod batch_get_messages_request; @@ -326,14 +306,11 @@ pub mod batch_update_messages_request; pub mod reply_to_message_request; pub mod reply_all_message_request; pub mod inboxes_list_query_request; +pub mod inboxes_search_query_request; pub mod pods_list_query_request; pub mod webhooks_list_query_request; pub mod accounts_list_query_request; pub mod api_keys_list_query_request; -pub mod list_public_keys_query_request; -pub mod list_browser_credentials_query_request; -pub mod list_browser_credential_events_query_request; -pub mod list_browser_consents_query_request; pub mod domains_list_query_request; pub mod drafts_list_query_request; pub mod lists_list_query_request; @@ -344,6 +321,7 @@ pub mod providers_search_query_request; pub mod list_accounts_query_request; pub mod threads_list_query_request; pub mod threads_search_query_request; +pub mod threads_get_query_request; pub mod inboxes_api_keys_list_query_request; pub mod inboxes_drafts_list_query_request; pub mod inboxes_events_list_query_request; @@ -354,16 +332,19 @@ pub mod inboxes_metrics_query_events_query_request; pub mod inboxes_metrics_query_usage_query_request; pub mod inboxes_threads_list_query_request; pub mod inboxes_threads_search_query_request; +pub mod inboxes_threads_get_query_request; pub mod inboxes_webhooks_list_query_request; pub mod pods_api_keys_list_query_request; pub mod pods_domains_list_query_request; pub mod pods_drafts_list_query_request; pub mod pods_inboxes_list_query_request; +pub mod pods_inboxes_search_query_request; pub mod pods_lists_list_query_request; pub mod pods_metrics_query_events_query_request; pub mod pods_metrics_query_usage_query_request; pub mod pods_threads_list_query_request; pub mod pods_threads_search_query_request; +pub mod pods_threads_get_query_request; pub mod pods_webhooks_list_query_request; pub use limit::Limit; @@ -395,6 +376,7 @@ pub use inboxes_metadata::InboxesMetadata; pub use inboxes_update_metadata::InboxesUpdateMetadata; pub use inboxes_inbox::InboxesInbox; pub use inboxes_list_inboxes_response::InboxesListInboxesResponse; +pub use inboxes_search_inboxes_response::InboxesSearchInboxesResponse; pub use inboxes_create_inbox_request::InboxesCreateInboxRequest; pub use inboxes_update_inbox_request::InboxesUpdateInboxRequest; pub use pods_pod_id::PodsPodId; @@ -426,55 +408,34 @@ pub use api_key_id::ApiKeyId; pub use prefix::Prefix; pub use name::Name; pub use created_at::CreatedAt; +pub use updated_at::UpdatedAt; +pub use expires_at::ExpiresAt; +pub use used_at::UsedAt; +pub use pod_scope_id::PodScopeId; +pub use inbox_scope_id::InboxScopeId; +pub use public_key_client_id::PublicKeyClientId; +pub use accept_disclosure::AcceptDisclosure; pub use public_jwk_coordinate::PublicJwkCoordinate; pub use public_jwk_kty::PublicJwkKty; pub use public_jwk_crv::PublicJwkCrv; pub use public_jwk::PublicJwk; -pub use organization_public_key_scope::OrganizationPublicKeyScope; -pub use pod_public_key_scope::PodPublicKeyScope; -pub use inbox_public_key_scope::InboxPublicKeyScope; -pub use public_key_scope_zero_type::PublicKeyScopeZeroType; -pub use public_key_scope_zero::PublicKeyScopeZero; -pub use public_key_scope_one_type::PublicKeyScopeOneType; -pub use public_key_scope_one::PublicKeyScopeOne; -pub use public_key_scope_two_type::PublicKeyScopeTwoType; -pub use public_key_scope_two::PublicKeyScopeTwo; -pub use public_key_scope::PublicKeyScope; pub use public_key_material::PublicKeyMaterial; pub use public_key_credential_type::PublicKeyCredentialType; pub use public_key_credential::PublicKeyCredential; -pub use list_public_keys_response::ListPublicKeysResponse; -pub use revoke_all_agent_id_sign_in_keys_response::RevokeAllAgentIdSignInKeysResponse; -pub use browser_enrollment_transaction_jti::BrowserEnrollmentTransactionJti; -pub use browser_enrollment_accepted_status::BrowserEnrollmentAcceptedStatus; -pub use browser_enrollment_accepted::BrowserEnrollmentAccepted; -pub use browser_credential_creator_kind::BrowserCredentialCreatorKind; -pub use browser_credential_creator::BrowserCredentialCreator; -pub use browser_credential::BrowserCredential; -pub use browser_consent_client_type::BrowserConsentClientType; -pub use browser_consent::BrowserConsent; -pub use browser_lifecycle_api_key_actor::BrowserLifecycleApiKeyActor; -pub use browser_lifecycle_credential_actor::BrowserLifecycleCredentialActor; -pub use browser_lifecycle_actor_zero_type::BrowserLifecycleActorZeroType; -pub use browser_lifecycle_actor_zero::BrowserLifecycleActorZero; -pub use browser_lifecycle_actor_one_type::BrowserLifecycleActorOneType; -pub use browser_lifecycle_actor_one::BrowserLifecycleActorOne; -pub use browser_lifecycle_actor::BrowserLifecycleActor; -pub use browser_enrollment_lifecycle_event_type::BrowserEnrollmentLifecycleEventType; -pub use browser_consent_lifecycle_event_type::BrowserConsentLifecycleEventType; -pub use browser_enrollment_lifecycle_event::BrowserEnrollmentLifecycleEvent; -pub use browser_consent_lifecycle_event_client_type::BrowserConsentLifecycleEventClientType; -pub use browser_consent_lifecycle_event::BrowserConsentLifecycleEvent; -pub use browser_lifecycle_event::BrowserLifecycleEvent; -pub use browser_authorization_list_limit::BrowserAuthorizationListLimit; -pub use list_browser_credentials_response::ListBrowserCredentialsResponse; -pub use list_browser_consents_response::ListBrowserConsentsResponse; -pub use list_browser_lifecycle_events_response::ListBrowserLifecycleEventsResponse; +pub use create_public_key_request::CreatePublicKeyRequest; +pub use auth_token::AuthToken; pub use api_key_permissions::ApiKeyPermissions; +pub use api_key_creator::ApiKeyCreator; +pub use public_key_status::PublicKeyStatus; pub use api_key::ApiKey; +pub use api_key_type::ApiKeyType; pub use create_api_key_response::CreateApiKeyResponse; pub use list_api_keys_response::ListApiKeysResponse; +pub use api_key_mutable_fields::ApiKeyMutableFields; +pub use create_bearer_api_key_request::CreateBearerApiKeyRequest; pub use create_api_key_request::CreateApiKeyRequest; +pub use create_api_key_result::CreateApiKeyResult; +pub use update_api_key_request::UpdateApiKeyRequest; pub use attachment_id::AttachmentId; pub use attachment_filename::AttachmentFilename; pub use attachment_size::AttachmentSize; @@ -635,7 +596,9 @@ pub use provider::Provider; pub use list_providers_response::ListProvidersResponse; pub use search_providers_response::SearchProvidersResponse; pub use list_provider_accounts_response::ListProviderAccountsResponse; -pub use connect_provider_accepted::ConnectProviderAccepted; +pub use connect_inbox_id::ConnectInboxId; +pub use magic_url::MagicUrl; +pub use connect_accepted::ConnectAccepted; pub use thread_id::ThreadId; pub use thread_labels::ThreadLabels; pub use thread_timestamp::ThreadTimestamp; @@ -668,15 +631,13 @@ pub use subscribed_type::SubscribedType; pub use subscribed::Subscribed; pub use error_type::ErrorType; pub use error_model::Error; +pub use inboxes_authorize_inbox_request::InboxesAuthorizeInboxRequest; pub use pods_create_pod_request::PodsCreatePodRequest; pub use webhooks_create_webhook_request::WebhooksCreateWebhookRequest; pub use webhooks_update_webhook_request::WebhooksUpdateWebhookRequest; pub use agent_signup_request::AgentSignupRequest; pub use agent_verify_request::AgentVerifyRequest; -pub use create_public_key_request::CreatePublicKeyRequest; -pub use update_public_key_name_request::UpdatePublicKeyNameRequest; pub use connect_provider_body::ConnectProviderBody; -pub use create_browser_enrollment_request::CreateBrowserEnrollmentRequest; pub use create_draft_request::CreateDraftRequest; pub use update_draft_request::UpdateDraftRequest; pub use batch_get_messages_request::BatchGetMessagesRequest; @@ -684,14 +645,11 @@ pub use batch_update_messages_request::BatchUpdateMessagesRequest; pub use reply_to_message_request::ReplyToMessageRequest; pub use reply_all_message_request::ReplyAllMessageRequest; pub use inboxes_list_query_request::InboxesListQueryRequest; +pub use inboxes_search_query_request::InboxesSearchQueryRequest; pub use pods_list_query_request::PodsListQueryRequest; pub use webhooks_list_query_request::WebhooksListQueryRequest; pub use accounts_list_query_request::AccountsListQueryRequest; pub use api_keys_list_query_request::ApiKeysListQueryRequest; -pub use list_public_keys_query_request::ListPublicKeysQueryRequest; -pub use list_browser_credentials_query_request::ListBrowserCredentialsQueryRequest; -pub use list_browser_credential_events_query_request::ListBrowserCredentialEventsQueryRequest; -pub use list_browser_consents_query_request::ListBrowserConsentsQueryRequest; pub use domains_list_query_request::DomainsListQueryRequest; pub use drafts_list_query_request::DraftsListQueryRequest; pub use lists_list_query_request::ListsListQueryRequest; @@ -702,6 +660,7 @@ pub use providers_search_query_request::ProvidersSearchQueryRequest; pub use list_accounts_query_request::ListAccountsQueryRequest; pub use threads_list_query_request::ThreadsListQueryRequest; pub use threads_search_query_request::ThreadsSearchQueryRequest; +pub use threads_get_query_request::ThreadsGetQueryRequest; pub use inboxes_api_keys_list_query_request::InboxesApiKeysListQueryRequest; pub use inboxes_drafts_list_query_request::InboxesDraftsListQueryRequest; pub use inboxes_events_list_query_request::InboxesEventsListQueryRequest; @@ -712,15 +671,18 @@ pub use inboxes_metrics_query_events_query_request::InboxesMetricsQueryEventsQue pub use inboxes_metrics_query_usage_query_request::InboxesMetricsQueryUsageQueryRequest; pub use inboxes_threads_list_query_request::InboxesThreadsListQueryRequest; pub use inboxes_threads_search_query_request::InboxesThreadsSearchQueryRequest; +pub use inboxes_threads_get_query_request::InboxesThreadsGetQueryRequest; pub use inboxes_webhooks_list_query_request::InboxesWebhooksListQueryRequest; pub use pods_api_keys_list_query_request::PodsApiKeysListQueryRequest; pub use pods_domains_list_query_request::PodsDomainsListQueryRequest; pub use pods_drafts_list_query_request::PodsDraftsListQueryRequest; pub use pods_inboxes_list_query_request::PodsInboxesListQueryRequest; +pub use pods_inboxes_search_query_request::PodsInboxesSearchQueryRequest; pub use pods_lists_list_query_request::PodsListsListQueryRequest; pub use pods_metrics_query_events_query_request::PodsMetricsQueryEventsQueryRequest; pub use pods_metrics_query_usage_query_request::PodsMetricsQueryUsageQueryRequest; pub use pods_threads_list_query_request::PodsThreadsListQueryRequest; pub use pods_threads_search_query_request::PodsThreadsSearchQueryRequest; +pub use pods_threads_get_query_request::PodsThreadsGetQueryRequest; pub use pods_webhooks_list_query_request::PodsWebhooksListQueryRequest; diff --git a/agentmail-types/src/types/organization_public_key_scope.rs b/agentmail-types/src/types/organization_public_key_scope.rs deleted file mode 100644 index 6a04d31..0000000 --- a/agentmail-types/src/types/organization_public_key_scope.rs +++ /dev/null @@ -1,28 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -/// Organization-wide authority. -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct OrganizationPublicKeyScope { -} - -impl OrganizationPublicKeyScope { - pub fn builder() -> OrganizationPublicKeyScopeBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct OrganizationPublicKeyScopeBuilder { -} - -impl OrganizationPublicKeyScopeBuilder { - - /// Consumes the builder and constructs a [`OrganizationPublicKeyScope`]. - pub fn build(self) -> Result { - Ok(OrganizationPublicKeyScope { - }) - } -} diff --git a/agentmail-types/src/types/pod_public_key_scope.rs b/agentmail-types/src/types/pod_public_key_scope.rs deleted file mode 100644 index 38f0fa7..0000000 --- a/agentmail-types/src/types/pod_public_key_scope.rs +++ /dev/null @@ -1,39 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -/// Authority over one live pod and its inboxes. -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct PodPublicKeyScope { - /// ID of the pod. - #[serde(default)] - pub id: String, -} - -impl PodPublicKeyScope { - pub fn builder() -> PodPublicKeyScopeBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct PodPublicKeyScopeBuilder { - id: Option, -} - -impl PodPublicKeyScopeBuilder { - pub fn id(mut self, value: impl Into) -> Self { - self.id = Some(value.into()); - self - } - - /// Consumes the builder and constructs a [`PodPublicKeyScope`]. - /// This method will fail if any of the following fields are not set: - /// - [`id`](PodPublicKeyScopeBuilder::id) - pub fn build(self) -> Result { - Ok(PodPublicKeyScope { - id: self.id.ok_or_else(|| BuildError::missing_field("id"))?, - }) - } -} diff --git a/agentmail-types/src/types/pod_scope_id.rs b/agentmail-types/src/types/pod_scope_id.rs new file mode 100644 index 0000000..63bcadb --- /dev/null +++ b/agentmail-types/src/types/pod_scope_id.rs @@ -0,0 +1,6 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] +pub struct PodScopeId(pub String); \ No newline at end of file diff --git a/agentmail-types/src/types/pods_inboxes_search_query_request.rs b/agentmail-types/src/types/pods_inboxes_search_query_request.rs new file mode 100644 index 0000000..3632bd4 --- /dev/null +++ b/agentmail-types/src/types/pods_inboxes_search_query_request.rs @@ -0,0 +1,58 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Query parameters for search +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct PodsInboxesSearchQueryRequest { + /// Address or display name to search for. Matches word prefixes. Must be 2 to 256 characters. + #[serde(default)] + pub q: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub page_token: Option, +} + +impl PodsInboxesSearchQueryRequest { + pub fn builder() -> PodsInboxesSearchQueryRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct PodsInboxesSearchQueryRequestBuilder { + q: Option, + limit: Option, + page_token: Option, +} + +impl PodsInboxesSearchQueryRequestBuilder { + pub fn q(mut self, value: impl Into) -> Self { + self.q = Some(value.into()); + self + } + + pub fn limit(mut self, value: Limit) -> Self { + self.limit = Some(value); + self + } + + pub fn page_token(mut self, value: PageToken) -> Self { + self.page_token = Some(value); + self + } + + /// Consumes the builder and constructs a [`PodsInboxesSearchQueryRequest`]. + /// This method will fail if any of the following fields are not set: + /// - [`q`](PodsInboxesSearchQueryRequestBuilder::q) + pub fn build(self) -> Result { + Ok(PodsInboxesSearchQueryRequest { + q: self.q.ok_or_else(|| BuildError::missing_field("q"))?, + limit: self.limit, + page_token: self.page_token, + }) + } +} + diff --git a/agentmail-types/src/types/list_public_keys_query_request.rs b/agentmail-types/src/types/pods_threads_get_query_request.rs similarity index 50% rename from agentmail-types/src/types/list_public_keys_query_request.rs rename to agentmail-types/src/types/pods_threads_get_query_request.rs index 0b4b968..5618bc5 100644 --- a/agentmail-types/src/types/list_public_keys_query_request.rs +++ b/agentmail-types/src/types/pods_threads_get_query_request.rs @@ -2,32 +2,31 @@ pub use crate::prelude::*; #[allow(unused_imports)] use super::*; -/// Query parameters for list-public-keys +/// Query parameters for get #[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct ListPublicKeysQueryRequest { +pub struct PodsThreadsGetQueryRequest { + /// Maximum number of messages to return. Cannot exceed 100. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, + /// Token returned by the previous response for retrieving the next, older page. #[serde(skip_serializing_if = "Option::is_none")] pub page_token: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub ascending: Option, } -impl ListPublicKeysQueryRequest { - pub fn builder() -> ListPublicKeysQueryRequestBuilder { - ::default() +impl PodsThreadsGetQueryRequest { + pub fn builder() -> PodsThreadsGetQueryRequestBuilder { + ::default() } } #[derive(Clone, PartialEq, Default, Debug)] #[non_exhaustive] -pub struct ListPublicKeysQueryRequestBuilder { +pub struct PodsThreadsGetQueryRequestBuilder { limit: Option, page_token: Option, - ascending: Option, } -impl ListPublicKeysQueryRequestBuilder { +impl PodsThreadsGetQueryRequestBuilder { pub fn limit(mut self, value: Limit) -> Self { self.limit = Some(value); self @@ -38,17 +37,11 @@ impl ListPublicKeysQueryRequestBuilder { self } - pub fn ascending(mut self, value: Ascending) -> Self { - self.ascending = Some(value); - self - } - - /// Consumes the builder and constructs a [`ListPublicKeysQueryRequest`]. - pub fn build(self) -> Result { - Ok(ListPublicKeysQueryRequest { + /// Consumes the builder and constructs a [`PodsThreadsGetQueryRequest`]. + pub fn build(self) -> Result { + Ok(PodsThreadsGetQueryRequest { limit: self.limit, page_token: self.page_token, - ascending: self.ascending, }) } } diff --git a/agentmail-types/src/types/public_key_client_id.rs b/agentmail-types/src/types/public_key_client_id.rs new file mode 100644 index 0000000..80fe59b --- /dev/null +++ b/agentmail-types/src/types/public_key_client_id.rs @@ -0,0 +1,6 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] +pub struct PublicKeyClientId(pub String); \ No newline at end of file diff --git a/agentmail-types/src/types/public_key_credential.rs b/agentmail-types/src/types/public_key_credential.rs index 550c1d2..5f0187f 100644 --- a/agentmail-types/src/types/public_key_credential.rs +++ b/agentmail-types/src/types/public_key_credential.rs @@ -2,33 +2,41 @@ pub use crate::prelude::*; #[allow(unused_imports)] use super::*; -/// An AgentID sign-in credential. `type` and `api_key_id` are server-owned; -/// use `api_key_id` as the JWS `kid`. This response never contains a bearer -/// secret or private key. +/// An AgentID sign-in credential, scoped like a bearer key; `api_key_id` is +/// the JWS `kid`. A sign-in key carries `status`, gains `public_key` once +/// the client has proved it, expires 30 days after +/// activation, and carries exactly `provider_connect` and +/// `provider_share_owner`, snapshotted from the bearer key that created it +/// and enforced from the key itself. #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] pub struct PublicKeyCredential { - /// Server-generated credential ID. Store this value as the signing key's `kid`. - #[serde(default)] - pub api_key_id: String, - /// Server-owned credential discriminator. Callers cannot select or update it. pub r#type: PublicKeyCredentialType, - /// Human-readable credential name. + #[serde(default)] + pub api_key_id: ApiKeyId, + #[serde(skip_serializing_if = "Option::is_none")] + pub client_id: Option, #[serde(default)] pub name: Name, - pub public_key: PublicKeyMaterial, - pub scope: PublicKeyScope, - /// Immutable absolute expiry. Omitted when the credential does not expire. #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option>, - /// Present when organization-wide revoke-all invalidated this credential generation. + pub public_key: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pod_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub inbox_id: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub revoked_at: Option>, + pub status: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub used_at: Option, + #[serde(default)] + pub permissions: ApiKeyPermissions, #[serde(default)] - #[serde(with = "crate::core::flexible_datetime::offset")] - pub created_at: DateTime, + pub created_by: ApiKeyCreator, #[serde(default)] - #[serde(with = "crate::core::flexible_datetime::offset")] - pub updated_at: DateTime, + pub created_at: CreatedAt, + #[serde(default)] + pub updated_at: UpdatedAt, + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, } impl PublicKeyCredential { @@ -40,25 +48,35 @@ impl PublicKeyCredential { #[derive(Clone, PartialEq, Default, Debug)] #[non_exhaustive] pub struct PublicKeyCredentialBuilder { - api_key_id: Option, r#type: Option, + api_key_id: Option, + client_id: Option, name: Option, public_key: Option, - scope: Option, - expires_at: Option>, - revoked_at: Option>, - created_at: Option>, - updated_at: Option>, + pod_id: Option, + inbox_id: Option, + status: Option, + used_at: Option, + permissions: Option, + created_by: Option, + created_at: Option, + updated_at: Option, + expires_at: Option, } impl PublicKeyCredentialBuilder { - pub fn api_key_id(mut self, value: impl Into) -> Self { - self.api_key_id = Some(value.into()); + pub fn r#type(mut self, value: PublicKeyCredentialType) -> Self { + self.r#type = Some(value); self } - pub fn r#type(mut self, value: PublicKeyCredentialType) -> Self { - self.r#type = Some(value); + pub fn api_key_id(mut self, value: ApiKeyId) -> Self { + self.api_key_id = Some(value); + self + } + + pub fn client_id(mut self, value: PublicKeyClientId) -> Self { + self.client_id = Some(value); self } @@ -72,51 +90,76 @@ impl PublicKeyCredentialBuilder { self } - pub fn scope(mut self, value: PublicKeyScope) -> Self { - self.scope = Some(value); + pub fn pod_id(mut self, value: PodScopeId) -> Self { + self.pod_id = Some(value); self } - pub fn expires_at(mut self, value: DateTime) -> Self { - self.expires_at = Some(value); + pub fn inbox_id(mut self, value: InboxScopeId) -> Self { + self.inbox_id = Some(value); + self + } + + pub fn status(mut self, value: PublicKeyStatus) -> Self { + self.status = Some(value); + self + } + + pub fn used_at(mut self, value: UsedAt) -> Self { + self.used_at = Some(value); self } - pub fn revoked_at(mut self, value: DateTime) -> Self { - self.revoked_at = Some(value); + pub fn permissions(mut self, value: ApiKeyPermissions) -> Self { + self.permissions = Some(value); self } - pub fn created_at(mut self, value: DateTime) -> Self { + pub fn created_by(mut self, value: ApiKeyCreator) -> Self { + self.created_by = Some(value); + self + } + + pub fn created_at(mut self, value: CreatedAt) -> Self { self.created_at = Some(value); self } - pub fn updated_at(mut self, value: DateTime) -> Self { + pub fn updated_at(mut self, value: UpdatedAt) -> Self { self.updated_at = Some(value); self } + pub fn expires_at(mut self, value: ExpiresAt) -> Self { + self.expires_at = Some(value); + self + } + /// Consumes the builder and constructs a [`PublicKeyCredential`]. /// This method will fail if any of the following fields are not set: - /// - [`api_key_id`](PublicKeyCredentialBuilder::api_key_id) /// - [`r#type`](PublicKeyCredentialBuilder::r#type) + /// - [`api_key_id`](PublicKeyCredentialBuilder::api_key_id) /// - [`name`](PublicKeyCredentialBuilder::name) - /// - [`public_key`](PublicKeyCredentialBuilder::public_key) - /// - [`scope`](PublicKeyCredentialBuilder::scope) + /// - [`permissions`](PublicKeyCredentialBuilder::permissions) + /// - [`created_by`](PublicKeyCredentialBuilder::created_by) /// - [`created_at`](PublicKeyCredentialBuilder::created_at) /// - [`updated_at`](PublicKeyCredentialBuilder::updated_at) pub fn build(self) -> Result { Ok(PublicKeyCredential { - api_key_id: self.api_key_id.ok_or_else(|| BuildError::missing_field("api_key_id"))?, r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, + api_key_id: self.api_key_id.ok_or_else(|| BuildError::missing_field("api_key_id"))?, + client_id: self.client_id, name: self.name.ok_or_else(|| BuildError::missing_field("name"))?, - public_key: self.public_key.ok_or_else(|| BuildError::missing_field("public_key"))?, - scope: self.scope.ok_or_else(|| BuildError::missing_field("scope"))?, - expires_at: self.expires_at, - revoked_at: self.revoked_at, + public_key: self.public_key, + pod_id: self.pod_id, + inbox_id: self.inbox_id, + status: self.status, + used_at: self.used_at, + permissions: self.permissions.ok_or_else(|| BuildError::missing_field("permissions"))?, + created_by: self.created_by.ok_or_else(|| BuildError::missing_field("created_by"))?, created_at: self.created_at.ok_or_else(|| BuildError::missing_field("created_at"))?, updated_at: self.updated_at.ok_or_else(|| BuildError::missing_field("updated_at"))?, + expires_at: self.expires_at, }) } } diff --git a/agentmail-types/src/types/public_key_credential_type.rs b/agentmail-types/src/types/public_key_credential_type.rs index d7ae4ac..eb9d284 100644 --- a/agentmail-types/src/types/public_key_credential_type.rs +++ b/agentmail-types/src/types/public_key_credential_type.rs @@ -2,7 +2,6 @@ pub use crate::prelude::*; #[allow(unused_imports)] use super::*; -/// Server-owned credential discriminator. Callers cannot select or update it. #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] pub enum PublicKeyCredentialType { #[serde(rename = "public_key")] diff --git a/agentmail-types/src/types/public_key_scope.rs b/agentmail-types/src/types/public_key_scope.rs deleted file mode 100644 index b7bfbaa..0000000 --- a/agentmail-types/src/types/public_key_scope.rs +++ /dev/null @@ -1,80 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -#[serde(untagged)] -pub enum PublicKeyScope { - PublicKeyScopeZero(PublicKeyScopeZero), - - PublicKeyScopeOne(PublicKeyScopeOne), - - PublicKeyScopeTwo(PublicKeyScopeTwo), -} - -impl PublicKeyScope { - pub fn is_public_key_scope_zero(&self) -> bool { - matches!(self, Self::PublicKeyScopeZero(_)) - } - - pub fn is_public_key_scope_one(&self) -> bool { - matches!(self, Self::PublicKeyScopeOne(_)) - } - - pub fn is_public_key_scope_two(&self) -> bool { - matches!(self, Self::PublicKeyScopeTwo(_)) - } - - - pub fn as_public_key_scope_zero(&self) -> Option<&PublicKeyScopeZero> { - match self { - Self::PublicKeyScopeZero(value) => Some(value), - _ => None, - } - } - - pub fn into_public_key_scope_zero(self) -> Option { - match self { - Self::PublicKeyScopeZero(value) => Some(value), - _ => None, - } - } - - pub fn as_public_key_scope_one(&self) -> Option<&PublicKeyScopeOne> { - match self { - Self::PublicKeyScopeOne(value) => Some(value), - _ => None, - } - } - - pub fn into_public_key_scope_one(self) -> Option { - match self { - Self::PublicKeyScopeOne(value) => Some(value), - _ => None, - } - } - - pub fn as_public_key_scope_two(&self) -> Option<&PublicKeyScopeTwo> { - match self { - Self::PublicKeyScopeTwo(value) => Some(value), - _ => None, - } - } - - pub fn into_public_key_scope_two(self) -> Option { - match self { - Self::PublicKeyScopeTwo(value) => Some(value), - _ => None, - } - } -} - -impl fmt::Display for PublicKeyScope { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Self::PublicKeyScopeZero(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), - Self::PublicKeyScopeOne(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), - Self::PublicKeyScopeTwo(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), - } - } -} diff --git a/agentmail-types/src/types/public_key_scope_one.rs b/agentmail-types/src/types/public_key_scope_one.rs deleted file mode 100644 index 2bdca2f..0000000 --- a/agentmail-types/src/types/public_key_scope_one.rs +++ /dev/null @@ -1,46 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub struct PublicKeyScopeOne { - #[serde(flatten)] - pub pod_public_key_scope_fields: PodPublicKeyScope, - pub r#type: PublicKeyScopeOneType, -} - -impl PublicKeyScopeOne { - pub fn builder() -> PublicKeyScopeOneBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct PublicKeyScopeOneBuilder { - pod_public_key_scope_fields: Option, - r#type: Option, -} - -impl PublicKeyScopeOneBuilder { - pub fn pod_public_key_scope_fields(mut self, value: PodPublicKeyScope) -> Self { - self.pod_public_key_scope_fields = Some(value); - self - } - - pub fn r#type(mut self, value: PublicKeyScopeOneType) -> Self { - self.r#type = Some(value); - self - } - - /// Consumes the builder and constructs a [`PublicKeyScopeOne`]. - /// This method will fail if any of the following fields are not set: - /// - [`pod_public_key_scope_fields`](PublicKeyScopeOneBuilder::pod_public_key_scope_fields) - /// - [`r#type`](PublicKeyScopeOneBuilder::r#type) - pub fn build(self) -> Result { - Ok(PublicKeyScopeOne { - pod_public_key_scope_fields: self.pod_public_key_scope_fields.ok_or_else(|| BuildError::missing_field("pod_public_key_scope_fields"))?, - r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, - }) - } -} diff --git a/agentmail-types/src/types/public_key_scope_one_type.rs b/agentmail-types/src/types/public_key_scope_one_type.rs deleted file mode 100644 index c4c87bb..0000000 --- a/agentmail-types/src/types/public_key_scope_one_type.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub enum PublicKeyScopeOneType { - #[serde(rename = "pod")] - Pod, -} -impl fmt::Display for PublicKeyScopeOneType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let s = match self { - Self::Pod => "pod", - }; - write!(f, "{}", s) - } -} diff --git a/agentmail-types/src/types/public_key_scope_two.rs b/agentmail-types/src/types/public_key_scope_two.rs deleted file mode 100644 index 60419a8..0000000 --- a/agentmail-types/src/types/public_key_scope_two.rs +++ /dev/null @@ -1,46 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub struct PublicKeyScopeTwo { - #[serde(flatten)] - pub inbox_public_key_scope_fields: InboxPublicKeyScope, - pub r#type: PublicKeyScopeTwoType, -} - -impl PublicKeyScopeTwo { - pub fn builder() -> PublicKeyScopeTwoBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct PublicKeyScopeTwoBuilder { - inbox_public_key_scope_fields: Option, - r#type: Option, -} - -impl PublicKeyScopeTwoBuilder { - pub fn inbox_public_key_scope_fields(mut self, value: InboxPublicKeyScope) -> Self { - self.inbox_public_key_scope_fields = Some(value); - self - } - - pub fn r#type(mut self, value: PublicKeyScopeTwoType) -> Self { - self.r#type = Some(value); - self - } - - /// Consumes the builder and constructs a [`PublicKeyScopeTwo`]. - /// This method will fail if any of the following fields are not set: - /// - [`inbox_public_key_scope_fields`](PublicKeyScopeTwoBuilder::inbox_public_key_scope_fields) - /// - [`r#type`](PublicKeyScopeTwoBuilder::r#type) - pub fn build(self) -> Result { - Ok(PublicKeyScopeTwo { - inbox_public_key_scope_fields: self.inbox_public_key_scope_fields.ok_or_else(|| BuildError::missing_field("inbox_public_key_scope_fields"))?, - r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, - }) - } -} diff --git a/agentmail-types/src/types/public_key_scope_two_type.rs b/agentmail-types/src/types/public_key_scope_two_type.rs deleted file mode 100644 index 240fcaa..0000000 --- a/agentmail-types/src/types/public_key_scope_two_type.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub enum PublicKeyScopeTwoType { - #[serde(rename = "inbox")] - Inbox, -} -impl fmt::Display for PublicKeyScopeTwoType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let s = match self { - Self::Inbox => "inbox", - }; - write!(f, "{}", s) - } -} diff --git a/agentmail-types/src/types/public_key_scope_zero.rs b/agentmail-types/src/types/public_key_scope_zero.rs deleted file mode 100644 index ede6461..0000000 --- a/agentmail-types/src/types/public_key_scope_zero.rs +++ /dev/null @@ -1,46 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub struct PublicKeyScopeZero { - #[serde(flatten)] - pub organization_public_key_scope_fields: OrganizationPublicKeyScope, - pub r#type: PublicKeyScopeZeroType, -} - -impl PublicKeyScopeZero { - pub fn builder() -> PublicKeyScopeZeroBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct PublicKeyScopeZeroBuilder { - organization_public_key_scope_fields: Option, - r#type: Option, -} - -impl PublicKeyScopeZeroBuilder { - pub fn organization_public_key_scope_fields(mut self, value: OrganizationPublicKeyScope) -> Self { - self.organization_public_key_scope_fields = Some(value); - self - } - - pub fn r#type(mut self, value: PublicKeyScopeZeroType) -> Self { - self.r#type = Some(value); - self - } - - /// Consumes the builder and constructs a [`PublicKeyScopeZero`]. - /// This method will fail if any of the following fields are not set: - /// - [`organization_public_key_scope_fields`](PublicKeyScopeZeroBuilder::organization_public_key_scope_fields) - /// - [`r#type`](PublicKeyScopeZeroBuilder::r#type) - pub fn build(self) -> Result { - Ok(PublicKeyScopeZero { - organization_public_key_scope_fields: self.organization_public_key_scope_fields.ok_or_else(|| BuildError::missing_field("organization_public_key_scope_fields"))?, - r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, - }) - } -} diff --git a/agentmail-types/src/types/public_key_scope_zero_type.rs b/agentmail-types/src/types/public_key_scope_zero_type.rs deleted file mode 100644 index 6749306..0000000 --- a/agentmail-types/src/types/public_key_scope_zero_type.rs +++ /dev/null @@ -1,17 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] -pub enum PublicKeyScopeZeroType { - #[serde(rename = "organization")] - Organization, -} -impl fmt::Display for PublicKeyScopeZeroType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let s = match self { - Self::Organization => "organization", - }; - write!(f, "{}", s) - } -} diff --git a/agentmail-types/src/types/public_key_status.rs b/agentmail-types/src/types/public_key_status.rs new file mode 100644 index 0000000..056511e --- /dev/null +++ b/agentmail-types/src/types/public_key_status.rs @@ -0,0 +1,47 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Lifecycle of a sign-in key: `pending` until the client finishes +/// creating it on the AgentID page, `active` once it can sign in as the +/// inbox. Absent on a registered key. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum PublicKeyStatus { + Pending, + Active, + /// This variant is used for forward compatibility. + /// If the server sends a value not recognized by the current SDK version, + /// it will be captured here with the raw string value. + __Unknown(String), +} +impl Serialize for PublicKeyStatus { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::Pending => serializer.serialize_str("pending"), + Self::Active => serializer.serialize_str("active"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for PublicKeyStatus { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "pending" => Ok(Self::Pending), + "active" => Ok(Self::Active), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for PublicKeyStatus { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Pending => write!(f, "pending"), + Self::Active => write!(f, "active"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/revoke_all_agent_id_sign_in_keys_response.rs b/agentmail-types/src/types/revoke_all_agent_id_sign_in_keys_response.rs deleted file mode 100644 index b10095b..0000000 --- a/agentmail-types/src/types/revoke_all_agent_id_sign_in_keys_response.rs +++ /dev/null @@ -1,59 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -/// Permanent idempotency receipt for an organization-wide AgentID sign-in key revocation. -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct RevokeAllAgentIdSignInKeysResponse { - #[serde(default)] - pub previous_generation: i64, - #[serde(default)] - pub current_generation: i64, - #[serde(default)] - #[serde(with = "crate::core::flexible_datetime::offset")] - pub revoked_at: DateTime, -} - -impl RevokeAllAgentIdSignInKeysResponse { - pub fn builder() -> RevokeAllAgentIdSignInKeysResponseBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct RevokeAllAgentIdSignInKeysResponseBuilder { - previous_generation: Option, - current_generation: Option, - revoked_at: Option>, -} - -impl RevokeAllAgentIdSignInKeysResponseBuilder { - pub fn previous_generation(mut self, value: i64) -> Self { - self.previous_generation = Some(value); - self - } - - pub fn current_generation(mut self, value: i64) -> Self { - self.current_generation = Some(value); - self - } - - pub fn revoked_at(mut self, value: DateTime) -> Self { - self.revoked_at = Some(value); - self - } - - /// Consumes the builder and constructs a [`RevokeAllAgentIdSignInKeysResponse`]. - /// This method will fail if any of the following fields are not set: - /// - [`previous_generation`](RevokeAllAgentIdSignInKeysResponseBuilder::previous_generation) - /// - [`current_generation`](RevokeAllAgentIdSignInKeysResponseBuilder::current_generation) - /// - [`revoked_at`](RevokeAllAgentIdSignInKeysResponseBuilder::revoked_at) - pub fn build(self) -> Result { - Ok(RevokeAllAgentIdSignInKeysResponse { - previous_generation: self.previous_generation.ok_or_else(|| BuildError::missing_field("previous_generation"))?, - current_generation: self.current_generation.ok_or_else(|| BuildError::missing_field("current_generation"))?, - revoked_at: self.revoked_at.ok_or_else(|| BuildError::missing_field("revoked_at"))?, - }) - } -} diff --git a/agentmail-types/src/types/thread.rs b/agentmail-types/src/types/thread.rs index b84a9f1..e464189 100644 --- a/agentmail-types/src/types/thread.rs +++ b/agentmail-types/src/types/thread.rs @@ -36,7 +36,16 @@ pub struct Thread { pub updated_at: ThreadUpdatedAt, #[serde(default)] pub created_at: ThreadCreatedAt, - /// Messages in thread. Ordered by `timestamp` ascending. + /// Number of messages in this response page. + #[serde(default)] + pub count: Count, + /// Maximum number of messages requested for this page. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Token for the next, older page of messages. Omitted when this page completes the thread. + #[serde(skip_serializing_if = "Option::is_none")] + pub next_page_token: Option, + /// Messages in this page, ordered by `timestamp` ascending. The first page contains the newest messages; follow `next_page_token` to retrieve older pages. #[serde(default)] pub messages: Vec, } @@ -66,6 +75,9 @@ pub struct ThreadBuilder { size: Option, updated_at: Option, created_at: Option, + count: Option, + limit: Option, + next_page_token: Option, messages: Option>, } @@ -150,6 +162,21 @@ impl ThreadBuilder { self } + pub fn count(mut self, value: Count) -> Self { + self.count = Some(value); + self + } + + pub fn limit(mut self, value: Limit) -> Self { + self.limit = Some(value); + self + } + + pub fn next_page_token(mut self, value: PageToken) -> Self { + self.next_page_token = Some(value); + self + } + pub fn messages(mut self, value: Vec) -> Self { self.messages = Some(value); self @@ -168,6 +195,7 @@ impl ThreadBuilder { /// - [`size`](ThreadBuilder::size) /// - [`updated_at`](ThreadBuilder::updated_at) /// - [`created_at`](ThreadBuilder::created_at) + /// - [`count`](ThreadBuilder::count) /// - [`messages`](ThreadBuilder::messages) pub fn build(self) -> Result { Ok(Thread { @@ -187,6 +215,9 @@ impl ThreadBuilder { size: self.size.ok_or_else(|| BuildError::missing_field("size"))?, updated_at: self.updated_at.ok_or_else(|| BuildError::missing_field("updated_at"))?, created_at: self.created_at.ok_or_else(|| BuildError::missing_field("created_at"))?, + count: self.count.ok_or_else(|| BuildError::missing_field("count"))?, + limit: self.limit, + next_page_token: self.next_page_token, messages: self.messages.ok_or_else(|| BuildError::missing_field("messages"))?, }) } diff --git a/agentmail-types/src/types/threads_get_query_request.rs b/agentmail-types/src/types/threads_get_query_request.rs new file mode 100644 index 0000000..755d903 --- /dev/null +++ b/agentmail-types/src/types/threads_get_query_request.rs @@ -0,0 +1,48 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Query parameters for get +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct ThreadsGetQueryRequest { + /// Maximum number of messages to return. Cannot exceed 100. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Token returned by the previous response for retrieving the next, older page. + #[serde(skip_serializing_if = "Option::is_none")] + pub page_token: Option, +} + +impl ThreadsGetQueryRequest { + pub fn builder() -> ThreadsGetQueryRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct ThreadsGetQueryRequestBuilder { + limit: Option, + page_token: Option, +} + +impl ThreadsGetQueryRequestBuilder { + pub fn limit(mut self, value: Limit) -> Self { + self.limit = Some(value); + self + } + + pub fn page_token(mut self, value: PageToken) -> Self { + self.page_token = Some(value); + self + } + + /// Consumes the builder and constructs a [`ThreadsGetQueryRequest`]. + pub fn build(self) -> Result { + Ok(ThreadsGetQueryRequest { + limit: self.limit, + page_token: self.page_token, + }) + } +} + diff --git a/agentmail-types/src/types/update_api_key_request.rs b/agentmail-types/src/types/update_api_key_request.rs new file mode 100644 index 0000000..bfe3b0a --- /dev/null +++ b/agentmail-types/src/types/update_api_key_request.rs @@ -0,0 +1,6 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] +pub struct UpdateApiKeyRequest(pub ApiKeyMutableFields); \ No newline at end of file diff --git a/agentmail-types/src/types/update_public_key_name_request.rs b/agentmail-types/src/types/update_public_key_name_request.rs deleted file mode 100644 index 0bd80b2..0000000 --- a/agentmail-types/src/types/update_public_key_name_request.rs +++ /dev/null @@ -1,38 +0,0 @@ -pub use crate::prelude::*; -#[allow(unused_imports)] -use super::*; - -#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] -pub struct UpdatePublicKeyNameRequest { - #[serde(default)] - pub name: String, -} - -impl UpdatePublicKeyNameRequest { - pub fn builder() -> UpdatePublicKeyNameRequestBuilder { - ::default() - } -} - -#[derive(Clone, PartialEq, Default, Debug)] -#[non_exhaustive] -pub struct UpdatePublicKeyNameRequestBuilder { - name: Option, -} - -impl UpdatePublicKeyNameRequestBuilder { - pub fn name(mut self, value: impl Into) -> Self { - self.name = Some(value.into()); - self - } - - /// Consumes the builder and constructs a [`UpdatePublicKeyNameRequest`]. - /// This method will fail if any of the following fields are not set: - /// - [`name`](UpdatePublicKeyNameRequestBuilder::name) - pub fn build(self) -> Result { - Ok(UpdatePublicKeyNameRequest { - name: self.name.ok_or_else(|| BuildError::missing_field("name"))?, - }) - } -} - diff --git a/agentmail-types/src/types/updated_at.rs b/agentmail-types/src/types/updated_at.rs new file mode 100644 index 0000000..10e6a78 --- /dev/null +++ b/agentmail-types/src/types/updated_at.rs @@ -0,0 +1,9 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] +pub struct UpdatedAt( + #[serde(deserialize_with = "crate::core::flexible_datetime::offset::deserialize")] + pub DateTime +); \ No newline at end of file diff --git a/agentmail-types/src/types/used_at.rs b/agentmail-types/src/types/used_at.rs new file mode 100644 index 0000000..3e370c0 --- /dev/null +++ b/agentmail-types/src/types/used_at.rs @@ -0,0 +1,9 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)] +pub struct UsedAt( + #[serde(deserialize_with = "crate::core::flexible_datetime::offset::deserialize")] + pub DateTime +); \ No newline at end of file diff --git a/cli/agentmail/openapi0.json b/cli/agentmail/openapi0.json index e70d664..96d8ac5 100644 --- a/cli/agentmail/openapi0.json +++ b/cli/agentmail/openapi0.json @@ -1 +1 @@ -{"openapi":"3.0.1","info":{"title":"AgentMail","version":""},"paths":{"/v0/inboxes":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes list\n```","operationId":"inboxes_list","tags":["Inboxes"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesListInboxesResponse"}}}}},"summary":"List Inboxes","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail inboxes create --display-name \"My Agent\" --username myagent --domain agentmail.to\n```","operationId":"inboxes_create","tags":["Inboxes"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesInbox"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesCreateInboxRequest","nullable":true}}}},"x-fern-sdk-group-name":["inboxes"],"x-fern-sdk-method-name":"create"}},"/v0/inboxes/{inbox_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes get --inbox-id \n```","operationId":"inboxes_get","tags":["Inboxes"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesInbox"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail inboxes update --inbox-id --display-name \"Updated Name\"\n```","operationId":"inboxes_update","tags":["Inboxes"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesInbox"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"description":"Expects an object; provide at least one of `display_name` or `metadata`.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesUpdateInboxRequest"}}}},"x-fern-sdk-group-name":["inboxes"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail inboxes delete --inbox-id \n```","operationId":"inboxes_delete","tags":["Inboxes"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes"],"x-fern-sdk-method-name":"delete"}},"/v0/pods":{"get":{"description":"**CLI:**\n```bash\nagentmail pods list\n```","operationId":"pods_list","tags":["Pods"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/podsListPodsResponse"}}}}},"summary":"List Pods","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail pods create --client-id my-pod\n```","operationId":"pods_create","tags":["Pods"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/podsPod"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create Pod","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/podsCreatePodRequest"}}}},"x-fern-sdk-group-name":["pods"],"x-fern-sdk-method-name":"create"}},"/v0/pods/{pod_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods get --pod-id \n```","operationId":"pods_get","tags":["Pods"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/podsPod"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Pod","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods"],"x-fern-sdk-method-name":"get"},"delete":{"description":"**CLI:**\n```bash\nagentmail pods delete --pod-id \n```","operationId":"pods_delete","tags":["Pods"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Pod","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods"],"x-fern-sdk-method-name":"delete"}},"/v0/webhooks":{"get":{"description":"**CLI:**\n```bash\nagentmail webhooks list\n```","operationId":"webhooks_list","tags":["Webhooks"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksListWebhooksResponse"}}}}},"summary":"List Webhooks","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail webhooks create --url https://example.com/webhook --event-types message.received\n```","operationId":"webhooks_create","tags":["Webhooks"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksCreateWebhookRequest"}}}},"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"create"}},"/v0/webhooks/{webhook_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail webhooks get --webhook-id \n```","operationId":"webhooks_get","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"get"},"patch":{"description":"Update inbox or pod subscriptions, or replace the webhook's `event_types` in full when you pass a\nnon-empty `event_types` array (see request field docs). Inbox and pod changes use add/remove lists.\n\n**CLI:**\n```bash\nagentmail webhooks update --webhook-id --add-inbox-ids \n```","operationId":"webhooks_update","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksUpdateWebhookRequest"}}}},"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail webhooks delete --webhook-id \n```","operationId":"webhooks_delete","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"delete"}},"/v0/webhooks/{webhook_id}/headers":{"get":{"description":"List the names of custom HTTP headers included with deliveries to this webhook. Header values are\nwrite-only and are never returned.","operationId":"webhooks_getHeaders","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhookHeaderNamesResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Webhook Headers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"get-headers"},"patch":{"description":"Atomically set, replace, or remove custom HTTP headers included with deliveries to this webhook.\nHeader values remain write-only.","operationId":"webhooks_updateHeaders","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"204":{"description":""},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Webhook Headers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksUpdateWebhookHeadersRequest"}}}},"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"update-headers"}},"/v0/accounts":{"get":{"description":"Lists accounts across all providers.","operationId":"accounts_list","tags":["Accounts"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAccountsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"List Accounts","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["accounts"],"x-fern-sdk-method-name":"list"}},"/v0/accounts/{account_id}":{"get":{"operationId":"accounts_get","tags":["Accounts"],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AccountId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Account","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["accounts"],"x-fern-sdk-method-name":"get"}},"/v0/agent/sign-up":{"post":{"description":"Create a new agent organization with an inbox and API key. This endpoint is for signing up for the first time. If you've already signed up, you're all set — just use your existing API key.\n\nA 6-digit OTP is sent to the human's email for verification.\n\nThis endpoint is idempotent. Calling it again with the same `human_email` will rotate the API key and resend the OTP if expired.\n\nThe returned API key has limited permissions until the organization is verified via the verify endpoint.\n\n**CLI:**\n```bash\nagentmail agent sign-up --human-email user@example.com --username my-agent\n```","operationId":"agent_signUp","tags":["Agent"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSignupResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Sign Up","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSignupRequest"}}}},"x-fern-sdk-group-name":["agent"],"x-fern-sdk-method-name":"sign-up"}},"/v0/agent/verify":{"post":{"description":"Verify an agent organization using the 6-digit OTP sent to the human's email during sign-up.\n\nOn success, the organization is upgraded from `agent_unverified` to `agent_verified`, the send allowlist is removed, and free plan entitlements are applied.\n\nThe OTP expires after 24 hours and allows a maximum of 10 attempts. If you run into any difficulties receiving the OTP code, you can also create an account on [console.agentmail.to](https://console.agentmail.to) using the human email address you provided to verify your account.\n\n**CLI:**\n```bash\nagentmail agent verify --otp-code 123456\n```","operationId":"agent_verify","tags":["Agent"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVerifyResponse"}}}}},"summary":"Verify","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVerifyRequest"}}}},"x-fern-sdk-group-name":["agent"],"x-fern-sdk-method-name":"verify"}},"/v0/api-keys":{"get":{"description":"**CLI:**\n```bash\nagentmail api-keys list\n```","operationId":"apiKeys_list","tags":["ApiKeys"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApiKeysResponse"}}}}},"summary":"List API Keys","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail api-keys create --name \"My Key\"\n```","operationId":"apiKeys_create","tags":["ApiKeys"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"create"}},"/v0/api-keys/{api_key_id}":{"delete":{"description":"**CLI:**\n```bash\nagentmail api-keys delete --api-key-id \n```","operationId":"apiKeys_delete","tags":["ApiKeys"],"parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ApiKeyId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"delete"}},"/v0/api-keys/public-keys":{"get":{"description":"List only public-key credentials visible to the bearer caller's scope.\nBearer credentials are never returned, even though both credential types\nshare storage and pagination indexes. Requires `api_key_read`.","operationId":"apiKeys_listPublicKeys","tags":["ApiKeys"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPublicKeysResponse"}}}}},"summary":"List Public-Key Credentials","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"list-public-keys"},"post":{"description":"Register a public P-256 JWK using an existing AgentMail bearer API key\nwith `api_key_create`. Re-registering the same JWK creates a new\ncredential ID; it does not replace or recover an earlier credential.\nThe private key must never be sent to AgentMail.","operationId":"apiKeys_createPublicKey","tags":["ApiKeys"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicKeyCredential"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Register Public-Key Credential","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePublicKeyRequest"}}}},"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"create-public-key"}},"/v0/api-keys/public-keys/{api_key_id}":{"patch":{"description":"Rename the credential. All security-relevant fields are immutable.\nRequires `api_key_update`.","operationId":"apiKeys_updatePublicKeyName","tags":["ApiKeys"],"parameters":[{"name":"api_key_id","in":"path","description":"Public-key credential ID returned by registration.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicKeyCredential"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Rename Public-Key Credential","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePublicKeyNameRequest"}}}},"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"update-public-key-name"},"delete":{"description":"Permanently revoke one public-key credential. This hard-deletes the\ncredential; repeating the request returns not found. Requires\n`api_key_delete`.","operationId":"apiKeys_revokePublicKey","tags":["ApiKeys"],"parameters":[{"name":"api_key_id","in":"path","description":"Public-key credential ID returned by registration.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Revoke Public-Key Credential","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"revoke-public-key"}},"/v0/api-keys/public-keys/agentid-sign-in/revoke-all":{"post":{"description":"Invalidate every current public-key credential in the caller's\norganization by advancing its AgentID key generation. The caller must be\norganization-scoped and either have `api_key_delete` or, for a verified\nself-serve agent organization, use an unrestricted unmanaged bearer\ncredential. No request body is accepted.\n\n`Idempotency-Key` is required and must be a UUID. Reusing the same UUID\nreturns the original permanent receipt without advancing the generation\nagain. A new UUID performs a new generation advance.","operationId":"apiKeys_revokeAllAgentIdSignInKeys","tags":["ApiKeys"],"parameters":[{"name":"Idempotency-Key","in":"header","description":"Required UUID identifying this revoke-all operation permanently.","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeAllAgentIdSignInKeysResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Revoke All AgentID Sign-In Keys","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"revoke-all-agent-id-sign-in-keys"}},"/v0/api-keys/browser-credentials":{"get":{"description":"List active browser credentials visible to the caller's scope. Requires `api_key_read`.","operationId":"apiKeys_listBrowserCredentials","tags":["ApiKeys"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/BrowserAuthorizationListLimit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListBrowserCredentialsResponse"}}}}},"summary":"List Browser Credentials","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"list-browser-credentials"}},"/v0/api-keys/browser-credentials/events":{"get":{"description":"List owner-facing browser credential and consent lifecycle events. Requires `api_key_read`.","operationId":"apiKeys_listBrowserCredentialEvents","tags":["ApiKeys"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/BrowserAuthorizationListLimit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListBrowserLifecycleEventsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Browser Credential Events","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"list-browser-credential-events"}},"/v0/api-keys/browser-credentials/{credential_id}":{"delete":{"description":"Permanently revoke one active browser credential. Requires `api_key_delete`.","operationId":"apiKeys_deleteBrowserCredential","tags":["ApiKeys"],"parameters":[{"name":"credential_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Browser Credential","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"delete-browser-credential"}},"/v0/api-keys/browser-credentials/enrollments/{enrollment_id}":{"delete":{"description":"Cancel one pending, unexpired browser enrollment intent. Requires `api_key_delete`.","operationId":"apiKeys_cancelBrowserEnrollment","tags":["ApiKeys"],"parameters":[{"name":"enrollment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Cancel Browser Enrollment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"cancel-browser-enrollment"}},"/v0/api-keys/browser-consents":{"get":{"description":"List remembered AgentID client approvals for one live inbox. Requires `api_key_read`.","operationId":"apiKeys_listBrowserConsents","tags":["ApiKeys"],"parameters":[{"name":"inbox_id","in":"query","required":true,"schema":{"type":"string","format":"email","maxLength":254}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/BrowserAuthorizationListLimit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListBrowserConsentsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Browser Consents","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"list-browser-consents"}},"/v0/api-keys/browser-consents/{consent_id}":{"delete":{"description":"Revoke one remembered AgentID client approval. Requires `api_key_delete`.","operationId":"apiKeys_deleteBrowserConsent","tags":["ApiKeys"],"parameters":[{"name":"consent_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Browser Consent","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"delete-browser-consent"}},"/v0/auth/me":{"get":{"description":"Returns the identity and scope of the authenticated credential. Useful when a client holds a pod-scoped or inbox-scoped API key and needs to discover the parent organization, pod, or inbox without prior knowledge.\n\n**CLI:**\n```bash\nagentmail auth me\n```","operationId":"auth_me","tags":["Auth"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Identity"}}}}},"summary":"Who Am I","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["auth"],"x-fern-sdk-method-name":"me"}},"/v0/domains":{"get":{"description":"**CLI:**\n```bash\nagentmail domains list\n```","operationId":"domains_list","tags":["Domains"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDomainsResponse"}}}}},"summary":"List Domains","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail domains create --domain example.com\n```","operationId":"domains_create","tags":["Domains"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDomainRequest"}}}},"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"create"}},"/v0/domains/{domain_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail domains get --domain-id \n```","operationId":"domains_get","tags":["Domains"],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail domains update --domain-id \n```","operationId":"domains_update","tags":["Domains"],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDomainRequest"}}}},"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail domains delete --domain-id \n```","operationId":"domains_delete","tags":["Domains"],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"delete"}},"/v0/domains/{domain_id}/zone-file":{"get":{"description":"**CLI:**\n```bash\nagentmail domains get-zone-file --domain-id \n```","operationId":"domains_getZoneFile","tags":["Domains"],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Zone File","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"get-zone-file"}},"/v0/domains/{domain_id}/verify":{"post":{"description":"**CLI:**\n```bash\nagentmail domains verify --domain-id \n```","operationId":"domains_verify","tags":["Domains"],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Verify Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"verify"}},"/v0/domains/{domain_id}/setup-link":{"get":{"description":"Build a one-click DNS setup link for the domain via the Domain Connect standard. When the domain's DNS provider supports Domain Connect and carries the AgentMail template, the response contains a signed URL: opening it lets the domain owner approve the required DNS records at their provider, which writes them automatically — no copy-paste. When the provider does not support it, `supported` is `false` and the domain's `records` should be added manually instead.","operationId":"domains_getSetupLink","tags":["Domains"],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSetupLinkResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Setup Link","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"get-setup-link"}},"/v0/drafts":{"get":{"description":"**CLI:**\n```bash\nagentmail drafts list\n```","operationId":"drafts_list","tags":["Drafts"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDraftsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Drafts","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["drafts"],"x-fern-sdk-method-name":"list"}},"/v0/drafts/{draft_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail drafts get --draft-id \n```","operationId":"drafts_get","tags":["Drafts"],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["drafts"],"x-fern-sdk-method-name":"get"}},"/v0/drafts/{draft_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail drafts get-attachment --draft-id --attachment-id \n```","operationId":"drafts_getAttachment","tags":["Drafts"],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["drafts"],"x-fern-sdk-method-name":"get-attachment"}},"/v0/inboxes/{inbox_id}/api-keys":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes api-keys list --inbox-id \n```","operationId":"inboxes_apiKeys_list","tags":["InboxesApiKeys"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApiKeysResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List API Keys","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","apiKeys"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail inboxes api-keys create --inbox-id --name \"My Key\"\n```","operationId":"inboxes_apiKeys_create","tags":["InboxesApiKeys"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"x-fern-sdk-group-name":["inboxes","apiKeys"],"x-fern-sdk-method-name":"create"}},"/v0/inboxes/{inbox_id}/api-keys/{api_key_id}":{"delete":{"description":"**CLI:**\n```bash\nagentmail inboxes api-keys delete --inbox-id --api-key-id \n```","operationId":"inboxes_apiKeys_delete","tags":["InboxesApiKeys"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"api_key_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ApiKeyId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","apiKeys"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/browser-credentials/enrollments":{"post":{"description":"Attach a browser enrollment intent to the inbox. Requires\n`api_key_create`. Before submitting `transaction_jti`, independently\nverify that the browser page's final origin is exactly\n`https://auth.agentid.com`.\n\nThis endpoint is available to every organization using US production.\nIt is not available in EU production.\n\nSelect `inbox_id` from trusted AgentMail configuration. An AgentID\n`login_hint` is not authoritative for selecting the inbox; when the\ntransaction includes one, it must match the path inbox.\n\n**AgentMail API keys are sent only to `https://api.agentmail.to`; AgentID never requests them.**\n\nA new intent returns `202`; an idempotent retry for the same pending\ntransaction, inbox, and bearer key returns `200` with the same receipt.\nAn intent lasts at most five minutes. An activated credential lasts at\nmost 30 days and cannot outlive its authorizing bearer API key.\n\nCreation is limited to 20 intents per bearer API key per hour, 100 per\norganization per hour, and five live unused intents per bearer API key.\nBrowser activation is separately limited to 20 activations per\nauthorizing bearer API key per UTC day. Either kind of limit can return\n`429`; honor the `Retry-After` header. Cancelling an enrollment releases\nits live-intent slot but does not reset the daily activation counter.","operationId":"inboxes_browserCredentials_createEnrollment","tags":["InboxesBrowserCredentials"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrowserEnrollmentAccepted"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create Browser Enrollment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBrowserEnrollmentRequest"}}}},"x-fern-sdk-group-name":["inboxes","browserCredentials"],"x-fern-sdk-method-name":"create-enrollment"}},"/v0/inboxes/{inbox_id}/drafts":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes drafts list --inbox-id \n```","operationId":"inboxes_drafts_list","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDraftsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Drafts","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"list"},"post":{"description":"Create a draft. Supply `in_reply_to` to create a reply draft (with\n`reply_all` to address the whole thread), whose recipients, subject, and\nthreading are derived from the referenced message, or `forward_of` to\ncreate a forward draft, which derives the subject, threading, and\nforwarded content from the source but keeps recipients caller-supplied.\n\n**CLI:**\n```bash\nagentmail inboxes drafts create --inbox-id --to recipient@example.com --subject \"Draft subject\" --text \"Draft body\"\n```","operationId":"inboxes_drafts_create","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDraftRequest"}}}},"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"create"}},"/v0/inboxes/{inbox_id}/drafts/{draft_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes drafts get --inbox-id --draft-id \n```","operationId":"inboxes_drafts_get","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"get"},"patch":{"description":"Edit fields on an existing draft. Passing `null` clears a field (or `[]`\nfor a recipient field); `send_at: null` un-schedules a scheduled draft.\nA draft that is already being sent cannot be edited.\n\n**CLI:**\n```bash\nagentmail inboxes drafts update --inbox-id --draft-id --subject \"Updated subject\"\n```","operationId":"inboxes_drafts_update","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDraftRequest"}}}},"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail inboxes drafts delete --inbox-id --draft-id \n```","operationId":"inboxes_drafts_delete","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes drafts get-attachment --inbox-id --draft-id --attachment-id \n```","operationId":"inboxes_drafts_getAttachment","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"get-attachment"}},"/v0/inboxes/{inbox_id}/drafts/{draft_id}/send":{"post":{"description":"**CLI:**\n```bash\nagentmail inboxes drafts send --inbox-id --draft-id \n```","operationId":"inboxes_drafts_send","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key that makes a send idempotent. A retry carrying the same key returns the original message instead of sending a second email; reusing a key with a different request returns a 409 conflict. Keys expire 24 hours after the send completes.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Send Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMessageRequest"}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"send"}},"/v0/inboxes/{inbox_id}/events":{"get":{"description":"List label change events for an inbox. Returns events in reverse chronological order by default. Use for IMAP UID projection or audit logging.\n\n**CLI:**\n```bash\nagentmail inboxes events list --inbox-id \n```","operationId":"inboxes_events_list","tags":["InboxesEvents"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInboxEventsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Inbox Events","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","events"],"x-fern-sdk-method-name":"list"}},"/v0/inboxes/{inbox_id}/lists/{direction}/{type}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes lists list --inbox-id --direction --type \n```","operationId":"inboxes_lists_list","tags":["InboxesLists"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodListListEntriesResponse"}}}}},"summary":"List Entries","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","lists"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail inboxes lists create --inbox-id --direction --type --entry user@example.com\n```","operationId":"inboxes_lists_create","tags":["InboxesLists"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodListEntry"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateListEntryRequest"}}}},"x-fern-sdk-group-name":["inboxes","lists"],"x-fern-sdk-method-name":"create"}},"/v0/inboxes/{inbox_id}/lists/{direction}/{type}/{entry}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes lists get --inbox-id --direction --type --entry \n```","operationId":"inboxes_lists_get","tags":["InboxesLists"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"entry","in":"path","description":"Email address or domain.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodListEntry"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","lists"],"x-fern-sdk-method-name":"get"},"delete":{"description":"**CLI:**\n```bash\nagentmail inboxes lists delete --inbox-id --direction --type --entry \n```","operationId":"inboxes_lists_delete","tags":["InboxesLists"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"entry","in":"path","description":"Email address or domain.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","lists"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/messages":{"get":{"description":"Lists messages in the inbox, most recent first. Pass `from`, `to`, or\n`subject` to filter by substring. Filtered requests are served by\nsearch, which caps `limit` at 100. For relevance-ranked full-text\nsearch across sender, recipients, subject, and message body, use\n`Search Messages`.\n\n**CLI:**\n```bash\nagentmail inboxes messages list --inbox-id \n```","operationId":"inboxes_messages_list","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}},{"name":"include_spam","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeSpam","nullable":true}},{"name":"include_blocked","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeBlocked","nullable":true}},{"name":"include_unauthenticated","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeUnauthenticated","nullable":true}},{"name":"include_trash","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeTrash","nullable":true}},{"name":"from","in":"query","description":"Filter to messages whose sender contains this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"to","in":"query","description":"Filter to messages whose recipients (to, cc, or bcc) contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"subject","in":"query","description":"Filter to messages whose subject contains this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMessagesResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Messages","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"list"}},"/v0/inboxes/{inbox_id}/messages/search":{"get":{"description":"Full-text search across messages in the inbox, ranked by relevance. The\nquery is matched against the sender, recipients, and subject (substring)\nand the message body (tokenized full text). Spam, trash, blocked, and\nunauthenticated messages are always excluded. `limit` cannot exceed 100.","operationId":"inboxes_messages_search","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"q","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Query"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchMessagesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Search Messages","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"search"}},"/v0/inboxes/{inbox_id}/messages/{message_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes messages get --inbox-id --message-id \n```","operationId":"inboxes_messages_get","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail inboxes messages update --inbox-id --message-id --add-labels read --remove-labels unread\n```","operationId":"inboxes_messages_update","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMessageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMessageRequest"}}}},"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"update"},"delete":{"description":"Permanently deletes a message.\n\n**CLI:**\n```bash\nagentmail inboxes messages delete --inbox-id --message-id \n```","operationId":"inboxes_messages_delete","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/messages/batch-get":{"post":{"description":"Fetch metadata for up to 500 messages in one request. Missing or\nrestricted IDs are silently omitted; compare `count` against `limit`\nto detect misses.\n\n**CLI:**\n```bash\nagentmail inboxes messages batch-get --inbox-id --message-ids --message-ids \n```","operationId":"inboxes_messages_batchGet","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchGetMessagesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Batch Get Messages","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchGetMessagesRequest"}}}},"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"batch-get"}},"/v0/inboxes/{inbox_id}/messages/batch-update":{"post":{"description":"Apply one label change to up to 50 messages in a single request. The\nsame add_labels and remove_labels apply to every message id, and at\nleast one of them must be provided. The update is atomic: either all\nresolved messages are updated or none are. Missing or restricted ids\nare silently excluded; compare `count` against `limit` to detect\nexclusions.\n\n**CLI:**\n```bash\nagentmail inboxes messages batch-update --inbox-id --message-ids --message-ids --add-labels read --remove-labels unread\n```","operationId":"inboxes_messages_batchUpdate","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUpdateMessagesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Batch Update Messages","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUpdateMessagesRequest"}}}},"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"batch-update"}},"/v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes messages get-attachment --inbox-id --message-id --attachment-id \n```","operationId":"inboxes_messages_getAttachment","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"get-attachment"}},"/v0/inboxes/{inbox_id}/messages/{message_id}/raw":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes messages get-raw --inbox-id --message-id \n```","operationId":"inboxes_messages_getRaw","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RawMessageResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Raw Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"get-raw"}},"/v0/inboxes/{inbox_id}/messages/send":{"post":{"description":"**CLI:**\n```bash\nagentmail inboxes messages send --inbox-id --to recipient@example.com --subject \"Hello\" --text \"Body\"\n```","operationId":"inboxes_messages_send","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key that makes a send idempotent. A retry carrying the same key returns the original message instead of sending a second email; reusing a key with a different request returns a 409 conflict. Keys expire 24 hours after the send completes.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Send Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"send"}},"/v0/inboxes/{inbox_id}/messages/{message_id}/reply":{"post":{"description":"**CLI:**\n```bash\nagentmail inboxes messages reply --inbox-id --message-id --text \"Reply text\"\n```","operationId":"inboxes_messages_reply","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key that makes a send idempotent. A retry carrying the same key returns the original message instead of sending a second email; reusing a key with a different request returns a 409 conflict. Keys expire 24 hours after the send completes.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Reply To Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplyToMessageRequest"}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"reply"}},"/v0/inboxes/{inbox_id}/messages/{message_id}/reply-all":{"post":{"description":"**CLI:**\n```bash\nagentmail inboxes messages reply-all --inbox-id --message-id --text \"Reply text\"\n```","operationId":"inboxes_messages_reply-all","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key that makes a send idempotent. A retry carrying the same key returns the original message instead of sending a second email; reusing a key with a different request returns a 409 conflict. Keys expire 24 hours after the send completes.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Reply All Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplyAllMessageRequest"}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"reply-all"}},"/v0/inboxes/{inbox_id}/messages/{message_id}/forward":{"post":{"description":"**CLI:**\n```bash\nagentmail inboxes messages forward --inbox-id --message-id --to recipient@example.com\n```","operationId":"inboxes_messages_forward","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key that makes a send idempotent. A retry carrying the same key returns the original message instead of sending a second email; reusing a key with a different request returns a 409 conflict. Keys expire 24 hours after the send completes.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Forward Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"forward"}},"/v0/inboxes/{inbox_id}/metrics/events":{"get":{"description":"Counts of email events (sent, delivered, bounced, etc.) over time for\nthe inbox. Defaults to the last 24 hours; `start` must be within the\nlast 90 days, and a future `end` is clamped to now. Omit `period` for\nindividual event counts, or set it to sum counts into buckets of that\nmany seconds.\n\n**CLI:**\n```bash\nagentmail inboxes metrics query-events --inbox-id \n```","operationId":"inboxes_metrics_queryEvents","tags":["InboxesMetrics"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"event_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricEventTypes","nullable":true}},{"name":"start","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Start","nullable":true}},{"name":"end","in":"query","required":false,"schema":{"$ref":"#/components/schemas/End","nullable":true}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricLimit","nullable":true}},{"name":"descending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Descending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryMetricsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Events","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","metrics"],"x-fern-sdk-method-name":"query-events"}},"/v0/inboxes/{inbox_id}/metrics/usage":{"get":{"description":"Cumulative usage series for the inbox. Each point is the running total\nof the usage type at that timestamp, not the change within the bucket.\nInbox-scoped queries carry `storage_bytes`, `message_count`, and\n`thread_count`; requested types that don't apply to the scope are\nignored. Defaults to the last 24 hours; `start` must be within the\nlast 90 days, and a future `end` is clamped to now. The range divided\nby `period` must not exceed 1000 buckets.","operationId":"inboxes_metrics_queryUsage","tags":["InboxesMetrics"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"usage_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/UsageTypes","nullable":true}},{"name":"start","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Start","nullable":true}},{"name":"end","in":"query","required":false,"schema":{"$ref":"#/components/schemas/End","nullable":true}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricLimit","nullable":true}},{"name":"descending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Descending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryUsageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Usage","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","metrics"],"x-fern-sdk-method-name":"query-usage"}},"/v0/inboxes/{inbox_id}/threads":{"get":{"description":"Lists threads in the inbox, most recent first. Pass `senders`,\n`recipients`, or `subject` to filter by substring. Filtered requests are\nserved by search, which caps `limit` at 100. For relevance-ranked\nfull-text search, use `Search Threads`.\n\n**CLI:**\n```bash\nagentmail inboxes threads list --inbox-id \n```","operationId":"inboxes_threads_list","tags":["InboxesThreads"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}},{"name":"include_spam","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeSpam","nullable":true}},{"name":"include_blocked","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeBlocked","nullable":true}},{"name":"include_unauthenticated","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeUnauthenticated","nullable":true}},{"name":"include_trash","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeTrash","nullable":true}},{"name":"senders","in":"query","description":"Filter to threads whose senders contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"recipients","in":"query","description":"Filter to threads whose recipients contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"subject","in":"query","description":"Filter to threads whose subject contains this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListThreadsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Threads","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","threads"],"x-fern-sdk-method-name":"list"}},"/v0/inboxes/{inbox_id}/threads/search":{"get":{"description":"Full-text search across threads in the inbox, ranked by relevance. The\nquery is matched against senders, recipients, and subject (substring)\nand the message body (tokenized full text). Spam, trash, blocked, and\nunauthenticated threads are always excluded. `limit` cannot exceed 100.","operationId":"inboxes_threads_search","tags":["InboxesThreads"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"q","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Query"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchThreadsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Search Threads","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","threads"],"x-fern-sdk-method-name":"search"}},"/v0/inboxes/{inbox_id}/threads/{thread_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes threads get --inbox-id --thread-id \n```","operationId":"inboxes_threads_get","tags":["InboxesThreads"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","threads"],"x-fern-sdk-method-name":"get"},"patch":{"description":"Updates thread labels. Cannot add or remove system labels (sent, received, bounced, etc.). Rejects requests with a `422` for threads with 100 or more messages.","operationId":"inboxes_threads_update","tags":["InboxesThreads"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadRequest"}}}},"x-fern-sdk-group-name":["inboxes","threads"],"x-fern-sdk-method-name":"update"},"delete":{"description":"Permanently deletes a thread and all of its messages.\n\n**CLI:**\n```bash\nagentmail inboxes threads delete --inbox-id --thread-id \n```","operationId":"inboxes_threads_delete","tags":["InboxesThreads"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","threads"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/threads/{thread_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes threads get-attachment --inbox-id --thread-id --attachment-id \n```","operationId":"inboxes_threads_getAttachment","tags":["InboxesThreads"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","threads"],"x-fern-sdk-method-name":"get-attachment"}},"/v0/inboxes/{inbox_id}/webhooks":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes webhooks list --inbox-id \n```","operationId":"inboxes_webhooks_list","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksListWebhooksResponse"}}}}},"summary":"List Webhooks","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"list"},"post":{"description":"Create a webhook scoped to this inbox.\n\n**CLI:**\n```bash\nagentmail inboxes webhooks create --inbox-id --url https://example.com/webhook --event-types message.received\n```","operationId":"inboxes_webhooks_create","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksCreateInboxWebhookRequest"}}}},"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"create"}},"/v0/inboxes/{inbox_id}/webhooks/{webhook_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes webhooks get --inbox-id --webhook-id \n```","operationId":"inboxes_webhooks_get","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail inboxes webhooks update --inbox-id --webhook-id --event-types message.received\n```","operationId":"inboxes_webhooks_update","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksUpdateInboxWebhookRequest"}}}},"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail inboxes webhooks delete --inbox-id --webhook-id \n```","operationId":"inboxes_webhooks_delete","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/webhooks/{webhook_id}/headers":{"get":{"description":"List the names of custom HTTP headers included with deliveries to this inbox-scoped webhook.\nHeader values are write-only and are never returned.","operationId":"inboxes_webhooks_getHeaders","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhookHeaderNamesResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Webhook Headers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"get-headers"},"patch":{"description":"Atomically set, replace, or remove custom HTTP headers included with deliveries to this\ninbox-scoped webhook. Header values remain write-only.","operationId":"inboxes_webhooks_updateHeaders","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"204":{"description":""},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Webhook Headers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksUpdateWebhookHeadersRequest"}}}},"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"update-headers"}},"/v0/lists/{direction}/{type}":{"get":{"description":"**CLI:**\n```bash\nagentmail lists list --direction --type \n```","operationId":"lists_list","tags":["Lists"],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListListEntriesResponse"}}}}},"summary":"List Entries","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["lists"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail lists create --direction --type --entry user@example.com\n```","operationId":"lists_create","tags":["Lists"],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEntry"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateListEntryRequest"}}}},"x-fern-sdk-group-name":["lists"],"x-fern-sdk-method-name":"create"}},"/v0/lists/{direction}/{type}/{entry}":{"get":{"description":"**CLI:**\n```bash\nagentmail lists get --direction --type --entry \n```","operationId":"lists_get","tags":["Lists"],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"entry","in":"path","description":"Email address or domain.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEntry"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["lists"],"x-fern-sdk-method-name":"get"},"delete":{"description":"**CLI:**\n```bash\nagentmail lists delete --direction --type --entry \n```","operationId":"lists_delete","tags":["Lists"],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"entry","in":"path","description":"Email address or domain.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["lists"],"x-fern-sdk-method-name":"delete"}},"/v0/metrics/events":{"get":{"description":"Counts of email events (sent, delivered, bounced, etc.) over time for\nthe organization. Defaults to the last 24 hours; `start` must be within\nthe last 90 days, and a future `end` is clamped to now. Omit `period`\nfor individual event counts, or set it to sum counts into buckets of\nthat many seconds.\n\n**CLI:**\n```bash\nagentmail metrics query-events\n```","operationId":"metrics_queryEvents","tags":["Metrics"],"parameters":[{"name":"event_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricEventTypes","nullable":true}},{"name":"start","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Start","nullable":true}},{"name":"end","in":"query","required":false,"schema":{"$ref":"#/components/schemas/End","nullable":true}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricLimit","nullable":true}},{"name":"descending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Descending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryMetricsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Events","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["metrics"],"x-fern-sdk-method-name":"query-events"}},"/v0/metrics/usage":{"get":{"description":"Cumulative usage series for the organization. Each point is the running\ntotal of the usage type at that timestamp, not the change within the\nbucket. Defaults to the last 24 hours; `start` must be within the last\n90 days, and a future `end` is clamped to now. The range divided by\n`period` must not exceed 1000 buckets.","operationId":"metrics_queryUsage","tags":["Metrics"],"parameters":[{"name":"usage_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/UsageTypes","nullable":true}},{"name":"start","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Start","nullable":true}},{"name":"end","in":"query","required":false,"schema":{"$ref":"#/components/schemas/End","nullable":true}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricLimit","nullable":true}},{"name":"descending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Descending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryUsageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Usage","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["metrics"],"x-fern-sdk-method-name":"query-usage"}},"/v0/organizations":{"get":{"description":"Returns the organization for the authenticated API key (usage limits, counts, and billing metadata).\n\n**CLI:**\n```bash\nagentmail organizations get\n```","operationId":"organizations_get","tags":["Organizations"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}}},"summary":"Get Organization","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["organizations"],"x-fern-sdk-method-name":"get"}},"/v0/pods/{pod_id}/api-keys":{"get":{"description":"**CLI:**\n```bash\nagentmail pods api-keys list --pod-id \n```","operationId":"pods_apiKeys_list","tags":["PodsApiKeys"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApiKeysResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List API Keys","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","apiKeys"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail pods api-keys create --pod-id --name \"My Key\"\n```","operationId":"pods_apiKeys_create","tags":["PodsApiKeys"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"x-fern-sdk-group-name":["pods","apiKeys"],"x-fern-sdk-method-name":"create"}},"/v0/pods/{pod_id}/api-keys/{api_key_id}":{"delete":{"description":"**CLI:**\n```bash\nagentmail pods api-keys delete --pod-id --api-key-id \n```","operationId":"pods_apiKeys_delete","tags":["PodsApiKeys"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"api_key_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ApiKeyId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","apiKeys"],"x-fern-sdk-method-name":"delete"}},"/v0/pods/{pod_id}/domains":{"get":{"description":"**CLI:**\n```bash\nagentmail pods domains list --pod-id \n```","operationId":"pods_domains_list","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDomainsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Domains","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail pods domains create --pod-id --domain example.com\n```","operationId":"pods_domains_create","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDomainRequest"}}}},"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"create"}},"/v0/pods/{pod_id}/domains/{domain_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods domains get --pod-id --domain-id \n```","operationId":"pods_domains_get","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail pods domains update --pod-id --domain-id \n```","operationId":"pods_domains_update","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDomainRequest"}}}},"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail pods domains delete --pod-id --domain-id \n```","operationId":"pods_domains_delete","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"delete"}},"/v0/pods/{pod_id}/domains/{domain_id}/zone-file":{"get":{"description":"**CLI:**\n```bash\nagentmail pods domains get-zone-file --pod-id --domain-id \n```","operationId":"pods_domains_getZoneFile","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Zone File","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"get-zone-file"}},"/v0/pods/{pod_id}/domains/{domain_id}/verify":{"post":{"description":"**CLI:**\n```bash\nagentmail pods domains verify --pod-id --domain-id \n```","operationId":"pods_domains_verify","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Verify Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"verify"}},"/v0/pods/{pod_id}/drafts":{"get":{"description":"**CLI:**\n```bash\nagentmail pods drafts list --pod-id \n```","operationId":"pods_drafts_list","tags":["PodsDrafts"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDraftsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Drafts","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","drafts"],"x-fern-sdk-method-name":"list"}},"/v0/pods/{pod_id}/drafts/{draft_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods drafts get --pod-id --draft-id \n```","operationId":"pods_drafts_get","tags":["PodsDrafts"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","drafts"],"x-fern-sdk-method-name":"get"}},"/v0/pods/{pod_id}/drafts/{draft_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods drafts get-attachment --pod-id --draft-id --attachment-id \n```","operationId":"pods_drafts_getAttachment","tags":["PodsDrafts"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","drafts"],"x-fern-sdk-method-name":"get-attachment"}},"/v0/pods/{pod_id}/inboxes":{"get":{"description":"**CLI:**\n```bash\nagentmail pods inboxes list --pod-id \n```","operationId":"pods_inboxes_list","tags":["PodsInboxes"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesListInboxesResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Inboxes","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","inboxes"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail pods inboxes create --pod-id --username myagent --domain example.com\n```","operationId":"pods_inboxes_create","tags":["PodsInboxes"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesInbox"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesCreateInboxRequest"}}}},"x-fern-sdk-group-name":["pods","inboxes"],"x-fern-sdk-method-name":"create"}},"/v0/pods/{pod_id}/inboxes/{inbox_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods inboxes get --pod-id --inbox-id \n```","operationId":"pods_inboxes_get","tags":["PodsInboxes"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesInbox"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","inboxes"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail pods inboxes update --pod-id --inbox-id \n```","operationId":"pods_inboxes_update","tags":["PodsInboxes"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesInbox"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesUpdateInboxRequest"}}}},"x-fern-sdk-group-name":["pods","inboxes"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail pods inboxes delete --pod-id --inbox-id \n```","operationId":"pods_inboxes_delete","tags":["PodsInboxes"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","inboxes"],"x-fern-sdk-method-name":"delete"}},"/v0/pods/{pod_id}/lists/{direction}/{type}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods lists list --pod-id --direction --type \n```","operationId":"pods_lists_list","tags":["PodsLists"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodListListEntriesResponse"}}}}},"summary":"List Entries","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","lists"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail pods lists create --pod-id --direction --type --entry user@example.com\n```","operationId":"pods_lists_create","tags":["PodsLists"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodListEntry"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateListEntryRequest"}}}},"x-fern-sdk-group-name":["pods","lists"],"x-fern-sdk-method-name":"create"}},"/v0/pods/{pod_id}/lists/{direction}/{type}/{entry}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods lists get --pod-id --direction --type --entry \n```","operationId":"pods_lists_get","tags":["PodsLists"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"entry","in":"path","description":"Email address or domain.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodListEntry"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","lists"],"x-fern-sdk-method-name":"get"},"delete":{"description":"**CLI:**\n```bash\nagentmail pods lists delete --pod-id --direction --type --entry \n```","operationId":"pods_lists_delete","tags":["PodsLists"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"entry","in":"path","description":"Email address or domain.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","lists"],"x-fern-sdk-method-name":"delete"}},"/v0/pods/{pod_id}/metrics/events":{"get":{"description":"Counts of email events (sent, delivered, bounced, etc.) over time for\nthe pod. Defaults to the last 24 hours; `start` must be within the last\n90 days, and a future `end` is clamped to now. Omit `period` for\nindividual event counts, or set it to sum counts into buckets of that\nmany seconds.\n\n**CLI:**\n```bash\nagentmail pods metrics query-events --pod-id \n```","operationId":"pods_metrics_queryEvents","tags":["PodsMetrics"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"event_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricEventTypes","nullable":true}},{"name":"start","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Start","nullable":true}},{"name":"end","in":"query","required":false,"schema":{"$ref":"#/components/schemas/End","nullable":true}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricLimit","nullable":true}},{"name":"descending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Descending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryMetricsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Events","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","metrics"],"x-fern-sdk-method-name":"query-events"}},"/v0/pods/{pod_id}/metrics/usage":{"get":{"description":"Cumulative usage series for the pod. Each point is the running total of\nthe usage type at that timestamp, not the change within the bucket.\nPod-scoped queries carry every usage type except `pod_count`; requested\ntypes that don't apply to the scope are ignored. Defaults to the last\n24 hours; `start` must be within the last 90 days, and a future `end`\nis clamped to now. The range divided by `period` must not exceed 1000\nbuckets.","operationId":"pods_metrics_queryUsage","tags":["PodsMetrics"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"usage_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/UsageTypes","nullable":true}},{"name":"start","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Start","nullable":true}},{"name":"end","in":"query","required":false,"schema":{"$ref":"#/components/schemas/End","nullable":true}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricLimit","nullable":true}},{"name":"descending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Descending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryUsageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Usage","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","metrics"],"x-fern-sdk-method-name":"query-usage"}},"/v0/pods/{pod_id}/threads":{"get":{"description":"Lists threads in the pod, most recent first. Pass `senders`,\n`recipients`, or `subject` to filter by substring. Filtered requests are\nserved by search, which caps `limit` at 100. For relevance-ranked\nfull-text search, use `Search Threads`.\n\n**CLI:**\n```bash\nagentmail pods threads list --pod-id \n```","operationId":"pods_threads_list","tags":["PodsThreads"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}},{"name":"include_spam","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeSpam","nullable":true}},{"name":"include_blocked","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeBlocked","nullable":true}},{"name":"include_unauthenticated","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeUnauthenticated","nullable":true}},{"name":"include_trash","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeTrash","nullable":true}},{"name":"senders","in":"query","description":"Filter to threads whose senders contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"recipients","in":"query","description":"Filter to threads whose recipients contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"subject","in":"query","description":"Filter to threads whose subject contains this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListThreadsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Threads","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","threads"],"x-fern-sdk-method-name":"list"}},"/v0/pods/{pod_id}/threads/search":{"get":{"description":"Full-text search across threads in the pod, ranked by relevance. The\nquery is matched against senders, recipients, and subject (substring)\nand the message body (tokenized full text). Spam, trash, blocked, and\nunauthenticated threads are always excluded. `limit` cannot exceed 100.","operationId":"pods_threads_search","tags":["PodsThreads"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"q","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Query"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchThreadsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Search Threads","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","threads"],"x-fern-sdk-method-name":"search"}},"/v0/pods/{pod_id}/threads/{thread_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods threads get --pod-id --thread-id \n```","operationId":"pods_threads_get","tags":["PodsThreads"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","threads"],"x-fern-sdk-method-name":"get"},"patch":{"description":"Updates thread labels. Cannot add or remove system labels (sent, received, bounced, etc.). Rejects requests with a `422` for threads with 100 or more messages.","operationId":"pods_threads_update","tags":["PodsThreads"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadRequest"}}}},"x-fern-sdk-group-name":["pods","threads"],"x-fern-sdk-method-name":"update"},"delete":{"description":"Permanently deletes a thread and all of its messages.\n\n**CLI:**\n```bash\nagentmail pods threads delete --pod-id --thread-id \n```","operationId":"pods_threads_delete","tags":["PodsThreads"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","threads"],"x-fern-sdk-method-name":"delete"}},"/v0/pods/{pod_id}/threads/{thread_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods threads get-attachment --pod-id --thread-id --attachment-id \n```","operationId":"pods_threads_getAttachment","tags":["PodsThreads"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","threads"],"x-fern-sdk-method-name":"get-attachment"}},"/v0/pods/{pod_id}/webhooks":{"get":{"description":"**CLI:**\n```bash\nagentmail pods webhooks list --pod-id \n```","operationId":"pods_webhooks_list","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksListWebhooksResponse"}}}}},"summary":"List Webhooks","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"list"},"post":{"description":"Create a webhook scoped to this pod.\n\n**CLI:**\n```bash\nagentmail pods webhooks create --pod-id --url https://example.com/webhook --event-types message.received\n```","operationId":"pods_webhooks_create","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksCreatePodWebhookRequest"}}}},"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"create"}},"/v0/pods/{pod_id}/webhooks/{webhook_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods webhooks get --pod-id --webhook-id \n```","operationId":"pods_webhooks_get","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail pods webhooks update --pod-id --webhook-id --add-inbox-ids \n```","operationId":"pods_webhooks_update","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksUpdatePodWebhookRequest"}}}},"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail pods webhooks delete --pod-id --webhook-id \n```","operationId":"pods_webhooks_delete","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"delete"}},"/v0/pods/{pod_id}/webhooks/{webhook_id}/headers":{"get":{"description":"List the names of custom HTTP headers included with deliveries to this pod-scoped webhook.\nHeader values are write-only and are never returned.","operationId":"pods_webhooks_getHeaders","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhookHeaderNamesResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Webhook Headers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"get-headers"},"patch":{"description":"Atomically set, replace, or remove custom HTTP headers included with deliveries to this\npod-scoped webhook. Header values remain write-only.","operationId":"pods_webhooks_updateHeaders","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"204":{"description":""},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Webhook Headers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksUpdateWebhookHeadersRequest"}}}},"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"update-headers"}},"/v0/providers":{"get":{"description":"Lists providers, most popular first.","operationId":"providers_list","tags":["Providers"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProvidersResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"List Providers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["providers"],"x-fern-sdk-method-name":"list"}},"/v0/providers/search":{"get":{"description":"Searches providers by name prefix.","operationId":"providers_search","tags":["Providers"],"parameters":[{"name":"q","in":"query","description":"Name prefix to search for.","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchProvidersResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Search Providers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["providers"],"x-fern-sdk-method-name":"search"}},"/v0/providers/{provider_id}":{"get":{"operationId":"providers_get","tags":["Providers"],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Provider"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Provider","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["providers"],"x-fern-sdk-method-name":"get"}},"/v0/providers/{provider_id}/accounts":{"get":{"description":"Lists accounts at one provider, most recent sign-in first.","operationId":"providers_listAccounts","tags":["Providers"],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProviderAccountsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"List Provider Accounts","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["providers"],"x-fern-sdk-method-name":"list-accounts"}},"/v0/providers/{provider_id}/connect":{"post":{"description":"Starts signing an inbox in to a provider. Returns a `magic_url` valid\nfor five minutes; open it in the browser that will hold the sign-in.\nRequires `api_key_create` and an `Idempotency-Key` header.","operationId":"providers_connect","tags":["Providers"],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderId"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key that makes the connect idempotent. The endpoint requires one; the CLI generates a UUID when the flag is omitted and reuses it across retries, so a transient failure cannot start a second sign-in. Pass a value to make a manual re-run resolve to the same attempt.","schema":{"type":"string"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectProviderAccepted"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Connect Provider","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectProviderBody","nullable":true}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["providers"],"x-fern-sdk-method-name":"connect"}},"/v0/threads":{"get":{"description":"Lists threads, most recent first. Pass `senders`, `recipients`, or\n`subject` to filter by substring. Filtered requests are served by\nsearch, which caps `limit` at 100. For relevance-ranked full-text\nsearch across senders, recipients, subject, and message body, use\n`Search Threads`.\n\n**CLI:**\n```bash\nagentmail threads list\n```","operationId":"threads_list","tags":["Threads"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}},{"name":"include_spam","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeSpam","nullable":true}},{"name":"include_blocked","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeBlocked","nullable":true}},{"name":"include_unauthenticated","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeUnauthenticated","nullable":true}},{"name":"include_trash","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeTrash","nullable":true}},{"name":"senders","in":"query","description":"Filter to threads whose senders contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"recipients","in":"query","description":"Filter to threads whose recipients contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"subject","in":"query","description":"Filter to threads whose subject contains this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListThreadsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Threads","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["threads"],"x-fern-sdk-method-name":"list"}},"/v0/threads/search":{"get":{"description":"Full-text search across threads in the organization, ranked by\nrelevance. The query is matched against senders, recipients, and\nsubject (substring) and the message body (tokenized full text). Spam,\ntrash, blocked, and unauthenticated threads are always excluded.\n`limit` cannot exceed 100.","operationId":"threads_search","tags":["Threads"],"parameters":[{"name":"q","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Query"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchThreadsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Search Threads","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["threads"],"x-fern-sdk-method-name":"search"}},"/v0/threads/{thread_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail threads get --thread-id \n```","operationId":"threads_get","tags":["Threads"],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["threads"],"x-fern-sdk-method-name":"get"},"patch":{"description":"Updates thread labels. Cannot add or remove system labels (sent, received, bounced, etc.). Rejects requests with a `422` for threads with 100 or more messages.","operationId":"threads_update","tags":["Threads"],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadRequest"}}}},"x-fern-sdk-group-name":["threads"],"x-fern-sdk-method-name":"update"},"delete":{"description":"Permanently deletes a thread and all of its messages.\n\n**CLI:**\n```bash\nagentmail threads delete --thread-id \n```","operationId":"threads_delete","tags":["Threads"],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["threads"],"x-fern-sdk-method-name":"delete"}},"/v0/threads/{thread_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail threads get-attachment --thread-id --attachment-id \n```","operationId":"threads_getAttachment","tags":["Threads"],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["threads"],"x-fern-sdk-method-name":"get-attachment"}}},"components":{"schemas":{"Limit":{"title":"Limit","type":"integer","description":"Limit of number of items returned."},"Count":{"title":"Count","type":"integer","description":"Number of items returned."},"PageToken":{"title":"PageToken","type":"string","description":"Page token for pagination."},"Labels":{"title":"Labels","type":"array","items":{"type":"string"},"description":"Labels to filter by."},"Before":{"title":"Before","type":"string","format":"date-time","description":"Timestamp before which to filter by."},"After":{"title":"After","type":"string","format":"date-time","description":"Timestamp after which to filter by."},"Ascending":{"title":"Ascending","type":"boolean","description":"Sort in ascending temporal order."},"IncludeSpam":{"title":"IncludeSpam","type":"boolean","description":"Include spam in results."},"IncludeBlocked":{"title":"IncludeBlocked","type":"boolean","description":"Include blocked in results."},"IncludeUnauthenticated":{"title":"IncludeUnauthenticated","type":"boolean","description":"Include unauthenticated in results."},"IncludeTrash":{"title":"IncludeTrash","type":"boolean","description":"Include trash in results."},"OrganizationId":{"title":"OrganizationId","type":"string","description":"ID of organization."},"Query":{"title":"Query","type":"string","description":"Full-text search query. Matched against the sender, recipients, and\nsubject (substring) and the message body (tokenized full text)."},"ErrorName":{"title":"ErrorName","type":"string","description":"Name of error."},"ErrorMessage":{"title":"ErrorMessage","type":"string","description":"Error message."},"ErrorCode":{"title":"ErrorCode","type":"string","description":"Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text."},"ErrorFix":{"title":"ErrorFix","type":"string","description":"The concrete next action that resolves the error."},"ErrorDocs":{"title":"ErrorDocs","type":"string","description":"Link to the error reference entry for this code."},"ErrorResponse":{"title":"ErrorResponse","type":"object","properties":{"name":{"$ref":"#/components/schemas/ErrorName"},"code":{"$ref":"#/components/schemas/ErrorCode","nullable":true},"message":{"$ref":"#/components/schemas/ErrorMessage"},"fix":{"$ref":"#/components/schemas/ErrorFix","nullable":true},"docs":{"$ref":"#/components/schemas/ErrorDocs","nullable":true}},"required":["name","message"]},"ValidationErrorResponse":{"title":"ValidationErrorResponse","type":"object","properties":{"name":{"$ref":"#/components/schemas/ErrorName"},"code":{"$ref":"#/components/schemas/ErrorCode","nullable":true},"message":{"$ref":"#/components/schemas/ErrorMessage","nullable":true},"errors":{"description":"Validation errors. Each entry has a path and a message identifying the invalid field."},"fix":{"$ref":"#/components/schemas/ErrorFix","nullable":true},"docs":{"$ref":"#/components/schemas/ErrorDocs","nullable":true}},"required":["name","errors"]},"inboxesInboxId":{"title":"inboxesInboxId","type":"string","description":"The ID of the inbox."},"inboxesEmail":{"title":"inboxesEmail","type":"string","description":"Email address of the inbox."},"inboxesDisplayName":{"title":"inboxesDisplayName","type":"string","description":"Display name: `Display Name `."},"inboxesClientId":{"title":"inboxesClientId","type":"string","description":"Client ID of inbox."},"inboxesMetadataValue":{"title":"inboxesMetadataValue","oneOf":[{"type":"string"},{"type":"number","format":"double"},{"type":"boolean"}],"description":"A metadata value. May be a string, number, or boolean."},"inboxesMetadata":{"title":"inboxesMetadata","type":"object","additionalProperties":{"$ref":"#/components/schemas/inboxesMetadataValue"},"description":"Custom key-value pairs attached to the inbox. Up to 256 keys. Keys and\nstring values are each limited to 256 characters. When updating metadata,\nsend a key with a null value to remove that key."},"inboxesUpdateMetadata":{"title":"inboxesUpdateMetadata","type":"object","additionalProperties":{"$ref":"#/components/schemas/inboxesMetadataValue","nullable":true},"description":"Custom key-value pairs to merge into the inbox's existing metadata. A\nvalue may be a string, number, boolean, or null. Setting a key to null\nremoves it. Up to 256 keys; keys and string values are each limited to\n256 characters."},"inboxesInbox":{"title":"inboxesInbox","type":"object","properties":{"pod_id":{"$ref":"#/components/schemas/podsPodId"},"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"email":{"$ref":"#/components/schemas/inboxesEmail"},"display_name":{"$ref":"#/components/schemas/inboxesDisplayName","nullable":true},"client_id":{"$ref":"#/components/schemas/inboxesClientId","nullable":true},"metadata":{"$ref":"#/components/schemas/inboxesMetadata","nullable":true,"description":"Custom metadata attached to the inbox."},"updated_at":{"type":"string","format":"date-time","description":"Time at which inbox was last updated."},"created_at":{"type":"string","format":"date-time","description":"Time at which inbox was created."}},"required":["pod_id","inbox_id","email","updated_at","created_at"]},"inboxesListInboxesResponse":{"title":"inboxesListInboxesResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"inboxes":{"type":"array","items":{"$ref":"#/components/schemas/inboxesInbox"},"description":"Ordered by `created_at` descending."}},"required":["count","inboxes"]},"inboxesCreateInboxRequest":{"title":"inboxesCreateInboxRequest","type":"object","properties":{"username":{"type":"string","nullable":true,"description":"Username of address. Randomly generated if not specified."},"domain":{"type":"string","nullable":true,"description":"Domain of address. Must be a verified domain, or any subdomain of a\nverified domain that has subdomains enabled (e.g., `bot.example.com`).\nDefaults to `agentmail.to`."},"display_name":{"$ref":"#/components/schemas/inboxesDisplayName","nullable":true},"client_id":{"$ref":"#/components/schemas/inboxesClientId","nullable":true},"metadata":{"$ref":"#/components/schemas/inboxesMetadata","nullable":true,"description":"Custom metadata to attach to the inbox."}}},"inboxesUpdateInboxRequest":{"title":"inboxesUpdateInboxRequest","type":"object","properties":{"display_name":{"$ref":"#/components/schemas/inboxesDisplayName","nullable":true},"metadata":{"$ref":"#/components/schemas/inboxesUpdateMetadata","nullable":true,"description":"Metadata to merge into the inbox's existing metadata. Keys you include\nare added or overwritten; keys you omit are left unchanged. To remove a\nsingle key, send it with a null value. To clear all metadata, send\n`metadata` as null. Sending an empty object is rejected; use null to\nclear. Each update must include at least one of `display_name` or\n`metadata`."}}},"podsPodId":{"title":"podsPodId","type":"string","description":"ID of pod."},"podsName":{"title":"podsName","type":"string","description":"Name of pod."},"podsClientId":{"title":"podsClientId","type":"string","description":"Client ID of pod."},"podsPod":{"title":"podsPod","type":"object","properties":{"pod_id":{"$ref":"#/components/schemas/podsPodId"},"name":{"$ref":"#/components/schemas/podsName"},"updated_at":{"type":"string","format":"date-time","description":"Time at which pod was last updated."},"created_at":{"type":"string","format":"date-time","description":"Time at which pod was created."},"client_id":{"$ref":"#/components/schemas/podsClientId","nullable":true}},"required":["pod_id","name","updated_at","created_at"]},"podsListPodsResponse":{"title":"podsListPodsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"pods":{"type":"array","items":{"$ref":"#/components/schemas/podsPod"},"description":"Ordered by `created_at` descending."}},"required":["count","pods"]},"podsCreatePodRequest":{"title":"podsCreatePodRequest","type":"object","properties":{"name":{"$ref":"#/components/schemas/podsName","nullable":true},"client_id":{"$ref":"#/components/schemas/podsClientId","nullable":true}}},"webhooksWebhookId":{"title":"webhooksWebhookId","type":"string","description":"ID of webhook."},"webhooksClientId":{"title":"webhooksClientId","type":"string","description":"Client ID of webhook."},"webhooksUrl":{"title":"webhooksUrl","type":"string","description":"URL of webhook endpoint."},"webhooksWebhookHeaders":{"title":"webhooksWebhookHeaders","type":"object","additionalProperties":{"type":"string"},"description":"Custom HTTP headers to include with every delivery to this webhook. Header values are write-only:\nAgentMail never returns them from webhook read endpoints. The map must contain at least one entry\nwhen provided, and every name and value must be a valid HTTP header."},"webhooksWebhookHeaderNamesResponse":{"title":"webhooksWebhookHeaderNamesResponse","type":"object","properties":{"header_names":{"type":"array","items":{"type":"string"},"description":"Names of the custom delivery headers configured for this webhook. Header values are never returned."}},"required":["header_names"]},"webhooksWebhook":{"title":"webhooksWebhook","type":"object","properties":{"webhook_id":{"$ref":"#/components/schemas/webhooksWebhookId"},"url":{"$ref":"#/components/schemas/webhooksUrl"},"event_types":{"$ref":"#/components/schemas/EventTypes","nullable":true},"pod_ids":{"$ref":"#/components/schemas/PodIds","nullable":true},"inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true},"secret":{"type":"string","description":"Secret for webhook signature verification."},"enabled":{"type":"boolean","description":"Webhook is enabled."},"updated_at":{"type":"string","format":"date-time","description":"Time at which webhook was last updated."},"created_at":{"type":"string","format":"date-time","description":"Time at which webhook was created."},"client_id":{"$ref":"#/components/schemas/webhooksClientId","nullable":true}},"required":["webhook_id","url","secret","enabled","updated_at","created_at"]},"webhooksListWebhooksResponse":{"title":"webhooksListWebhooksResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/webhooksWebhook"},"description":"Ordered by `created_at` descending."}},"required":["count","webhooks"]},"webhooksCreateWebhookEventTypes":{"title":"webhooksCreateWebhookEventTypes","$ref":"#/components/schemas/EventTypes","description":"Full list of event types this webhook should receive. At least one type is required. Send every type you\nwant in this array (not incremental). See [Webhooks overview](https://docs.agentmail.to/webhooks-overview)\nfor spam, blocked, and unauthenticated events and required permissions."},"webhooksUpdateWebhookEventTypes":{"title":"webhooksUpdateWebhookEventTypes","$ref":"#/components/schemas/EventTypes","description":"When you send a non-empty list, it replaces the webhook's subscribed event types in full (the same\n\"set the list\" behavior as create). It is not a merge or diff: include every event type you want after\nthe update. Sending a one-element array means the webhook will only receive that one type afterward.\nOmit this field or send an empty array to leave event types unchanged. Clearing all types with an empty\nlist is not supported. Subscribing to `message.received.spam`, `message.received.blocked`, or\n`message.received.unauthenticated` requires the matching label permission on the API key."},"webhooksCreateInboxWebhookRequest":{"title":"webhooksCreateInboxWebhookRequest","type":"object","description":"Create a webhook scoped to an inbox. The inbox comes from the path, so `inbox_ids` and `pod_ids`\nare not accepted.","properties":{"url":{"$ref":"#/components/schemas/webhooksUrl"},"event_types":{"$ref":"#/components/schemas/webhooksCreateWebhookEventTypes"},"client_id":{"$ref":"#/components/schemas/webhooksClientId","nullable":true},"headers":{"$ref":"#/components/schemas/webhooksWebhookHeaders","nullable":true}},"required":["url","event_types"]},"webhooksCreatePodWebhookRequest":{"title":"webhooksCreatePodWebhookRequest","type":"object","description":"Create a webhook scoped to a pod. The pod comes from the path, so `pod_ids` is not accepted.\nOptionally pass `inbox_ids` to narrow the webhook to specific inboxes within the pod; omit to\nreceive events for the whole pod.","properties":{"inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true}},"allOf":[{"$ref":"#/components/schemas/webhooksCreateInboxWebhookRequest"}]},"webhooksCreateWebhookRequest":{"title":"webhooksCreateWebhookRequest","type":"object","properties":{"pod_ids":{"$ref":"#/components/schemas/PodIds","nullable":true}},"allOf":[{"$ref":"#/components/schemas/webhooksCreatePodWebhookRequest"}]},"webhooksUpdateInboxWebhookRequest":{"title":"webhooksUpdateInboxWebhookRequest","type":"object","description":"Update an inbox-scoped webhook. It is fixed to its inbox, so only `event_types` can change.","properties":{"event_types":{"$ref":"#/components/schemas/webhooksUpdateWebhookEventTypes","nullable":true}}},"webhooksUpdatePodWebhookRequest":{"title":"webhooksUpdatePodWebhookRequest","type":"object","description":"Update a pod-scoped webhook. You can adjust which inboxes within the pod it listens to and replace\nits `event_types`, but not the pod scope itself.","properties":{"add_inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true,"description":"Inbox IDs to subscribe to the webhook."},"remove_inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true,"description":"Inbox IDs to unsubscribe from the webhook."}},"allOf":[{"$ref":"#/components/schemas/webhooksUpdateInboxWebhookRequest"}]},"webhooksUpdateWebhookRequest":{"title":"webhooksUpdateWebhookRequest","type":"object","properties":{"add_pod_ids":{"$ref":"#/components/schemas/PodIds","nullable":true,"description":"Pod IDs to subscribe to the webhook."},"remove_pod_ids":{"$ref":"#/components/schemas/PodIds","nullable":true,"description":"Pod IDs to unsubscribe from the webhook."}},"allOf":[{"$ref":"#/components/schemas/webhooksUpdatePodWebhookRequest"}]},"webhooksUpdateWebhookHeadersRequest":{"title":"webhooksUpdateWebhookHeadersRequest","type":"object","description":"Set, replace, or remove custom delivery headers. Provide at least one of `headers` or\n`remove_headers`. A header cannot be set and removed in the same request, regardless of casing.","properties":{"headers":{"$ref":"#/components/schemas/webhooksWebhookHeaders","nullable":true},"remove_headers":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Names of custom delivery headers to remove."}}},"AccountId":{"title":"AccountId","type":"string","format":"uuid","description":"ID of account."},"ProviderId":{"title":"ProviderId","type":"string","format":"uuid","description":"ID of provider."},"Account":{"title":"Account","type":"object","description":"One inbox signed in at one provider.","properties":{"account_id":{"$ref":"#/components/schemas/AccountId"},"provider_id":{"$ref":"#/components/schemas/ProviderId"},"provider_name":{"type":"string","nullable":true,"description":"Display name of provider."},"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"pod_id":{"$ref":"#/components/schemas/podsPodId"},"organization_id":{"$ref":"#/components/schemas/OrganizationId"},"first_signed_in_at":{"type":"string","format":"date-time","description":"Time of first sign-in at provider."},"last_signed_in_at":{"type":"string","format":"date-time","description":"Time of most recent sign-in at provider."},"sign_in_count":{"type":"integer","description":"Number of sign-ins at provider."}},"required":["account_id","provider_id","inbox_id","pod_id","organization_id","first_signed_in_at","last_signed_in_at","sign_in_count"]},"ListAccountsResponse":{"title":"ListAccountsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}},"required":["count","limit","accounts"]},"AgentSignupRequest":{"title":"AgentSignupRequest","type":"object","description":"Request body to sign up an agent.","properties":{"human_email":{"type":"string","description":"Email address of the human who owns the agent. A 6-digit OTP will be sent to this address."},"username":{"type":"string","description":"Username for the auto-created inbox (e.g. \"my-agent\" creates my-agent@agentmail.to)."},"source":{"type":"string","nullable":true,"description":"The SDK, framework, or platform issuing this sign-up (e.g. `agentmail-python`, `agentmail-cli`, `agentmail-mcp`).\nIdentifies the caller — answers \"who is signing up\".\nMax 2048 characters."},"referrer":{"type":"string","nullable":true,"description":"The channel that drove this sign-up — where the agent or its developer discovered AgentMail\n(e.g. `agent.email`, a partner URL, a campaign tag). Answers \"where did this sign-up come from\".\nMax 2048 characters."}},"required":["human_email","username"]},"AgentSignupResponse":{"title":"AgentSignupResponse","type":"object","description":"Response after successful agent sign-up.","properties":{"organization_id":{"type":"string","description":"ID of the created organization."},"inbox_id":{"type":"string","description":"ID of the auto-created inbox."},"api_key":{"type":"string","description":"API key for authenticating subsequent requests. Store this securely, it cannot be retrieved again."}},"required":["organization_id","inbox_id","api_key"]},"AgentVerifyRequest":{"title":"AgentVerifyRequest","type":"object","description":"Request body to verify an agent with an OTP code.","properties":{"otp_code":{"type":"string","description":"6-digit verification code sent to the human's email address."}},"required":["otp_code"]},"AgentVerifyResponse":{"title":"AgentVerifyResponse","type":"object","description":"Response after successful agent verification.","properties":{"verified":{"type":"boolean","description":"Whether the organization was verified."}},"required":["verified"]},"ApiKeyId":{"title":"ApiKeyId","type":"string","description":"ID of api key."},"Prefix":{"title":"Prefix","type":"string","description":"Prefix of api key."},"Name":{"title":"Name","type":"string","description":"Name of api key."},"CreatedAt":{"title":"CreatedAt","type":"string","format":"date-time","description":"Time at which api key was created."},"PublicJwkCoordinate":{"title":"PublicJwkCoordinate","type":"string","pattern":"^[A-Za-z0-9_-]{43}$","minLength":43,"maxLength":43,"description":"A 32-byte P-256 coordinate encoded as unpadded base64url."},"PublicJwk":{"title":"PublicJwk","type":"object","description":"A public P-256 JWK. The object accepts exactly `kty`, `crv`, `x`, and `y`.\nPrivate key material such as `d`, embedded key IDs, and all other members\nare rejected. The server also rejects coordinates that are not a point on\nP-256.","properties":{"kty":{"type":"string","const":"EC"},"crv":{"type":"string","const":"P-256"},"x":{"$ref":"#/components/schemas/PublicJwkCoordinate"},"y":{"$ref":"#/components/schemas/PublicJwkCoordinate"}},"required":["kty","crv","x","y"]},"OrganizationPublicKeyScope":{"title":"OrganizationPublicKeyScope","type":"object","description":"Organization-wide authority.","properties":{}},"PodPublicKeyScope":{"title":"PodPublicKeyScope","type":"object","description":"Authority over one live pod and its inboxes.","properties":{"id":{"type":"string","format":"uuid","description":"ID of the pod."}},"required":["id"]},"InboxPublicKeyScope":{"title":"InboxPublicKeyScope","type":"object","description":"Authority over one live inbox incarnation.","properties":{"id":{"type":"string","format":"email","maxLength":254,"description":"ID of the inbox."}},"required":["id"]},"PublicKeyScope":{"title":"PublicKeyScope","oneOf":[{"type":"object","allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["organization"]}}},{"$ref":"#/components/schemas/OrganizationPublicKeyScope"}],"required":["type"]},{"type":"object","allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["pod"]}}},{"$ref":"#/components/schemas/PodPublicKeyScope"}],"required":["type"]},{"type":"object","allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["inbox"]}}},{"$ref":"#/components/schemas/InboxPublicKeyScope"}],"required":["type"]}],"description":"The immutable scope in which a public-key credential can approve AgentID sign-in."},"PublicKeyMaterial":{"title":"PublicKeyMaterial","type":"object","description":"Registered public key material and its server-computed RFC 7638 thumbprint.","properties":{"jwk":{"$ref":"#/components/schemas/PublicJwk"},"fingerprint":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$","minLength":43,"maxLength":43,"description":"RFC 7638 SHA-256 JWK thumbprint encoded as unpadded base64url."}},"required":["jwk","fingerprint"]},"PublicKeyCredential":{"title":"PublicKeyCredential","type":"object","description":"An AgentID sign-in credential. `type` and `api_key_id` are server-owned;\nuse `api_key_id` as the JWS `kid`. This response never contains a bearer\nsecret or private key.","properties":{"api_key_id":{"type":"string","format":"uuid","description":"Server-generated credential ID. Store this value as the signing key's `kid`."},"type":{"type":"string","const":"public_key","description":"Server-owned credential discriminator. Callers cannot select or update it."},"name":{"$ref":"#/components/schemas/Name","description":"Human-readable credential name."},"public_key":{"$ref":"#/components/schemas/PublicKeyMaterial"},"scope":{"$ref":"#/components/schemas/PublicKeyScope"},"expires_at":{"type":"string","format":"date-time","nullable":true,"description":"Immutable absolute expiry. Omitted when the credential does not expire."},"revoked_at":{"type":"string","format":"date-time","nullable":true,"description":"Present when organization-wide revoke-all invalidated this credential generation."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["api_key_id","type","name","public_key","scope","created_at","updated_at"]},"CreatePublicKeyRequest":{"title":"CreatePublicKeyRequest","type":"object","description":"Register only a public P-256 JWK. Credential type, `api_key_id`, sign-in\neligibility, permissions, and generation are server-owned and are not\nrequest properties.","properties":{"public_key":{"$ref":"#/components/schemas/PublicJwk"},"name":{"type":"string","minLength":1,"maxLength":256,"nullable":true,"description":"Defaults to `AgentID key {first eight fingerprint characters}`."},"scope":{"$ref":"#/components/schemas/PublicKeyScope","nullable":true,"description":"Omit to inherit the registering bearer key's exact scope. An explicit\nscope must be the caller's scope or a live descendant."},"expires_at":{"type":"string","format":"date-time","nullable":true,"description":"Future absolute expiry. Omit to inherit the registering bearer key's\nexpiry. A child credential cannot outlive its creator."}},"required":["public_key"]},"UpdatePublicKeyNameRequest":{"title":"UpdatePublicKeyNameRequest","type":"object","description":"Rename a public-key credential. Key material, ID, type, scope, sign-in\neligibility, permissions, generation, and expiry are immutable.","properties":{"name":{"type":"string","minLength":1,"maxLength":256}},"required":["name"]},"ListPublicKeysResponse":{"title":"ListPublicKeysResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"public_keys":{"type":"array","items":{"$ref":"#/components/schemas/PublicKeyCredential"},"description":"Public-key credentials only, ordered by creation time descending by default."}},"required":["count","public_keys"]},"RevokeAllAgentIdSignInKeysResponse":{"title":"RevokeAllAgentIdSignInKeysResponse","type":"object","description":"Permanent idempotency receipt for an organization-wide AgentID sign-in key revocation.","properties":{"previous_generation":{"type":"integer","minimum":0},"current_generation":{"type":"integer","minimum":1},"revoked_at":{"type":"string","format":"date-time"}},"required":["previous_generation","current_generation","revoked_at"]},"BrowserEnrollmentTransactionJti":{"title":"BrowserEnrollmentTransactionJti","type":"string","pattern":"^[A-Za-z0-9_-]{22}$","minLength":22,"maxLength":22,"description":"Transaction identifier read from an enrollment action on exactly `https://auth.agentid.com`."},"CreateBrowserEnrollmentRequest":{"title":"CreateBrowserEnrollmentRequest","type":"object","description":"Attach a browser enrollment intent to one pending AgentID authorization\ntransaction. The inbox is selected by the trusted path parameter, not an\nAgentID `login_hint`.","properties":{"transaction_jti":{"$ref":"#/components/schemas/BrowserEnrollmentTransactionJti"}},"required":["transaction_jti"]},"BrowserEnrollmentAccepted":{"title":"BrowserEnrollmentAccepted","type":"object","description":"Pending enrollment receipt. The browser completes key creation and proof\non the existing AgentID page. This response contains no URL, token, or\nnavigation instruction.","properties":{"status":{"type":"string","const":"pending"},"enrollment_id":{"type":"string","format":"uuid"},"expires_at":{"type":"integer","minimum":1,"description":"Unix timestamp after which the pending enrollment cannot be activated."}},"required":["status","enrollment_id","expires_at"]},"BrowserCredentialCreator":{"title":"BrowserCredentialCreator","type":"object","properties":{"kind":{"type":"string","const":"bearer_api_key"},"api_key_id":{"type":"string","format":"uuid","description":"Bearer API key that authorized creation of the browser credential."},"created_at":{"type":"string","format":"date-time","description":"Incarnation timestamp of the authorizing bearer API key."}},"required":["kind","api_key_id","created_at"]},"BrowserCredential":{"title":"BrowserCredential","type":"object","description":"Owner-facing metadata for an active browser credential. Private key material never leaves the browser.","properties":{"credential_id":{"type":"string","format":"uuid"},"public_key_fingerprint_prefix":{"type":"string","pattern":"^[A-Za-z0-9_-]{8}$","minLength":8,"maxLength":8},"organization_id":{"type":"string","format":"uuid"},"pod_id":{"type":"string","format":"uuid"},"inbox_id":{"type":"string","format":"email","maxLength":254},"created_by":{"$ref":"#/components/schemas/BrowserCredentialCreator"},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"}},"required":["credential_id","public_key_fingerprint_prefix","organization_id","pod_id","inbox_id","created_by","created_at","expires_at"]},"BrowserConsent":{"title":"BrowserConsent","type":"object","description":"Remembered approval for one closed AgentID client and inbox.","properties":{"consent_id":{"type":"string","pattern":"^brc1_[A-Za-z0-9_-]{43}$","minLength":48,"maxLength":48},"inbox_id":{"type":"string","format":"email","maxLength":254},"client_type":{"type":"string","const":"closed"},"client_id":{"type":"string","minLength":1,"maxLength":2048},"client_url":{"type":"string","nullable":true,"description":"Registered client URL, when one is available."},"approved_scopes":{"type":"array","items":{"type":"string"},"description":"At least one non-empty scope approved for this client."},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"}},"required":["consent_id","inbox_id","client_type","client_id","approved_scopes","created_at","updated_at","expires_at"]},"BrowserLifecycleApiKeyActor":{"title":"BrowserLifecycleApiKeyActor","type":"object","properties":{"api_key_id":{"type":"string","format":"uuid"}},"required":["api_key_id"]},"BrowserLifecycleCredentialActor":{"title":"BrowserLifecycleCredentialActor","type":"object","properties":{"credential_id":{"type":"string","format":"uuid"},"authorizing_api_key_id":{"type":"string","format":"uuid"}},"required":["credential_id","authorizing_api_key_id"]},"BrowserLifecycleActor":{"title":"BrowserLifecycleActor","oneOf":[{"type":"object","allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["api_key"]}}},{"$ref":"#/components/schemas/BrowserLifecycleApiKeyActor"}],"required":["type"]},{"type":"object","allOf":[{"type":"object","properties":{"type":{"type":"string","enum":["browser_credential"]}}},{"$ref":"#/components/schemas/BrowserLifecycleCredentialActor"}],"required":["type"]}]},"BrowserEnrollmentLifecycleEventType":{"title":"BrowserEnrollmentLifecycleEventType","type":"string","enum":["browser_enrollment_intent_created","browser_credential_activated","browser_enrollment_cancelled","browser_credential_deleted"]},"BrowserConsentLifecycleEventType":{"title":"BrowserConsentLifecycleEventType","type":"string","enum":["browser_consent_created","browser_consent_updated","browser_consent_reused","browser_consent_revoked"]},"BrowserEnrollmentLifecycleEvent":{"title":"BrowserEnrollmentLifecycleEvent","type":"object","properties":{"type":{"$ref":"#/components/schemas/BrowserEnrollmentLifecycleEventType"},"trace_id":{"type":"string","format":"uuid"},"event_id":{"type":"string","format":"uuid"},"occurred_at":{"type":"string","format":"date-time"},"organization_id":{"type":"string","format":"uuid"},"pod_id":{"type":"string","format":"uuid"},"actor":{"$ref":"#/components/schemas/BrowserLifecycleActor"},"enrollment_id":{"type":"string","format":"uuid"},"credential_id":{"type":"string","format":"uuid"}},"required":["type","trace_id","event_id","occurred_at","organization_id","pod_id","actor","enrollment_id","credential_id"]},"BrowserConsentLifecycleEvent":{"title":"BrowserConsentLifecycleEvent","type":"object","properties":{"type":{"$ref":"#/components/schemas/BrowserConsentLifecycleEventType"},"trace_id":{"type":"string","format":"uuid"},"event_id":{"type":"string","format":"uuid"},"occurred_at":{"type":"string","format":"date-time"},"organization_id":{"type":"string","format":"uuid"},"pod_id":{"type":"string","format":"uuid"},"actor":{"$ref":"#/components/schemas/BrowserLifecycleActor"},"consent_id":{"type":"string","pattern":"^brc1_[A-Za-z0-9_-]{43}$","minLength":48,"maxLength":48},"client_type":{"type":"string","const":"closed"},"client_id":{"type":"string","minLength":1,"maxLength":2048}},"required":["type","trace_id","event_id","occurred_at","organization_id","pod_id","actor","consent_id","client_type","client_id"]},"BrowserLifecycleEvent":{"title":"BrowserLifecycleEvent","oneOf":[{"$ref":"#/components/schemas/BrowserEnrollmentLifecycleEvent"},{"$ref":"#/components/schemas/BrowserConsentLifecycleEvent"}]},"BrowserAuthorizationListLimit":{"title":"BrowserAuthorizationListLimit","type":"integer","minimum":1,"maximum":100},"ListBrowserCredentialsResponse":{"title":"ListBrowserCredentialsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/BrowserAuthorizationListLimit"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"credentials":{"type":"array","items":{"$ref":"#/components/schemas/BrowserCredential"}}},"required":["count","limit","credentials"]},"ListBrowserConsentsResponse":{"title":"ListBrowserConsentsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/BrowserAuthorizationListLimit"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"consents":{"type":"array","items":{"$ref":"#/components/schemas/BrowserConsent"}}},"required":["count","limit","consents"]},"ListBrowserLifecycleEventsResponse":{"title":"ListBrowserLifecycleEventsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/BrowserAuthorizationListLimit"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"events":{"type":"array","items":{"$ref":"#/components/schemas/BrowserLifecycleEvent"}}},"required":["count","limit","events"]},"ApiKeyPermissions":{"title":"ApiKeyPermissions","type":"object","description":"Granular permissions for the API key. When ommitted all permissions are granted. Otherwise, only permissions set to true are granted.","properties":{"inbox_read":{"type":"boolean","nullable":true,"description":"Read inbox details."},"inbox_create":{"type":"boolean","nullable":true,"description":"Create new inboxes."},"inbox_update":{"type":"boolean","nullable":true,"description":"Update inbox settings."},"inbox_delete":{"type":"boolean","nullable":true,"description":"Delete inboxes."},"message_read":{"type":"boolean","nullable":true,"description":"Read messages. Also required to read threads."},"message_send":{"type":"boolean","nullable":true,"description":"Send messages."},"message_update":{"type":"boolean","nullable":true,"description":"Update message labels. Also required to update threads."},"message_delete":{"type":"boolean","nullable":true,"description":"Delete messages. Also required to delete threads."},"label_spam_read":{"type":"boolean","nullable":true,"description":"Access messages labeled spam."},"label_blocked_read":{"type":"boolean","nullable":true,"description":"Access messages labeled blocked."},"label_unauthenticated_read":{"type":"boolean","nullable":true,"description":"Access messages labeled unauthenticated."},"label_trash_read":{"type":"boolean","nullable":true,"description":"Access messages labeled trash."},"draft_read":{"type":"boolean","nullable":true,"description":"Read drafts."},"draft_create":{"type":"boolean","nullable":true,"description":"Create drafts."},"draft_update":{"type":"boolean","nullable":true,"description":"Update drafts."},"draft_delete":{"type":"boolean","nullable":true,"description":"Delete drafts."},"draft_send":{"type":"boolean","nullable":true,"description":"Send drafts."},"webhook_read":{"type":"boolean","nullable":true,"description":"Read webhook configurations."},"webhook_create":{"type":"boolean","nullable":true,"description":"Create webhooks."},"webhook_update":{"type":"boolean","nullable":true,"description":"Update webhooks."},"webhook_delete":{"type":"boolean","nullable":true,"description":"Delete webhooks."},"domain_read":{"type":"boolean","nullable":true,"description":"Read domain details."},"domain_create":{"type":"boolean","nullable":true,"description":"Create domains."},"domain_update":{"type":"boolean","nullable":true,"description":"Update domains."},"domain_delete":{"type":"boolean","nullable":true,"description":"Delete domains."},"list_entry_read":{"type":"boolean","nullable":true,"description":"Read list entries."},"list_entry_create":{"type":"boolean","nullable":true,"description":"Create list entries."},"list_entry_delete":{"type":"boolean","nullable":true,"description":"Delete list entries."},"metrics_read":{"type":"boolean","nullable":true,"description":"Read metrics."},"api_key_read":{"type":"boolean","nullable":true,"description":"Read API keys."},"api_key_create":{"type":"boolean","nullable":true,"description":"Create API keys."},"api_key_update":{"type":"boolean","nullable":true,"description":"Update API keys."},"api_key_delete":{"type":"boolean","nullable":true,"description":"Delete API keys."},"pod_read":{"type":"boolean","nullable":true,"description":"Read pods."},"pod_create":{"type":"boolean","nullable":true,"description":"Create pods."},"pod_delete":{"type":"boolean","nullable":true,"description":"Delete pods."}}},"ApiKey":{"title":"ApiKey","type":"object","properties":{"api_key_id":{"$ref":"#/components/schemas/ApiKeyId"},"prefix":{"$ref":"#/components/schemas/Prefix"},"name":{"$ref":"#/components/schemas/Name"},"pod_id":{"type":"string","nullable":true,"description":"Pod ID the api key is scoped to. If set, the key can only access resources within this pod."},"inbox_id":{"type":"string","nullable":true,"description":"Inbox ID the api key is scoped to. If set, the key can only access resources within this inbox."},"used_at":{"type":"string","format":"date-time","nullable":true,"description":"Time at which api key was last used."},"permissions":{"$ref":"#/components/schemas/ApiKeyPermissions","nullable":true},"created_at":{"$ref":"#/components/schemas/CreatedAt"}},"required":["api_key_id","prefix","name","created_at"]},"CreateApiKeyResponse":{"title":"CreateApiKeyResponse","type":"object","properties":{"api_key_id":{"$ref":"#/components/schemas/ApiKeyId"},"api_key":{"type":"string","description":"API key."},"prefix":{"$ref":"#/components/schemas/Prefix"},"name":{"$ref":"#/components/schemas/Name"},"pod_id":{"type":"string","nullable":true,"description":"Pod ID the api key is scoped to."},"inbox_id":{"type":"string","nullable":true,"description":"Inbox ID the api key is scoped to."},"permissions":{"$ref":"#/components/schemas/ApiKeyPermissions","nullable":true},"created_at":{"$ref":"#/components/schemas/CreatedAt"}},"required":["api_key_id","api_key","prefix","name","created_at"]},"ListApiKeysResponse":{"title":"ListApiKeysResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"api_keys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"},"description":"Ordered by `created_at` descending."}},"required":["count","api_keys"]},"CreateApiKeyRequest":{"title":"CreateApiKeyRequest","type":"object","properties":{"name":{"$ref":"#/components/schemas/Name","nullable":true},"permissions":{"$ref":"#/components/schemas/ApiKeyPermissions","nullable":true}}},"AttachmentId":{"title":"AttachmentId","type":"string","description":"ID of attachment."},"AttachmentFilename":{"title":"AttachmentFilename","type":"string","description":"Filename of attachment."},"AttachmentSize":{"title":"AttachmentSize","type":"integer","description":"Size of attachment in bytes."},"AttachmentContentType":{"title":"AttachmentContentType","type":"string","description":"Content type of attachment."},"AttachmentContentDisposition":{"title":"AttachmentContentDisposition","type":"string","enum":["inline","attachment"],"description":"Content disposition of attachment."},"AttachmentContentId":{"title":"AttachmentContentId","type":"string","description":"Content ID of attachment."},"Attachment":{"title":"Attachment","type":"object","properties":{"attachment_id":{"$ref":"#/components/schemas/AttachmentId"},"filename":{"$ref":"#/components/schemas/AttachmentFilename","nullable":true},"size":{"$ref":"#/components/schemas/AttachmentSize"},"content_type":{"$ref":"#/components/schemas/AttachmentContentType","nullable":true},"content_disposition":{"$ref":"#/components/schemas/AttachmentContentDisposition","nullable":true},"content_id":{"$ref":"#/components/schemas/AttachmentContentId","nullable":true}},"required":["attachment_id","size"]},"AttachmentResponse":{"title":"AttachmentResponse","type":"object","properties":{"attachment_id":{"$ref":"#/components/schemas/AttachmentId"},"filename":{"$ref":"#/components/schemas/AttachmentFilename","nullable":true},"size":{"$ref":"#/components/schemas/AttachmentSize"},"content_type":{"$ref":"#/components/schemas/AttachmentContentType","nullable":true},"content_disposition":{"$ref":"#/components/schemas/AttachmentContentDisposition","nullable":true},"content_id":{"$ref":"#/components/schemas/AttachmentContentId","nullable":true},"download_url":{"type":"string","description":"URL to download the attachment."},"expires_at":{"type":"string","format":"date-time","description":"Time at which the download URL expires."}},"required":["attachment_id","size","download_url","expires_at"]},"SendAttachment":{"title":"SendAttachment","type":"object","description":"Provide either `content` or `url` for each attachment.","properties":{"filename":{"$ref":"#/components/schemas/AttachmentFilename","nullable":true},"content_type":{"$ref":"#/components/schemas/AttachmentContentType","nullable":true},"content_disposition":{"$ref":"#/components/schemas/AttachmentContentDisposition","nullable":true},"content_id":{"$ref":"#/components/schemas/AttachmentContentId","nullable":true},"content":{"type":"string","nullable":true,"description":"Base64 encoded content of the attachment. The entire request, including the message body and all attachments, is limited to 6 MB."},"url":{"type":"string","nullable":true,"description":"URL that AgentMail can download without custom authentication headers or cookies.\nRedirects and pre-signed URLs are supported, and the final response must be a\nsuccessful 2xx response. Keep URL-backed attachments around 30 MB total per message."}}},"ScopeType":{"title":"ScopeType","type":"string","enum":["organization","pod","inbox"],"description":"The scope tier the authenticated credential is bound to."},"Identity":{"title":"Identity","type":"object","description":"Identity and scope of the authenticated credential.","properties":{"scope_type":{"$ref":"#/components/schemas/ScopeType"},"scope_id":{"type":"string","description":"ID of the most specific scope the credential is bound to.\nEquals inbox_id when scope_type is inbox, pod_id when pod, organization_id when organization."},"organization_id":{"$ref":"#/components/schemas/OrganizationId"},"pod_id":{"type":"string","nullable":true,"description":"ID of the pod the credential is scoped to. Present when scope_type is pod or inbox."},"inbox_id":{"type":"string","nullable":true,"description":"ID of the inbox the credential is scoped to. Present when scope_type is inbox."},"api_key_id":{"type":"string","nullable":true,"description":"ID of the API key used to authenticate. Absent for JWT and proxy credentials."}},"required":["scope_type","scope_id","organization_id"]},"DomainId":{"title":"DomainId","type":"string","description":"The ID of the domain."},"DomainName":{"title":"DomainName","type":"string","description":"The name of the domain (e.g., `example.com`)."},"RecordType":{"title":"RecordType","type":"string","enum":["TXT","CNAME","MX"]},"VerificationStatus":{"title":"VerificationStatus","type":"string","enum":["NOT_STARTED","PENDING","INVALID","FAILED","VERIFYING","VERIFIED"]},"RecordStatus":{"title":"RecordStatus","type":"string","enum":["MISSING","INVALID","VALID"]},"VerificationRecord":{"title":"VerificationRecord","type":"object","properties":{"type":{"$ref":"#/components/schemas/RecordType","description":"The type of the DNS record."},"name":{"type":"string","description":"The name or host of the record."},"value":{"type":"string","description":"The value of the record."},"status":{"$ref":"#/components/schemas/RecordStatus","description":"The verification status of this specific record."},"priority":{"type":"integer","nullable":true,"description":"The priority of the MX record."},"reason":{"type":"string","nullable":true,"description":"Why the record is INVALID, when known. `duplicate_records` means the expected value is present but extra records coexist at the same name; `value_mismatch` means a record exists but does not match the expected value."}},"required":["type","name","value","status"]},"Status":{"title":"Status","$ref":"#/components/schemas/VerificationStatus","description":"The verification status of the domain."},"FeedbackEnabled":{"title":"FeedbackEnabled","type":"boolean","description":"Bounce and complaint notifications are sent to your inboxes."},"SubdomainsEnabled":{"title":"SubdomainsEnabled","type":"boolean","description":"Allow inboxes on any subdomain of this domain. Adds a required wildcard MX\nrecord (`*.`) to `records`."},"TrackingEnabled":{"title":"TrackingEnabled","type":"boolean","description":"Serve open tracking pixels from this domain. Adds a required `link.`\nCNAME record to `records`, which must be published and verified before\n`track_opens` can be used on a send."},"ClientId":{"title":"ClientId","type":"string","description":"Client ID of domain."},"Domain":{"title":"Domain","type":"object","properties":{"pod_id":{"$ref":"#/components/schemas/podsPodId","nullable":true},"domain_id":{"$ref":"#/components/schemas/DomainId"},"domain":{"$ref":"#/components/schemas/DomainName"},"status":{"$ref":"#/components/schemas/Status"},"reason":{"type":"string","nullable":true,"description":"Why the domain is not (yet) VERIFIED, when known. `dns_records_missing` / `dns_records_invalid` point at the DNS records. The `ses_*` values mean the records look right and sending-infrastructure validation has not converged: `ses_dkim_pending` / `ses_mail_from_pending` (still checking), `ses_dkim_temporary_failure` / `ses_mail_from_temporary_failure` (a transient error the infrastructure keeps retrying on its own — usually resolves without changes), `ses_dkim_failed` / `ses_mail_from_failed` (a terminal verdict; re-verify after fixing), `ses_dkim_not_started` / `ses_mail_from_not_started` (the attribute was never configured on the identity — re-verify to push it), and `ses_not_verified_for_sending`. Absent when VERIFIED."},"feedback_enabled":{"$ref":"#/components/schemas/FeedbackEnabled"},"subdomains_enabled":{"$ref":"#/components/schemas/SubdomainsEnabled"},"tracking_enabled":{"$ref":"#/components/schemas/TrackingEnabled"},"records":{"type":"array","items":{"$ref":"#/components/schemas/VerificationRecord"},"description":"A list of DNS records required to verify the domain. Includes a\nwildcard MX record (`*.`) when `subdomains_enabled` is true."},"client_id":{"$ref":"#/components/schemas/ClientId","nullable":true},"updated_at":{"type":"string","format":"date-time","description":"Time at which the domain was last updated."},"created_at":{"type":"string","format":"date-time","description":"Time at which the domain was created."}},"required":["domain_id","domain","status","feedback_enabled","subdomains_enabled","tracking_enabled","records","updated_at","created_at"]},"DomainItem":{"title":"DomainItem","type":"object","properties":{"pod_id":{"$ref":"#/components/schemas/podsPodId","nullable":true},"domain_id":{"$ref":"#/components/schemas/DomainId"},"domain":{"$ref":"#/components/schemas/DomainName"},"feedback_enabled":{"$ref":"#/components/schemas/FeedbackEnabled"},"subdomains_enabled":{"$ref":"#/components/schemas/SubdomainsEnabled"},"tracking_enabled":{"$ref":"#/components/schemas/TrackingEnabled"},"client_id":{"$ref":"#/components/schemas/ClientId","nullable":true},"updated_at":{"type":"string","format":"date-time","description":"Time at which the domain was last updated."},"created_at":{"type":"string","format":"date-time","description":"Time at which the domain was created."}},"required":["domain_id","domain","feedback_enabled","subdomains_enabled","tracking_enabled","updated_at","created_at"]},"ListDomainsResponse":{"title":"ListDomainsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"domains":{"type":"array","items":{"$ref":"#/components/schemas/DomainItem"},"description":"Ordered by `created_at` descending."}},"required":["count","domains"]},"GetSetupLinkResponse":{"title":"GetSetupLinkResponse","type":"object","properties":{"supported":{"type":"boolean","description":"Whether one-click setup is available for this domain. `false` means the domain's DNS provider does not support Domain Connect (or does not carry the AgentMail template yet) — add the domain's `records` manually instead."},"provider_name":{"type":"string","nullable":true,"description":"Display name of the domain's DNS provider, for the setup button label."},"url":{"type":"string","nullable":true,"description":"The signed Domain Connect apply URL. Open it in a browser: the domain owner signs in at their DNS provider, reviews the records, and approves — the provider writes them."},"width":{"type":"integer","nullable":true,"description":"Suggested popup width from the provider, in pixels."},"height":{"type":"integer","nullable":true,"description":"Suggested popup height from the provider, in pixels."},"state":{"type":"string","nullable":true,"description":"Opaque value echoed back on the provider's redirect. Store it before opening the URL and compare on return to tie the redirect to this request."},"conflicting_provider":{"type":"string","nullable":true,"description":"Set when the domain currently has another email provider's MX records (for example Google Workspace). Applying the template would replace them — warn before proceeding."}},"required":["supported"]},"CreateDomainRequest":{"title":"CreateDomainRequest","type":"object","properties":{"domain":{"$ref":"#/components/schemas/DomainName"},"feedback_enabled":{"$ref":"#/components/schemas/FeedbackEnabled","nullable":true},"subdomains_enabled":{"$ref":"#/components/schemas/SubdomainsEnabled","nullable":true},"tracking_enabled":{"$ref":"#/components/schemas/TrackingEnabled","nullable":true}},"required":["domain"]},"UpdateDomainRequest":{"title":"UpdateDomainRequest","type":"object","description":"Provide at least one of `feedback_enabled`, `subdomains_enabled`, or\n`tracking_enabled`. Omitted\nfields are left unchanged; an empty body is rejected. Enabling\n`subdomains_enabled` on a verified domain returns it to `PENDING` until the\nnewly-required wildcard MX record (`*.`) is published and verified.","properties":{"feedback_enabled":{"$ref":"#/components/schemas/FeedbackEnabled","nullable":true},"subdomains_enabled":{"$ref":"#/components/schemas/SubdomainsEnabled","nullable":true},"tracking_enabled":{"$ref":"#/components/schemas/TrackingEnabled","nullable":true}}},"DraftId":{"title":"DraftId","type":"string","description":"ID of draft."},"DraftClientId":{"title":"DraftClientId","type":"string","description":"Client ID of draft."},"DraftLabels":{"title":"DraftLabels","type":"array","items":{"type":"string"},"description":"Labels of draft."},"DraftReplyTo":{"title":"DraftReplyTo","type":"array","items":{"type":"string"},"description":"Reply-to addresses. In format `username@domain.com` or `Display Name `."},"DraftTo":{"title":"DraftTo","type":"array","items":{"type":"string"},"description":"Addresses of recipients. In format `username@domain.com` or `Display Name `."},"DraftCc":{"title":"DraftCc","type":"array","items":{"type":"string"},"description":"Addresses of CC recipients. In format `username@domain.com` or `Display Name `."},"DraftBcc":{"title":"DraftBcc","type":"array","items":{"type":"string"},"description":"Addresses of BCC recipients. In format `username@domain.com` or `Display Name `."},"DraftSubject":{"title":"DraftSubject","type":"string","description":"Subject of draft."},"DraftPreview":{"title":"DraftPreview","type":"string","description":"Text preview of draft."},"DraftText":{"title":"DraftText","type":"string","description":"Plain text body of draft."},"DraftHtml":{"title":"DraftHtml","type":"string","description":"HTML body of draft."},"DraftAttachments":{"title":"DraftAttachments","type":"array","items":{"$ref":"#/components/schemas/Attachment"},"description":"Attachments in draft."},"DraftInReplyTo":{"title":"DraftInReplyTo","type":"string","description":"ID of message being replied to."},"DraftForwardOf":{"title":"DraftForwardOf","type":"string","description":"ID of message being forwarded."},"DraftReplyAll":{"title":"DraftReplyAll","type":"boolean","description":"Reply to all recipients of the original message."},"DraftSendStatus":{"title":"DraftSendStatus","type":"string","enum":["scheduled","sending","failed"],"description":"Schedule send status of draft."},"DraftSendAt":{"title":"DraftSendAt","type":"string","format":"date-time","description":"Time at which to schedule send draft."},"DraftUpdatedAt":{"title":"DraftUpdatedAt","type":"string","format":"date-time","description":"Time at which draft was last updated."},"DraftItem":{"title":"DraftItem","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"draft_id":{"$ref":"#/components/schemas/DraftId"},"labels":{"$ref":"#/components/schemas/DraftLabels"},"to":{"$ref":"#/components/schemas/DraftTo","nullable":true},"cc":{"$ref":"#/components/schemas/DraftCc","nullable":true},"bcc":{"$ref":"#/components/schemas/DraftBcc","nullable":true},"subject":{"$ref":"#/components/schemas/DraftSubject","nullable":true},"preview":{"$ref":"#/components/schemas/DraftPreview","nullable":true},"attachments":{"$ref":"#/components/schemas/DraftAttachments","nullable":true},"in_reply_to":{"$ref":"#/components/schemas/DraftInReplyTo","nullable":true},"forward_of":{"$ref":"#/components/schemas/DraftForwardOf","nullable":true},"send_status":{"$ref":"#/components/schemas/DraftSendStatus","nullable":true},"send_at":{"$ref":"#/components/schemas/DraftSendAt","nullable":true},"updated_at":{"$ref":"#/components/schemas/DraftUpdatedAt"}},"required":["inbox_id","draft_id","labels","updated_at"]},"Draft":{"title":"Draft","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"draft_id":{"$ref":"#/components/schemas/DraftId"},"client_id":{"$ref":"#/components/schemas/DraftClientId","nullable":true},"labels":{"$ref":"#/components/schemas/DraftLabels"},"reply_to":{"$ref":"#/components/schemas/DraftReplyTo","nullable":true},"to":{"$ref":"#/components/schemas/DraftTo","nullable":true},"cc":{"$ref":"#/components/schemas/DraftCc","nullable":true},"bcc":{"$ref":"#/components/schemas/DraftBcc","nullable":true},"subject":{"$ref":"#/components/schemas/DraftSubject","nullable":true},"preview":{"$ref":"#/components/schemas/DraftPreview","nullable":true},"text":{"$ref":"#/components/schemas/DraftText","nullable":true},"html":{"$ref":"#/components/schemas/DraftHtml","nullable":true},"attachments":{"$ref":"#/components/schemas/DraftAttachments","nullable":true},"in_reply_to":{"$ref":"#/components/schemas/DraftInReplyTo","nullable":true},"forward_of":{"$ref":"#/components/schemas/DraftForwardOf","nullable":true},"references":{"type":"array","items":{"type":"string"},"nullable":true,"description":"IDs of previous messages in thread."},"send_status":{"$ref":"#/components/schemas/DraftSendStatus","nullable":true},"send_at":{"$ref":"#/components/schemas/DraftSendAt","nullable":true},"updated_at":{"$ref":"#/components/schemas/DraftUpdatedAt"},"created_at":{"type":"string","format":"date-time","description":"Time at which draft was created."}},"required":["inbox_id","draft_id","labels","updated_at","created_at"]},"ListDraftsResponse":{"title":"ListDraftsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"drafts":{"type":"array","items":{"$ref":"#/components/schemas/DraftItem"},"description":"Ordered by `updated_at` descending."}},"required":["count","drafts"]},"CreateDraftRequest":{"title":"CreateDraftRequest","type":"object","description":"Body for creating a draft. Supports plain, reply, reply-all, and forward\ndrafts:\n\n- **Plain draft:** supply `to`, `subject`, `text`, etc.\n- **Reply:** set `in_reply_to` to a message ID. Recipients, subject, and\n threading are derived from that message. Set `reply_all` to address the\n whole thread (you then cannot also pass `to`, `cc`, or `bcc`).\n- **Forward:** set `forward_of` to a message ID. The subject and threading\n are derived from the source message, whose body and attachments are\n merged in at send time.\n\n`in_reply_to` and `forward_of` are mutually exclusive, and reading the\nreferenced message requires `message_read` permission.","properties":{"labels":{"$ref":"#/components/schemas/DraftLabels","nullable":true},"reply_to":{"$ref":"#/components/schemas/DraftReplyTo","nullable":true},"to":{"$ref":"#/components/schemas/DraftTo","nullable":true},"cc":{"$ref":"#/components/schemas/DraftCc","nullable":true},"bcc":{"$ref":"#/components/schemas/DraftBcc","nullable":true},"subject":{"$ref":"#/components/schemas/DraftSubject","nullable":true},"text":{"$ref":"#/components/schemas/DraftText","nullable":true},"html":{"$ref":"#/components/schemas/DraftHtml","nullable":true},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/SendAttachment"},"nullable":true,"description":"Attachments to include in draft."},"in_reply_to":{"$ref":"#/components/schemas/DraftInReplyTo","nullable":true},"forward_of":{"$ref":"#/components/schemas/DraftForwardOf","nullable":true},"reply_all":{"$ref":"#/components/schemas/DraftReplyAll","nullable":true},"send_at":{"$ref":"#/components/schemas/DraftSendAt","nullable":true},"client_id":{"$ref":"#/components/schemas/DraftClientId","nullable":true}}},"UpdateDraftRequest":{"title":"UpdateDraftRequest","type":"object","description":"Edit fields on an existing draft. A draft's kind (plain, reply, or forward)\nis fixed at creation and cannot be changed here. Omitting a field leaves it\nunchanged; passing `null` (or `[]` for a recipient field) clears it. Pass\n`send_at` to schedule or reschedule the draft, or `null` to un-schedule it.","properties":{"reply_to":{"$ref":"#/components/schemas/DraftReplyTo","nullable":true},"to":{"$ref":"#/components/schemas/DraftTo","nullable":true},"cc":{"$ref":"#/components/schemas/DraftCc","nullable":true},"bcc":{"$ref":"#/components/schemas/DraftBcc","nullable":true},"subject":{"$ref":"#/components/schemas/DraftSubject","nullable":true},"text":{"$ref":"#/components/schemas/DraftText","nullable":true},"html":{"$ref":"#/components/schemas/DraftHtml","nullable":true},"add_attachments":{"type":"array","items":{"$ref":"#/components/schemas/SendAttachment"},"nullable":true,"description":"Attachments to add to the draft."},"remove_attachments":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentId"},"nullable":true,"description":"IDs of attachments to remove from the draft."},"add_labels":{"$ref":"#/components/schemas/DraftLabels","nullable":true,"description":"Label or labels to add to the draft."},"remove_labels":{"$ref":"#/components/schemas/DraftLabels","nullable":true,"description":"Label or labels to remove from the draft."},"send_at":{"$ref":"#/components/schemas/DraftSendAt","nullable":true}}},"EventType":{"title":"EventType","type":"string","enum":["message.received","message.received.spam","message.received.blocked","message.received.unauthenticated","message.sent","message.delivered","message.bounced","message.complained","message.rejected","message.opened","domain.verified"]},"EventTypes":{"title":"EventTypes","type":"array","items":{"$ref":"#/components/schemas/EventType"},"description":"Event types for which to send events."},"MessageReceivedEventType":{"title":"MessageReceivedEventType","type":"string","enum":["message.received","message.received.spam","message.received.blocked","message.received.unauthenticated"]},"PodIds":{"title":"PodIds","type":"array","items":{"type":"string"},"description":"Pods for which to send events. Maximum 10 per webhook."},"InboxIds":{"title":"InboxIds","type":"array","items":{"type":"string"},"description":"Inboxes for which to send events. Maximum 10 per webhook."},"EventId":{"title":"EventId","type":"string","description":"ID of event."},"Timestamp":{"title":"Timestamp","type":"string","format":"date-time","description":"Timestamp of event."},"Recipient":{"title":"Recipient","type":"object","properties":{"address":{"type":"string","description":"Recipient address."},"status":{"type":"string","description":"Recipient status."}},"required":["address","status"]},"Send":{"title":"Send","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"recipients":{"type":"array","items":{"type":"string"},"description":"Sent recipients."}},"required":["inbox_id","thread_id","message_id","timestamp","recipients"],"x-fern-type-name":"SendEvent"},"Delivery":{"title":"Delivery","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"recipients":{"type":"array","items":{"type":"string"},"description":"Delivered recipients."}},"required":["inbox_id","thread_id","message_id","timestamp","recipients"]},"Bounce":{"title":"Bounce","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"type":{"type":"string","description":"Bounce type."},"sub_type":{"type":"string","description":"Bounce sub-type."},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/Recipient"},"description":"Bounced recipients."}},"required":["inbox_id","thread_id","message_id","timestamp","type","sub_type","recipients"]},"Complaint":{"title":"Complaint","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"type":{"type":"string","description":"Complaint type."},"sub_type":{"type":"string","description":"Complaint sub-type."},"recipients":{"type":"array","items":{"type":"string"},"description":"Complained recipients."}},"required":["inbox_id","thread_id","message_id","timestamp","type","sub_type","recipients"]},"Reject":{"title":"Reject","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"reason":{"type":"string","description":"Reject reason."}},"required":["inbox_id","thread_id","message_id","timestamp","reason"]},"Open":{"title":"Open","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"timestamp":{"$ref":"#/components/schemas/Timestamp"}},"required":["inbox_id","thread_id","message_id","timestamp"]},"MessageReceivedEvent":{"title":"MessageReceivedEvent","type":"object","description":"A message was received. Spam, blocked, and unauthenticated received-message events use the same payload shape with different `event_type` values.","properties":{"type":{"type":"string","const":"event"},"event_type":{"$ref":"#/components/schemas/MessageReceivedEventType"},"event_id":{"$ref":"#/components/schemas/EventId"},"message":{"$ref":"#/components/schemas/Message"},"thread":{"$ref":"#/components/schemas/ThreadItem"}},"required":["type","event_type","event_id","message","thread"]},"MessageSentEvent":{"title":"MessageSentEvent","type":"object","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"message.sent"},"event_id":{"$ref":"#/components/schemas/EventId"},"send":{"$ref":"#/components/schemas/Send"}},"required":["type","event_type","event_id","send"]},"MessageDeliveredEvent":{"title":"MessageDeliveredEvent","type":"object","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"message.delivered"},"event_id":{"$ref":"#/components/schemas/EventId"},"delivery":{"$ref":"#/components/schemas/Delivery"}},"required":["type","event_type","event_id","delivery"]},"MessageBouncedEvent":{"title":"MessageBouncedEvent","type":"object","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"message.bounced"},"event_id":{"$ref":"#/components/schemas/EventId"},"bounce":{"$ref":"#/components/schemas/Bounce"}},"required":["type","event_type","event_id","bounce"]},"MessageComplainedEvent":{"title":"MessageComplainedEvent","type":"object","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"message.complained"},"event_id":{"$ref":"#/components/schemas/EventId"},"complaint":{"$ref":"#/components/schemas/Complaint"}},"required":["type","event_type","event_id","complaint"]},"MessageRejectedEvent":{"title":"MessageRejectedEvent","type":"object","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"message.rejected"},"event_id":{"$ref":"#/components/schemas/EventId"},"reject":{"$ref":"#/components/schemas/Reject"}},"required":["type","event_type","event_id","reject"]},"MessageOpenedEvent":{"title":"MessageOpenedEvent","type":"object","description":"A tracked message was opened for the first time. Sent once per message: repeat opens do not\nresend it.","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"message.opened"},"event_id":{"$ref":"#/components/schemas/EventId"},"open":{"$ref":"#/components/schemas/Open"}},"required":["type","event_type","event_id","open"]},"DomainVerifiedEvent":{"title":"DomainVerifiedEvent","type":"object","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"domain.verified"},"event_id":{"$ref":"#/components/schemas/EventId"},"domain":{"$ref":"#/components/schemas/Domain"}},"required":["type","event_type","event_id","domain"]},"InboxEventId":{"title":"InboxEventId","type":"string","description":"ID of event."},"InboxEventType":{"title":"InboxEventType","type":"string","enum":["label.added","label.removed"],"description":"Type of inbox event. Wire format is dot.case to match the\nconvention used by webhook events (`message.received`,\n`domain.verified`, etc. in events.yml). Pre-2026-04 these were\n`label_added`/`label_removed` (snake_case). The Fern enum's `name`\nfield stays uppercase-snake (Fern convention); only the wire\n`value` changed."},"InboxEvent":{"title":"InboxEvent","type":"object","properties":{"organization_id":{"$ref":"#/components/schemas/OrganizationId"},"pod_id":{"type":"string","description":"ID of pod."},"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"event_id":{"$ref":"#/components/schemas/InboxEventId"},"event_type":{"$ref":"#/components/schemas/InboxEventType"},"message_id":{"type":"string","description":"ID of message."},"label":{"type":"string","description":"Label added or removed."},"event_at":{"type":"string","format":"date-time","description":"Time at which the event occurred."},"created_at":{"type":"string","format":"date-time","description":"Time at which the event was recorded."}},"required":["organization_id","pod_id","inbox_id","event_id","event_type","message_id","label","event_at","created_at"]},"ListInboxEventsResponse":{"title":"ListInboxEventsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"events":{"type":"array","items":{"$ref":"#/components/schemas/InboxEvent"},"description":"Ordered by `event_id` descending."}},"required":["count","events"]},"Direction":{"title":"Direction","type":"string","enum":["send","receive","reply"],"description":"Direction of list entry."},"ListType":{"title":"ListType","type":"string","enum":["allow","block"],"description":"Type of list entry."},"EntryType":{"title":"EntryType","type":"string","enum":["email","domain"],"description":"Whether the entry is an email address or domain."},"ListEntryBase":{"title":"ListEntryBase","type":"object","properties":{"entry":{"type":"string","description":"Email address or domain of list entry."},"organization_id":{"$ref":"#/components/schemas/OrganizationId"},"reason":{"type":"string","nullable":true,"description":"Reason for adding the entry."},"direction":{"$ref":"#/components/schemas/Direction"},"list_type":{"$ref":"#/components/schemas/ListType"},"entry_type":{"$ref":"#/components/schemas/EntryType"},"created_at":{"type":"string","format":"date-time","description":"Time at which entry was created."},"read_only":{"type":"boolean","nullable":true,"description":"Whether the entry is read-only and cannot be deleted via the API."}},"required":["entry","organization_id","direction","list_type","entry_type","created_at"]},"ListEntry":{"title":"ListEntry","type":"object","properties":{},"allOf":[{"$ref":"#/components/schemas/ListEntryBase"}]},"PodListEntry":{"title":"PodListEntry","type":"object","properties":{"pod_id":{"type":"string","description":"ID of pod."},"inbox_id":{"type":"string","nullable":true,"description":"ID of inbox, if entry is inbox-scoped."}},"required":["pod_id"],"allOf":[{"$ref":"#/components/schemas/ListEntryBase"}]},"PodListListEntriesResponse":{"title":"PodListListEntriesResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"entries":{"type":"array","items":{"$ref":"#/components/schemas/PodListEntry"},"description":"Ordered by entry ascending."}},"required":["count","entries"]},"ListListEntriesResponse":{"title":"ListListEntriesResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"entries":{"type":"array","items":{"$ref":"#/components/schemas/ListEntry"},"description":"Ordered by entry ascending."}},"required":["count","entries"]},"CreateListEntryRequest":{"title":"CreateListEntryRequest","type":"object","properties":{"entry":{"type":"string","description":"Email address or domain to add."},"reason":{"type":"string","nullable":true,"description":"Reason for adding the entry."}},"required":["entry"]},"MessageId":{"title":"MessageId","type":"string","description":"ID of message."},"MessageLabels":{"title":"MessageLabels","type":"array","items":{"type":"string"},"description":"Labels of message."},"MessageTimestamp":{"title":"MessageTimestamp","type":"string","format":"date-time","description":"Time at which message was sent or drafted."},"MessageFrom":{"title":"MessageFrom","type":"string","description":"Address of sender. In format `username@domain.com` or `Display Name `."},"MessageReplyTo":{"title":"MessageReplyTo","type":"array","items":{"type":"string"},"description":"Addresses of reply-to recipients. In format `username@domain.com` or `Display Name `."},"MessageTo":{"title":"MessageTo","type":"array","items":{"type":"string"},"description":"Addresses of recipients. In format `username@domain.com` or `Display Name `."},"MessageCc":{"title":"MessageCc","type":"array","items":{"type":"string"},"description":"Addresses of CC recipients. In format `username@domain.com` or `Display Name `."},"MessageBcc":{"title":"MessageBcc","type":"array","items":{"type":"string"},"description":"Addresses of BCC recipients. In format `username@domain.com` or `Display Name `."},"MessageSubject":{"title":"MessageSubject","type":"string","description":"Subject of message."},"MessagePreview":{"title":"MessagePreview","type":"string","description":"Text preview of message."},"MessageText":{"title":"MessageText","type":"string","description":"Plain text body of message."},"MessageHtml":{"title":"MessageHtml","type":"string","description":"HTML body of message."},"MessageAttachments":{"title":"MessageAttachments","type":"array","items":{"$ref":"#/components/schemas/Attachment"},"description":"Attachments in message."},"MessageInReplyTo":{"title":"MessageInReplyTo","type":"string","description":"ID of message being replied to."},"MessageReferences":{"title":"MessageReferences","type":"array","items":{"type":"string"},"description":"IDs of previous messages in thread."},"MessageHeaders":{"title":"MessageHeaders","type":"object","additionalProperties":{"type":"string"},"description":"Headers in message."},"MessageSize":{"title":"MessageSize","type":"integer","description":"Size of message in bytes."},"MessageUpdatedAt":{"title":"MessageUpdatedAt","type":"string","format":"date-time","description":"Time at which message was last updated."},"MessageCreatedAt":{"title":"MessageCreatedAt","type":"string","format":"date-time","description":"Time at which message was created."},"MessageItem":{"title":"MessageItem","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"labels":{"$ref":"#/components/schemas/MessageLabels"},"timestamp":{"$ref":"#/components/schemas/MessageTimestamp"},"from":{"$ref":"#/components/schemas/MessageFrom"},"to":{"$ref":"#/components/schemas/MessageTo"},"cc":{"$ref":"#/components/schemas/MessageCc","nullable":true},"bcc":{"$ref":"#/components/schemas/MessageBcc","nullable":true},"subject":{"$ref":"#/components/schemas/MessageSubject","nullable":true},"preview":{"$ref":"#/components/schemas/MessagePreview","nullable":true},"attachments":{"$ref":"#/components/schemas/MessageAttachments","nullable":true},"in_reply_to":{"$ref":"#/components/schemas/MessageInReplyTo","nullable":true},"references":{"$ref":"#/components/schemas/MessageReferences","nullable":true},"headers":{"$ref":"#/components/schemas/MessageHeaders","nullable":true},"size":{"$ref":"#/components/schemas/MessageSize"},"updated_at":{"$ref":"#/components/schemas/MessageUpdatedAt"},"created_at":{"$ref":"#/components/schemas/MessageCreatedAt"}},"required":["inbox_id","thread_id","message_id","labels","timestamp","from","to","size","updated_at","created_at"]},"Message":{"title":"Message","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"labels":{"$ref":"#/components/schemas/MessageLabels"},"timestamp":{"$ref":"#/components/schemas/MessageTimestamp"},"from":{"$ref":"#/components/schemas/MessageFrom"},"reply_to":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Reply-to addresses. In format `username@domain.com` or `Display Name `."},"to":{"$ref":"#/components/schemas/MessageTo"},"cc":{"$ref":"#/components/schemas/MessageCc","nullable":true},"bcc":{"$ref":"#/components/schemas/MessageBcc","nullable":true},"subject":{"$ref":"#/components/schemas/MessageSubject","nullable":true},"preview":{"$ref":"#/components/schemas/MessagePreview","nullable":true},"text":{"$ref":"#/components/schemas/MessageText","nullable":true},"html":{"$ref":"#/components/schemas/MessageHtml","nullable":true},"extracted_text":{"type":"string","nullable":true,"description":"Extracted new text content."},"extracted_html":{"type":"string","nullable":true,"description":"Extracted new HTML content."},"attachments":{"$ref":"#/components/schemas/MessageAttachments","nullable":true},"in_reply_to":{"$ref":"#/components/schemas/MessageInReplyTo","nullable":true},"references":{"$ref":"#/components/schemas/MessageReferences","nullable":true},"headers":{"$ref":"#/components/schemas/MessageHeaders","nullable":true},"size":{"$ref":"#/components/schemas/MessageSize"},"updated_at":{"$ref":"#/components/schemas/MessageUpdatedAt"},"created_at":{"$ref":"#/components/schemas/MessageCreatedAt"}},"required":["inbox_id","thread_id","message_id","labels","timestamp","from","to","size","updated_at","created_at"]},"ListMessagesResponse":{"title":"ListMessagesResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"messages":{"type":"array","items":{"$ref":"#/components/schemas/MessageItem"},"description":"Ordered by `timestamp` descending."}},"required":["count","messages"]},"SearchMessageHighlights":{"title":"SearchMessageHighlights","type":"object","description":"Matched fragments per field on a message search result, with matched terms\nwrapped in `**`. A field key is present only when the query matched that\nfield, so the present keys also tell you which fields produced the hit.","properties":{"from":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from the sender address."},"recipients":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from the recipient addresses (to, cc, or bcc)."},"subject":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from the subject."},"text":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from the message body."}}},"SearchMessageItem":{"title":"SearchMessageItem","type":"object","properties":{"highlights":{"$ref":"#/components/schemas/SearchMessageHighlights","nullable":true,"description":"Matched fragments per field. Present only when the query matched an indexed field."}},"allOf":[{"$ref":"#/components/schemas/MessageItem"}]},"SearchMessagesResponse":{"title":"SearchMessagesResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"messages":{"type":"array","items":{"$ref":"#/components/schemas/SearchMessageItem"},"description":"Ordered by relevance, best match first."}},"required":["count","messages"]},"BatchGetMessagesMessageIds":{"title":"BatchGetMessagesMessageIds","type":"array","items":{"$ref":"#/components/schemas/MessageId"},"description":"IDs of messages to fetch. Maximum 500 ids per request. Duplicates are\nrejected with a validation error. IDs not found in the inbox (including\ncross-inbox or permission-restricted) are silently omitted from the\nresponse; callers detect misses by comparing `count` against `limit`."},"BatchGetMessagesRequest":{"title":"BatchGetMessagesRequest","type":"object","properties":{"message_ids":{"$ref":"#/components/schemas/BatchGetMessagesMessageIds"}},"required":["message_ids"]},"BatchGetMessagesResponse":{"title":"BatchGetMessagesResponse","type":"object","properties":{"limit":{"$ref":"#/components/schemas/Limit"},"count":{"$ref":"#/components/schemas/Count"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"},"description":"Found messages. Order matches `message_ids` in the request. Body\nfields (`text`, `html`, `extracted_text`, `extracted_html`) are\nnever populated; use the single-message endpoint to retrieve bodies."}},"required":["limit","count","messages"]},"BatchUpdateMessagesMessageIds":{"title":"BatchUpdateMessagesMessageIds","type":"array","items":{"$ref":"#/components/schemas/MessageId"},"description":"IDs of messages to update. Maximum 50 ids per request. Duplicates are\nrejected with a validation error. IDs not found in the inbox (including\ncross-inbox or permission-restricted) are silently excluded from the\nupdate; callers detect exclusions by comparing `count` against `limit`."},"BatchUpdateMessagesRequest":{"title":"BatchUpdateMessagesRequest","type":"object","properties":{"message_ids":{"$ref":"#/components/schemas/BatchUpdateMessagesMessageIds"},"add_labels":{"$ref":"#/components/schemas/UpdateMessageLabels","nullable":true,"description":"Label or labels to add to every message."},"remove_labels":{"$ref":"#/components/schemas/UpdateMessageLabels","nullable":true,"description":"Label or labels to remove from every message."}},"required":["message_ids"]},"BatchUpdateMessagesResponse":{"title":"BatchUpdateMessagesResponse","type":"object","properties":{"limit":{"$ref":"#/components/schemas/Limit"},"count":{"$ref":"#/components/schemas/Count"},"updates":{"type":"array","items":{"$ref":"#/components/schemas/UpdateMessageResponse"},"description":"Updated messages with their new labels. Order matches `message_ids`\nin the request. Excluded ids are omitted, so `count` may be less than\n`limit`."}},"required":["limit","count","updates"]},"RawMessageResponse":{"title":"RawMessageResponse","type":"object","description":"S3 presigned URL to download the raw .eml file.","properties":{"message_id":{"$ref":"#/components/schemas/MessageId","description":"ID of the message."},"size":{"$ref":"#/components/schemas/MessageSize","description":"Size of the raw message in bytes."},"download_url":{"type":"string","description":"S3 presigned URL to download the raw message. Expires at expires_at."},"expires_at":{"type":"string","format":"date-time","description":"Time at which the download URL expires."}},"required":["message_id","size","download_url","expires_at"]},"Addresses":{"title":"Addresses","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"SendMessageReplyTo":{"title":"SendMessageReplyTo","$ref":"#/components/schemas/Addresses","description":"Reply-to address or addresses."},"SendMessageTo":{"title":"SendMessageTo","$ref":"#/components/schemas/Addresses","description":"Recipient address or addresses."},"SendMessageCc":{"title":"SendMessageCc","$ref":"#/components/schemas/Addresses","description":"CC recipient address or addresses."},"SendMessageBcc":{"title":"SendMessageBcc","$ref":"#/components/schemas/Addresses","description":"BCC recipient address or addresses."},"SendMessageAttachments":{"title":"SendMessageAttachments","type":"array","items":{"$ref":"#/components/schemas/SendAttachment"},"description":"Attachments to include in message."},"SendMessageHeaders":{"title":"SendMessageHeaders","type":"object","additionalProperties":{"type":"string"},"description":"Headers to include in message."},"TrackOpens":{"title":"TrackOpens","type":"boolean","description":"Track when this message is first opened. Requires a custom domain with tracking enabled and\nan HTML body. Opens surface as the `opened` label on the message and as a `message.opened`\nevent. One pixel is injected per message, not per recipient, so a message with several\nrecipients fires once when any of them opens it, and the event does not identify which one."},"SendMessageRequest":{"title":"SendMessageRequest","type":"object","properties":{"labels":{"$ref":"#/components/schemas/MessageLabels","nullable":true},"reply_to":{"$ref":"#/components/schemas/SendMessageReplyTo","nullable":true},"to":{"$ref":"#/components/schemas/SendMessageTo","nullable":true},"cc":{"$ref":"#/components/schemas/SendMessageCc","nullable":true},"bcc":{"$ref":"#/components/schemas/SendMessageBcc","nullable":true},"subject":{"$ref":"#/components/schemas/MessageSubject","nullable":true},"text":{"$ref":"#/components/schemas/MessageText","nullable":true},"html":{"$ref":"#/components/schemas/MessageHtml","nullable":true},"attachments":{"$ref":"#/components/schemas/SendMessageAttachments","nullable":true},"headers":{"$ref":"#/components/schemas/SendMessageHeaders","nullable":true},"track_opens":{"$ref":"#/components/schemas/TrackOpens","nullable":true}}},"SendMessageResponse":{"title":"SendMessageResponse","type":"object","properties":{"message_id":{"$ref":"#/components/schemas/MessageId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"}},"required":["message_id","thread_id"]},"UpdateMessageResponse":{"title":"UpdateMessageResponse","type":"object","properties":{"message_id":{"$ref":"#/components/schemas/MessageId"},"labels":{"$ref":"#/components/schemas/MessageLabels"}},"required":["message_id","labels"]},"ReplyAll":{"title":"ReplyAll","type":"boolean","description":"Reply to all recipients of the original message."},"ReplyToMessageRequest":{"title":"ReplyToMessageRequest","type":"object","properties":{"labels":{"$ref":"#/components/schemas/MessageLabels","nullable":true},"reply_to":{"$ref":"#/components/schemas/SendMessageReplyTo","nullable":true},"to":{"$ref":"#/components/schemas/SendMessageTo","nullable":true},"cc":{"$ref":"#/components/schemas/SendMessageCc","nullable":true},"bcc":{"$ref":"#/components/schemas/SendMessageBcc","nullable":true},"reply_all":{"$ref":"#/components/schemas/ReplyAll","nullable":true},"text":{"$ref":"#/components/schemas/MessageText","nullable":true},"html":{"$ref":"#/components/schemas/MessageHtml","nullable":true},"attachments":{"$ref":"#/components/schemas/SendMessageAttachments","nullable":true},"headers":{"$ref":"#/components/schemas/SendMessageHeaders","nullable":true},"track_opens":{"$ref":"#/components/schemas/TrackOpens","nullable":true}}},"ReplyAllMessageRequest":{"title":"ReplyAllMessageRequest","type":"object","properties":{"labels":{"$ref":"#/components/schemas/MessageLabels","nullable":true},"reply_to":{"$ref":"#/components/schemas/SendMessageReplyTo","nullable":true},"text":{"$ref":"#/components/schemas/MessageText","nullable":true},"html":{"$ref":"#/components/schemas/MessageHtml","nullable":true},"attachments":{"$ref":"#/components/schemas/SendMessageAttachments","nullable":true},"headers":{"$ref":"#/components/schemas/SendMessageHeaders","nullable":true},"track_opens":{"$ref":"#/components/schemas/TrackOpens","nullable":true}}},"UpdateMessageLabels":{"title":"UpdateMessageLabels","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Label or list of labels."},"UpdateMessageRequest":{"title":"UpdateMessageRequest","type":"object","properties":{"add_labels":{"$ref":"#/components/schemas/UpdateMessageLabels","nullable":true,"description":"Label or labels to add to message."},"remove_labels":{"$ref":"#/components/schemas/UpdateMessageLabels","nullable":true,"description":"Label or labels to remove from message."}}},"MetricEventType":{"title":"MetricEventType","type":"string","enum":["message.received","message.received.spam","message.received.blocked","message.received.unauthenticated","message.sent","message.delivered","message.bounced","message.complained","message.rejected","domain.verified"],"description":"Type of metric event."},"MetricEventTypes":{"title":"MetricEventTypes","type":"array","items":{"$ref":"#/components/schemas/MetricEventType"},"description":"List of metric event types to query."},"Start":{"title":"Start","type":"string","format":"date-time","description":"Start timestamp for the query."},"End":{"title":"End","type":"string","format":"date-time","description":"End timestamp for the query."},"Period":{"title":"Period","type":"integer","description":"Size of each time bucket as a whole number of seconds, between 1 and 86400."},"MetricLimit":{"title":"MetricLimit","type":"integer","description":"Limit on number of buckets to return."},"Descending":{"title":"Descending","type":"boolean","description":"Sort in descending order."},"MetricBucket":{"title":"MetricBucket","type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"Timestamp of the bucket."},"count":{"type":"integer","description":"Count of events in the bucket."}},"required":["timestamp","count"]},"QueryMetricsResponse":{"title":"QueryMetricsResponse","type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/MetricBucket"}},"description":"Metrics grouped by event type."},"UsageType":{"title":"UsageType","type":"string","enum":["storage_bytes","message_count","thread_count","inbox_count","pod_count","domain_count"],"description":"Type of usage metric. Inbox-scoped queries carry `storage_bytes`,\n`message_count`, and `thread_count`; pod-scoped queries add `inbox_count`\nand `domain_count`; organization-scoped queries add `pod_count`."},"UsageTypes":{"title":"UsageTypes","type":"array","items":{"$ref":"#/components/schemas/UsageType"},"description":"List of usage metric types to query. Omit to query every type valid for the scope."},"UsagePoint":{"title":"UsagePoint","type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"Timestamp of the point."},"value":{"type":"integer","format":"int64","description":"Cumulative value of the usage metric at the timestamp."}},"required":["timestamp","value"]},"QueryUsageResponse":{"title":"QueryUsageResponse","type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/UsagePoint"}},"description":"Cumulative usage series grouped by usage type."},"Organization":{"title":"Organization","type":"object","description":"Organization details with usage limits and counts.","properties":{"organization_id":{"$ref":"#/components/schemas/OrganizationId"},"inbox_count":{"type":"integer","description":"Current number of inboxes."},"domain_count":{"type":"integer","description":"Current number of domains."},"inbox_limit":{"type":"integer","nullable":true,"description":"Maximum number of inboxes allowed."},"domain_limit":{"type":"integer","nullable":true,"description":"Maximum number of domains allowed."},"billing_id":{"type":"string","nullable":true,"description":"Provider-agnostic billing customer ID."},"billing_type":{"type":"string","nullable":true,"description":"Billing provider type (e.g. \"stripe\")."},"billing_subscription_id":{"type":"string","nullable":true,"description":"Active billing subscription ID."},"authentication_id":{"type":"string","nullable":true,"description":"Provider-agnostic authentication ID."},"authentication_type":{"type":"string","nullable":true,"description":"Authentication provider type."},"updated_at":{"type":"string","format":"date-time","description":"Time at which organization was last updated."},"created_at":{"type":"string","format":"date-time","description":"Time at which organization was created."}},"required":["organization_id","inbox_count","domain_count","updated_at","created_at"]},"Provider":{"title":"Provider","type":"object","description":"A provider an inbox can sign in to.","properties":{"provider_id":{"$ref":"#/components/schemas/ProviderId"},"name":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Time at which provider was last updated."},"description":{"type":"string","nullable":true},"logo_url":{"type":"string","nullable":true},"terms_url":{"type":"string","nullable":true},"privacy_url":{"type":"string","nullable":true}},"required":["provider_id"]},"ListProvidersResponse":{"title":"ListProvidersResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"providers":{"type":"array","items":{"$ref":"#/components/schemas/Provider"}}},"required":["count","limit","providers"]},"SearchProvidersResponse":{"title":"SearchProvidersResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"providers":{"type":"array","items":{"$ref":"#/components/schemas/Provider"}}},"required":["count","limit","providers"]},"ListProviderAccountsResponse":{"title":"ListProviderAccountsResponse","type":"object","properties":{"provider":{"$ref":"#/components/schemas/Provider","nullable":true},"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}},"required":["count","limit","accounts"]},"ConnectProviderBody":{"title":"ConnectProviderBody","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId","nullable":true,"description":"Inbox to connect. Required unless the API key is scoped to an inbox."},"authorize":{"type":"boolean","nullable":true,"description":"Authorize the provider for this inbox, skipping the first-use disclosure page."}}},"ConnectProviderAccepted":{"title":"ConnectProviderAccepted","type":"object","properties":{"session_id":{"type":"string","format":"uuid","description":"ID of session."},"magic_url":{"type":"string","description":"Single-use URL to open in the browser that will hold the sign-in."},"expires_at":{"type":"string","format":"date-time","description":"Time at which the URL expires."}},"required":["session_id","magic_url","expires_at"]},"ThreadId":{"title":"ThreadId","type":"string","description":"ID of thread."},"ThreadLabels":{"title":"ThreadLabels","type":"array","items":{"type":"string"},"description":"Labels of thread."},"ThreadTimestamp":{"title":"ThreadTimestamp","type":"string","format":"date-time","description":"Timestamp of last sent or received message."},"ThreadReceivedTimestamp":{"title":"ThreadReceivedTimestamp","type":"string","format":"date-time","description":"Timestamp of last received message."},"ThreadSentTimestamp":{"title":"ThreadSentTimestamp","type":"string","format":"date-time","description":"Timestamp of last sent message."},"ThreadSenders":{"title":"ThreadSenders","type":"array","items":{"type":"string"},"description":"Senders in thread. In format `username@domain.com` or `Display Name `."},"ThreadRecipients":{"title":"ThreadRecipients","type":"array","items":{"type":"string"},"description":"Recipients in thread. In format `username@domain.com` or `Display Name `."},"ThreadSubject":{"title":"ThreadSubject","type":"string","description":"Subject of thread."},"ThreadPreview":{"title":"ThreadPreview","type":"string","description":"Text preview of last message in thread."},"ThreadAttachments":{"title":"ThreadAttachments","type":"array","items":{"$ref":"#/components/schemas/Attachment"},"description":"Attachments in thread."},"ThreadLastMessageId":{"title":"ThreadLastMessageId","type":"string","description":"ID of last message in thread."},"ThreadMessageCount":{"title":"ThreadMessageCount","type":"integer","description":"Number of messages in thread."},"ThreadSize":{"title":"ThreadSize","type":"integer","description":"Size of thread in bytes."},"ThreadUpdatedAt":{"title":"ThreadUpdatedAt","type":"string","format":"date-time","description":"Time at which thread was last updated."},"ThreadCreatedAt":{"title":"ThreadCreatedAt","type":"string","format":"date-time","description":"Time at which thread was created."},"ThreadItem":{"title":"ThreadItem","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"labels":{"$ref":"#/components/schemas/ThreadLabels"},"timestamp":{"$ref":"#/components/schemas/ThreadTimestamp"},"received_timestamp":{"$ref":"#/components/schemas/ThreadReceivedTimestamp","nullable":true},"sent_timestamp":{"$ref":"#/components/schemas/ThreadSentTimestamp","nullable":true},"senders":{"$ref":"#/components/schemas/ThreadSenders"},"recipients":{"$ref":"#/components/schemas/ThreadRecipients"},"subject":{"$ref":"#/components/schemas/ThreadSubject","nullable":true},"preview":{"$ref":"#/components/schemas/ThreadPreview","nullable":true},"attachments":{"$ref":"#/components/schemas/ThreadAttachments","nullable":true},"last_message_id":{"$ref":"#/components/schemas/ThreadLastMessageId"},"message_count":{"$ref":"#/components/schemas/ThreadMessageCount"},"size":{"$ref":"#/components/schemas/ThreadSize"},"updated_at":{"$ref":"#/components/schemas/ThreadUpdatedAt"},"created_at":{"$ref":"#/components/schemas/ThreadCreatedAt"}},"required":["inbox_id","thread_id","labels","timestamp","senders","recipients","last_message_id","message_count","size","updated_at","created_at"]},"Thread":{"title":"Thread","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"labels":{"$ref":"#/components/schemas/ThreadLabels"},"timestamp":{"$ref":"#/components/schemas/ThreadTimestamp"},"received_timestamp":{"$ref":"#/components/schemas/ThreadReceivedTimestamp","nullable":true},"sent_timestamp":{"$ref":"#/components/schemas/ThreadSentTimestamp","nullable":true},"senders":{"$ref":"#/components/schemas/ThreadSenders"},"recipients":{"$ref":"#/components/schemas/ThreadRecipients"},"subject":{"$ref":"#/components/schemas/ThreadSubject","nullable":true},"preview":{"$ref":"#/components/schemas/ThreadPreview","nullable":true},"attachments":{"$ref":"#/components/schemas/ThreadAttachments","nullable":true},"last_message_id":{"$ref":"#/components/schemas/ThreadLastMessageId"},"message_count":{"$ref":"#/components/schemas/ThreadMessageCount"},"size":{"$ref":"#/components/schemas/ThreadSize"},"updated_at":{"$ref":"#/components/schemas/ThreadUpdatedAt"},"created_at":{"$ref":"#/components/schemas/ThreadCreatedAt"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"},"description":"Messages in thread. Ordered by `timestamp` ascending."}},"required":["inbox_id","thread_id","labels","timestamp","senders","recipients","last_message_id","message_count","size","updated_at","created_at","messages"]},"UpdateThreadRequest":{"title":"UpdateThreadRequest","type":"object","properties":{"add_labels":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Labels to add to thread. Cannot be system labels."},"remove_labels":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Labels to remove from thread. Cannot be system labels. Takes priority over `add_labels` (in the event of duplicate labels passed in)."}}},"UpdateThreadResponse":{"title":"UpdateThreadResponse","type":"object","properties":{"thread_id":{"$ref":"#/components/schemas/ThreadId"},"labels":{"$ref":"#/components/schemas/ThreadLabels"}},"required":["thread_id","labels"]},"ListThreadsResponse":{"title":"ListThreadsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"threads":{"type":"array","items":{"$ref":"#/components/schemas/ThreadItem"},"description":"Ordered by `timestamp` descending."}},"required":["count","threads"]},"SearchThreadHighlights":{"title":"SearchThreadHighlights","type":"object","description":"Matched fragments per field on a thread search result, with matched terms\nwrapped in `**`. A field key is present only when the query matched that\nfield, so the present keys also tell you which fields produced the hit.","properties":{"from":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from a sender address in the thread."},"recipients":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from a recipient address in the thread (to, cc, or bcc)."},"subject":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from the subject."},"text":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from a message body in the thread."}}},"SearchThreadItem":{"title":"SearchThreadItem","type":"object","properties":{"highlights":{"$ref":"#/components/schemas/SearchThreadHighlights","nullable":true,"description":"Matched fragments per field. Present only when the query matched an indexed field."}},"allOf":[{"$ref":"#/components/schemas/ThreadItem"}]},"SearchThreadsResponse":{"title":"SearchThreadsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"threads":{"type":"array","items":{"$ref":"#/components/schemas/SearchThreadItem"},"description":"Ordered by relevance, best match first."}},"required":["count","threads"]},"webhooksSvixId":{"title":"webhooksSvixId","type":"string","description":"ID of webhook message."},"webhooksSvixTimestamp":{"title":"webhooksSvixTimestamp","type":"string","format":"date-time","description":"Timestamp of webhook message."},"webhooksSvixSignature":{"title":"webhooksSvixSignature","type":"string","description":"Signature of webhook message."},"Subscribe":{"title":"Subscribe","type":"object","properties":{"type":{"type":"string","const":"subscribe"},"event_types":{"$ref":"#/components/schemas/EventTypes","nullable":true},"inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true},"pod_ids":{"$ref":"#/components/schemas/PodIds","nullable":true}},"required":["type"]},"Subscribed":{"title":"Subscribed","type":"object","properties":{"type":{"type":"string","const":"subscribed"},"event_types":{"$ref":"#/components/schemas/EventTypes","nullable":true},"inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true},"pod_ids":{"$ref":"#/components/schemas/PodIds","nullable":true}},"required":["type"]},"Error":{"title":"Error","type":"object","properties":{"type":{"type":"string","const":"error"},"name":{"$ref":"#/components/schemas/ErrorName"},"message":{"$ref":"#/components/schemas/ErrorMessage"}},"required":["type","name","message"]}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}}} \ No newline at end of file +{"openapi":"3.0.1","info":{"title":"AgentMail","version":""},"paths":{"/v0/inboxes":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes list\n```","operationId":"inboxes_list","tags":["Inboxes"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesListInboxesResponse"}}}}},"summary":"List Inboxes","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail inboxes create --display-name \"My Agent\" --username myagent --domain agentmail.to\n```","operationId":"inboxes_create","tags":["Inboxes"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesInbox"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesCreateInboxRequest","nullable":true}}}},"x-fern-sdk-group-name":["inboxes"],"x-fern-sdk-method-name":"create"}},"/v0/inboxes/search":{"get":{"description":"Searches inboxes in the organization by address or display name, ranked\nby relevance. Each word in the query matches the start of a word in the\naddress or display name, so `sup` matches `support@example.com` but\n`port` does not. An exact address match always ranks first. `limit`\ncannot exceed 100. A page can be empty and still carry a\n`next_page_token`; keep paging until the token is absent.","operationId":"inboxes_search","tags":["Inboxes"],"parameters":[{"name":"q","in":"query","description":"Address or display name to search for. Matches word prefixes. Must be 2 to 256 characters.","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesSearchInboxesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Search Inboxes","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes"],"x-fern-sdk-method-name":"search"}},"/v0/inboxes/{inbox_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes get --inbox-id \n```","operationId":"inboxes_get","tags":["Inboxes"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesInbox"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail inboxes update --inbox-id --display-name \"Updated Name\"\n```","operationId":"inboxes_update","tags":["Inboxes"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesInbox"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"description":"Expects an object; provide at least one of `display_name` or `metadata`.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesUpdateInboxRequest"}}}},"x-fern-sdk-group-name":["inboxes"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail inboxes delete --inbox-id \n```","operationId":"inboxes_delete","tags":["Inboxes"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/authorize":{"post":{"description":"Authorizes the AgentID sign-in a client is already waiting in, for the\ninbox in the path, and returns the pending public key it will activate. A\nrepeat for the same token, inbox, and bearer returns the same key.","operationId":"inboxes_authorize","tags":["Inboxes"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicKeyCredential"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Authorize Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesAuthorizeInboxRequest"}}}},"x-fern-sdk-group-name":["inboxes"],"x-fern-sdk-method-name":"authorize"}},"/v0/pods":{"get":{"description":"**CLI:**\n```bash\nagentmail pods list\n```","operationId":"pods_list","tags":["Pods"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/podsListPodsResponse"}}}}},"summary":"List Pods","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail pods create --client-id my-pod\n```","operationId":"pods_create","tags":["Pods"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/podsPod"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create Pod","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/podsCreatePodRequest"}}}},"x-fern-sdk-group-name":["pods"],"x-fern-sdk-method-name":"create"}},"/v0/pods/{pod_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods get --pod-id \n```","operationId":"pods_get","tags":["Pods"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/podsPod"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Pod","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods"],"x-fern-sdk-method-name":"get"},"delete":{"description":"**CLI:**\n```bash\nagentmail pods delete --pod-id \n```","operationId":"pods_delete","tags":["Pods"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Pod","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods"],"x-fern-sdk-method-name":"delete"}},"/v0/webhooks":{"get":{"description":"**CLI:**\n```bash\nagentmail webhooks list\n```","operationId":"webhooks_list","tags":["Webhooks"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksListWebhooksResponse"}}}}},"summary":"List Webhooks","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail webhooks create --url https://example.com/webhook --event-types message.received\n```","operationId":"webhooks_create","tags":["Webhooks"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksCreateWebhookRequest"}}}},"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"create"}},"/v0/webhooks/{webhook_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail webhooks get --webhook-id \n```","operationId":"webhooks_get","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"get"},"patch":{"description":"Update inbox or pod subscriptions, or replace the webhook's `event_types` in full when you pass a\nnon-empty `event_types` array (see request field docs). Inbox and pod changes use add/remove lists.\n\n**CLI:**\n```bash\nagentmail webhooks update --webhook-id --add-inbox-ids \n```","operationId":"webhooks_update","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksUpdateWebhookRequest"}}}},"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail webhooks delete --webhook-id \n```","operationId":"webhooks_delete","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"delete"}},"/v0/webhooks/{webhook_id}/headers":{"get":{"description":"List the names of custom HTTP headers included with deliveries to this webhook. Header values are\nwrite-only and are never returned.","operationId":"webhooks_getHeaders","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhookHeaderNamesResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Webhook Headers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"get-headers"},"patch":{"description":"Atomically set, replace, or remove custom HTTP headers included with deliveries to this webhook.\nHeader values remain write-only.","operationId":"webhooks_updateHeaders","tags":["Webhooks"],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"204":{"description":""},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Webhook Headers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksUpdateWebhookHeadersRequest"}}}},"x-fern-sdk-group-name":["webhooks"],"x-fern-sdk-method-name":"update-headers"}},"/v0/accounts":{"get":{"description":"Lists accounts across all providers.","operationId":"accounts_list","tags":["Accounts"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAccountsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"List Accounts","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["accounts"],"x-fern-sdk-method-name":"list"}},"/v0/accounts/{account_id}":{"get":{"operationId":"accounts_get","tags":["Accounts"],"parameters":[{"name":"account_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AccountId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Account","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["accounts"],"x-fern-sdk-method-name":"get"}},"/v0/agent/sign-up":{"post":{"description":"Create a new agent organization with an inbox and API key. This endpoint is for signing up for the first time. If you've already signed up, you're all set — just use your existing API key.\n\nA 6-digit OTP is sent to the human's email for verification.\n\nThis endpoint is idempotent. Calling it again with the same `human_email` will rotate the API key and resend the OTP if expired.\n\nThe returned API key has limited permissions until the organization is verified via the verify endpoint.\n\n**CLI:**\n```bash\nagentmail agent sign-up --human-email user@example.com --username my-agent\n```","operationId":"agent_signUp","tags":["Agent"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSignupResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Sign Up","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSignupRequest"}}}},"x-fern-sdk-group-name":["agent"],"x-fern-sdk-method-name":"sign-up"}},"/v0/agent/verify":{"post":{"description":"Verify an agent organization using the 6-digit OTP sent to the human's email during sign-up.\n\nOn success, the organization is upgraded from `agent_unverified` to `agent_verified`, the send allowlist is removed, and free plan entitlements are applied.\n\nThe OTP expires after 24 hours and allows a maximum of 10 attempts. If you run into any difficulties receiving the OTP code, you can also create an account on [console.agentmail.to](https://console.agentmail.to) using the human email address you provided to verify your account.\n\n**CLI:**\n```bash\nagentmail agent verify --otp-code 123456\n```","operationId":"agent_verify","tags":["Agent"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVerifyResponse"}}}}},"summary":"Verify","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVerifyRequest"}}}},"x-fern-sdk-group-name":["agent"],"x-fern-sdk-method-name":"verify"}},"/v0/api-keys":{"get":{"description":"Lists every credential, newest first. Filter one family with `type`.\nPage to token exhaustion: a page can be empty and still carry a\n`next_page_token`.\n\n**CLI:**\n```bash\nagentmail api-keys list\n```","operationId":"apiKeys_list","tags":["ApiKeys"],"parameters":[{"name":"type","in":"query","description":"Restrict the list to one credential family. Omit for every family.","required":false,"schema":{"$ref":"#/components/schemas/ApiKeyType","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApiKeysResponse"}}}}},"summary":"List API Keys","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"list"},"post":{"description":"Creates a bearer key, or registers a public key when the body carries\n`public_key`. The route selects the scope. Bearer secrets are returned once.\n\n**CLI:**\n```bash\nagentmail api-keys create --name \"My Key\"\n```","operationId":"apiKeys_create","tags":["ApiKeys"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResult"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"create"}},"/v0/api-keys/{api_key_id}":{"get":{"description":"Returns one credential of any family. Public keys also resolve by\n`client_id`. Poll a sign-in key until `status` is `active`.","operationId":"apiKeys_get","tags":["ApiKeys"],"parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ApiKeyId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"get"},"patch":{"description":"Renames a credential or changes its permissions. Public keys also resolve\nby `client_id`; a sign-in key accepts only `provider_connect` and\n`provider_share_owner`.","operationId":"apiKeys_update","tags":["ApiKeys"],"parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ApiKeyId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateApiKeyRequest"}}}},"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"update"},"delete":{"description":"Deletes one credential of any family. A pending sign-in key is\ncancelled; an active one is revoked. Public keys also resolve by `client_id`.\n\n**CLI:**\n```bash\nagentmail api-keys delete --api-key-id \n```","operationId":"apiKeys_delete","tags":["ApiKeys"],"parameters":[{"name":"api_key_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ApiKeyId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["apiKeys"],"x-fern-sdk-method-name":"delete"}},"/v0/auth/me":{"get":{"description":"Returns the identity and scope of the authenticated credential. Useful when a client holds a pod-scoped or inbox-scoped API key and needs to discover the parent organization, pod, or inbox without prior knowledge.\n\n**CLI:**\n```bash\nagentmail auth me\n```","operationId":"auth_me","tags":["Auth"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Identity"}}}}},"summary":"Who Am I","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["auth"],"x-fern-sdk-method-name":"me"}},"/v0/domains":{"get":{"description":"**CLI:**\n```bash\nagentmail domains list\n```","operationId":"domains_list","tags":["Domains"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDomainsResponse"}}}}},"summary":"List Domains","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail domains create --domain example.com\n```","operationId":"domains_create","tags":["Domains"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDomainRequest"}}}},"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"create"}},"/v0/domains/{domain_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail domains get --domain-id \n```","operationId":"domains_get","tags":["Domains"],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail domains update --domain-id \n```","operationId":"domains_update","tags":["Domains"],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDomainRequest"}}}},"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail domains delete --domain-id \n```","operationId":"domains_delete","tags":["Domains"],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"delete"}},"/v0/domains/{domain_id}/zone-file":{"get":{"description":"**CLI:**\n```bash\nagentmail domains get-zone-file --domain-id \n```","operationId":"domains_getZoneFile","tags":["Domains"],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Zone File","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"get-zone-file"}},"/v0/domains/{domain_id}/verify":{"post":{"description":"**CLI:**\n```bash\nagentmail domains verify --domain-id \n```","operationId":"domains_verify","tags":["Domains"],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Verify Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"verify"}},"/v0/domains/{domain_id}/setup-link":{"get":{"description":"Build a one-click DNS setup link for the domain via the Domain Connect standard. When the domain's DNS provider supports Domain Connect and carries the AgentMail template, the response contains a signed URL: opening it lets the domain owner approve the required DNS records at their provider, which writes them automatically — no copy-paste. When the provider does not support it, `supported` is `false` and the domain's `records` should be added manually instead.","operationId":"domains_getSetupLink","tags":["Domains"],"parameters":[{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSetupLinkResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Setup Link","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["domains"],"x-fern-sdk-method-name":"get-setup-link"}},"/v0/drafts":{"get":{"description":"**CLI:**\n```bash\nagentmail drafts list\n```","operationId":"drafts_list","tags":["Drafts"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDraftsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Drafts","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["drafts"],"x-fern-sdk-method-name":"list"}},"/v0/drafts/{draft_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail drafts get --draft-id \n```","operationId":"drafts_get","tags":["Drafts"],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["drafts"],"x-fern-sdk-method-name":"get"}},"/v0/drafts/{draft_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail drafts get-attachment --draft-id --attachment-id \n```","operationId":"drafts_getAttachment","tags":["Drafts"],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["drafts"],"x-fern-sdk-method-name":"get-attachment"}},"/v0/inboxes/{inbox_id}/api-keys":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes api-keys list --inbox-id \n```","operationId":"inboxes_apiKeys_list","tags":["InboxesApiKeys"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApiKeysResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List API Keys","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","apiKeys"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail inboxes api-keys create --inbox-id --name \"My Key\"\n```","operationId":"inboxes_apiKeys_create","tags":["InboxesApiKeys"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResult"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"x-fern-sdk-group-name":["inboxes","apiKeys"],"x-fern-sdk-method-name":"create"}},"/v0/inboxes/{inbox_id}/api-keys/{api_key_id}":{"patch":{"description":"**CLI:**\n```bash\nagentmail inboxes api-keys update --inbox-id --api-key-id --name \"Renamed\"\n```","operationId":"inboxes_apiKeys_update","tags":["InboxesApiKeys"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"api_key_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ApiKeyId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateApiKeyRequest"}}}},"x-fern-sdk-group-name":["inboxes","apiKeys"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail inboxes api-keys delete --inbox-id --api-key-id \n```","operationId":"inboxes_apiKeys_delete","tags":["InboxesApiKeys"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"api_key_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ApiKeyId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","apiKeys"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/drafts":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes drafts list --inbox-id \n```","operationId":"inboxes_drafts_list","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDraftsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Drafts","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"list"},"post":{"description":"Create a draft. Supply `in_reply_to` to create a reply draft (with\n`reply_all` to address the whole thread), whose recipients, subject, and\nthreading are derived from the referenced message, or `forward_of` to\ncreate a forward draft, which derives the subject, threading, and\nforwarded content from the source but keeps recipients caller-supplied.\n\n**CLI:**\n```bash\nagentmail inboxes drafts create --inbox-id --to recipient@example.com --subject \"Draft subject\" --text \"Draft body\"\n```","operationId":"inboxes_drafts_create","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDraftRequest"}}}},"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"create"}},"/v0/inboxes/{inbox_id}/drafts/{draft_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes drafts get --inbox-id --draft-id \n```","operationId":"inboxes_drafts_get","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"get"},"patch":{"description":"Edit fields on an existing draft. Passing `null` clears a field (or `[]`\nfor a recipient field); `send_at: null` un-schedules a scheduled draft.\nA draft that is already being sent cannot be edited.\n\n**CLI:**\n```bash\nagentmail inboxes drafts update --inbox-id --draft-id --subject \"Updated subject\"\n```","operationId":"inboxes_drafts_update","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDraftRequest"}}}},"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail inboxes drafts delete --inbox-id --draft-id \n```","operationId":"inboxes_drafts_delete","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes drafts get-attachment --inbox-id --draft-id --attachment-id \n```","operationId":"inboxes_drafts_getAttachment","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"get-attachment"}},"/v0/inboxes/{inbox_id}/drafts/{draft_id}/send":{"post":{"description":"**CLI:**\n```bash\nagentmail inboxes drafts send --inbox-id --draft-id \n```","operationId":"inboxes_drafts_send","tags":["InboxesDrafts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key that makes a send idempotent. A retry carrying the same key returns the original message instead of sending a second email; reusing a key with a different request returns a 409 conflict. Keys expire 24 hours after the send completes.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Send Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMessageRequest"}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["inboxes","drafts"],"x-fern-sdk-method-name":"send"}},"/v0/inboxes/{inbox_id}/events":{"get":{"description":"List label change events for an inbox. Returns events in reverse chronological order by default. Use for IMAP UID projection or audit logging.\n\n**CLI:**\n```bash\nagentmail inboxes events list --inbox-id \n```","operationId":"inboxes_events_list","tags":["InboxesEvents"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInboxEventsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Inbox Events","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","events"],"x-fern-sdk-method-name":"list"}},"/v0/inboxes/{inbox_id}/lists/{direction}/{type}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes lists list --inbox-id --direction --type \n```","operationId":"inboxes_lists_list","tags":["InboxesLists"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodListListEntriesResponse"}}}}},"summary":"List Entries","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","lists"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail inboxes lists create --inbox-id --direction --type --entry user@example.com\n```","operationId":"inboxes_lists_create","tags":["InboxesLists"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodListEntry"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateListEntryRequest"}}}},"x-fern-sdk-group-name":["inboxes","lists"],"x-fern-sdk-method-name":"create"}},"/v0/inboxes/{inbox_id}/lists/{direction}/{type}/{entry}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes lists get --inbox-id --direction --type --entry \n```","operationId":"inboxes_lists_get","tags":["InboxesLists"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"entry","in":"path","description":"Email address or domain.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodListEntry"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","lists"],"x-fern-sdk-method-name":"get"},"delete":{"description":"**CLI:**\n```bash\nagentmail inboxes lists delete --inbox-id --direction --type --entry \n```","operationId":"inboxes_lists_delete","tags":["InboxesLists"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"entry","in":"path","description":"Email address or domain.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","lists"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/messages":{"get":{"description":"Lists messages in the inbox, most recent first. Pass `from`, `to`, or\n`subject` to filter by substring. Filtered requests are served by\nsearch, which caps `limit` at 100. For relevance-ranked full-text\nsearch across sender, recipients, subject, and message body, use\n`Search Messages`.\n\n**CLI:**\n```bash\nagentmail inboxes messages list --inbox-id \n```","operationId":"inboxes_messages_list","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}},{"name":"include_spam","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeSpam","nullable":true}},{"name":"include_blocked","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeBlocked","nullable":true}},{"name":"include_unauthenticated","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeUnauthenticated","nullable":true}},{"name":"include_trash","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeTrash","nullable":true}},{"name":"from","in":"query","description":"Filter to messages whose sender contains this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"to","in":"query","description":"Filter to messages whose recipients (to, cc, or bcc) contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"subject","in":"query","description":"Filter to messages whose subject contains this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMessagesResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Messages","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"list"}},"/v0/inboxes/{inbox_id}/messages/search":{"get":{"description":"Full-text search across messages in the inbox, ranked by relevance. The\nquery is matched against the sender, recipients, and subject (substring)\nand the message body (tokenized full text). Spam, trash, blocked, and\nunauthenticated messages are always excluded. `limit` cannot exceed 100.","operationId":"inboxes_messages_search","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"q","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Query"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchMessagesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Search Messages","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"search"}},"/v0/inboxes/{inbox_id}/messages/{message_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes messages get --inbox-id --message-id \n```","operationId":"inboxes_messages_get","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail inboxes messages update --inbox-id --message-id --add-labels read --remove-labels unread\n```","operationId":"inboxes_messages_update","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMessageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMessageRequest"}}}},"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"update"},"delete":{"description":"Permanently deletes a message.\n\n**CLI:**\n```bash\nagentmail inboxes messages delete --inbox-id --message-id \n```","operationId":"inboxes_messages_delete","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/messages/batch-get":{"post":{"description":"Fetch metadata for up to 500 messages in one request. Missing or\nrestricted IDs are silently omitted; compare `count` against `limit`\nto detect misses.\n\n**CLI:**\n```bash\nagentmail inboxes messages batch-get --inbox-id --message-ids --message-ids \n```","operationId":"inboxes_messages_batchGet","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchGetMessagesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Batch Get Messages","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchGetMessagesRequest"}}}},"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"batch-get"}},"/v0/inboxes/{inbox_id}/messages/batch-update":{"post":{"description":"Apply one label change to up to 50 messages in a single request. The\nsame add_labels and remove_labels apply to every message id, and at\nleast one of them must be provided. The update is atomic: either all\nresolved messages are updated or none are. Missing or restricted ids\nare silently excluded; compare `count` against `limit` to detect\nexclusions.\n\n**CLI:**\n```bash\nagentmail inboxes messages batch-update --inbox-id --message-ids --message-ids --add-labels read --remove-labels unread\n```","operationId":"inboxes_messages_batchUpdate","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUpdateMessagesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Batch Update Messages","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUpdateMessagesRequest"}}}},"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"batch-update"}},"/v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes messages get-attachment --inbox-id --message-id --attachment-id \n```","operationId":"inboxes_messages_getAttachment","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"get-attachment"}},"/v0/inboxes/{inbox_id}/messages/{message_id}/raw":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes messages get-raw --inbox-id --message-id \n```","operationId":"inboxes_messages_getRaw","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RawMessageResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Raw Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"get-raw"}},"/v0/inboxes/{inbox_id}/messages/send":{"post":{"description":"**CLI:**\n```bash\nagentmail inboxes messages send --inbox-id --to recipient@example.com --subject \"Hello\" --text \"Body\"\n```","operationId":"inboxes_messages_send","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key that makes a send idempotent. A retry carrying the same key returns the original message instead of sending a second email; reusing a key with a different request returns a 409 conflict. Keys expire 24 hours after the send completes.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Send Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"send"}},"/v0/inboxes/{inbox_id}/messages/{message_id}/reply":{"post":{"description":"**CLI:**\n```bash\nagentmail inboxes messages reply --inbox-id --message-id --text \"Reply text\"\n```","operationId":"inboxes_messages_reply","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key that makes a send idempotent. A retry carrying the same key returns the original message instead of sending a second email; reusing a key with a different request returns a 409 conflict. Keys expire 24 hours after the send completes.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Reply To Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplyToMessageRequest"}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"reply"}},"/v0/inboxes/{inbox_id}/messages/{message_id}/reply-all":{"post":{"description":"**CLI:**\n```bash\nagentmail inboxes messages reply-all --inbox-id --message-id --text \"Reply text\"\n```","operationId":"inboxes_messages_reply-all","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key that makes a send idempotent. A retry carrying the same key returns the original message instead of sending a second email; reusing a key with a different request returns a 409 conflict. Keys expire 24 hours after the send completes.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Reply All Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplyAllMessageRequest"}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"reply-all"}},"/v0/inboxes/{inbox_id}/messages/{message_id}/forward":{"post":{"description":"**CLI:**\n```bash\nagentmail inboxes messages forward --inbox-id --message-id --to recipient@example.com\n```","operationId":"inboxes_messages_forward","tags":["InboxesMessages"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"message_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/MessageId"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key that makes a send idempotent. A retry carrying the same key returns the original message instead of sending a second email; reusing a key with a different request returns a 409 conflict. Keys expire 24 hours after the send completes.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"403":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Forward Message","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["inboxes","messages"],"x-fern-sdk-method-name":"forward"}},"/v0/inboxes/{inbox_id}/metrics/events":{"get":{"description":"Counts of email events (sent, delivered, bounced, etc.) over time for\nthe inbox. Defaults to the last 24 hours; `start` must be within the\nlast 90 days, and a future `end` is clamped to now. Omit `period` for\nindividual event counts, or set it to sum counts into buckets of that\nmany seconds.\n\n**CLI:**\n```bash\nagentmail inboxes metrics query-events --inbox-id \n```","operationId":"inboxes_metrics_queryEvents","tags":["InboxesMetrics"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"event_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricEventTypes","nullable":true}},{"name":"start","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Start","nullable":true}},{"name":"end","in":"query","required":false,"schema":{"$ref":"#/components/schemas/End","nullable":true}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricLimit","nullable":true}},{"name":"descending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Descending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryMetricsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Events","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","metrics"],"x-fern-sdk-method-name":"query-events"}},"/v0/inboxes/{inbox_id}/metrics/usage":{"get":{"description":"Cumulative usage series for the inbox. Each point is the running total\nof the usage type at that timestamp, not the change within the bucket.\nInbox-scoped queries carry `storage_bytes`, `message_count`, and\n`thread_count`; requested types that don't apply to the scope are\nignored. Defaults to the last 24 hours; `start` must be within the\nlast 90 days, and a future `end` is clamped to now. The range divided\nby `period` must not exceed 1000 buckets.","operationId":"inboxes_metrics_queryUsage","tags":["InboxesMetrics"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"usage_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/UsageTypes","nullable":true}},{"name":"start","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Start","nullable":true}},{"name":"end","in":"query","required":false,"schema":{"$ref":"#/components/schemas/End","nullable":true}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricLimit","nullable":true}},{"name":"descending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Descending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryUsageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Usage","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","metrics"],"x-fern-sdk-method-name":"query-usage"}},"/v0/inboxes/{inbox_id}/threads":{"get":{"description":"Lists threads in the inbox, most recent first. Pass `senders`,\n`recipients`, or `subject` to filter by substring. Filtered requests are\nserved by search, which caps `limit` at 100. For relevance-ranked\nfull-text search, use `Search Threads`.\n\n**CLI:**\n```bash\nagentmail inboxes threads list --inbox-id \n```","operationId":"inboxes_threads_list","tags":["InboxesThreads"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}},{"name":"include_spam","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeSpam","nullable":true}},{"name":"include_blocked","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeBlocked","nullable":true}},{"name":"include_unauthenticated","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeUnauthenticated","nullable":true}},{"name":"include_trash","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeTrash","nullable":true}},{"name":"senders","in":"query","description":"Filter to threads whose senders contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"recipients","in":"query","description":"Filter to threads whose recipients contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"subject","in":"query","description":"Filter to threads whose subject contains this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListThreadsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Threads","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","threads"],"x-fern-sdk-method-name":"list"}},"/v0/inboxes/{inbox_id}/threads/search":{"get":{"description":"Full-text search across threads in the inbox, ranked by relevance. The\nquery is matched against senders, recipients, and subject (substring)\nand the message body (tokenized full text). Spam, trash, blocked, and\nunauthenticated threads are always excluded. `limit` cannot exceed 100.","operationId":"inboxes_threads_search","tags":["InboxesThreads"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"q","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Query"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchThreadsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Search Threads","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","threads"],"x-fern-sdk-method-name":"search"}},"/v0/inboxes/{inbox_id}/threads/{thread_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes threads get --inbox-id --thread-id \n```","operationId":"inboxes_threads_get","tags":["InboxesThreads"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}},{"name":"limit","in":"query","description":"Maximum number of messages to return. Cannot exceed 100.","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","description":"Token returned by the previous response for retrieving the next, older page.","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","threads"],"x-fern-sdk-method-name":"get"},"patch":{"description":"Updates thread labels. Cannot add or remove system labels (sent, received, bounced, etc.). Rejects requests with a `422` for threads with 100 or more messages.","operationId":"inboxes_threads_update","tags":["InboxesThreads"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadRequest"}}}},"x-fern-sdk-group-name":["inboxes","threads"],"x-fern-sdk-method-name":"update"},"delete":{"description":"Permanently deletes a thread and all of its messages.\n\n**CLI:**\n```bash\nagentmail inboxes threads delete --inbox-id --thread-id \n```","operationId":"inboxes_threads_delete","tags":["InboxesThreads"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","threads"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/threads/{thread_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes threads get-attachment --inbox-id --thread-id --attachment-id \n```","operationId":"inboxes_threads_getAttachment","tags":["InboxesThreads"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","threads"],"x-fern-sdk-method-name":"get-attachment"}},"/v0/inboxes/{inbox_id}/webhooks":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes webhooks list --inbox-id \n```","operationId":"inboxes_webhooks_list","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksListWebhooksResponse"}}}}},"summary":"List Webhooks","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"list"},"post":{"description":"Create a webhook scoped to this inbox.\n\n**CLI:**\n```bash\nagentmail inboxes webhooks create --inbox-id --url https://example.com/webhook --event-types message.received\n```","operationId":"inboxes_webhooks_create","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksCreateInboxWebhookRequest"}}}},"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"create"}},"/v0/inboxes/{inbox_id}/webhooks/{webhook_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail inboxes webhooks get --inbox-id --webhook-id \n```","operationId":"inboxes_webhooks_get","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail inboxes webhooks update --inbox-id --webhook-id --event-types message.received\n```","operationId":"inboxes_webhooks_update","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksUpdateInboxWebhookRequest"}}}},"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail inboxes webhooks delete --inbox-id --webhook-id \n```","operationId":"inboxes_webhooks_delete","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"delete"}},"/v0/inboxes/{inbox_id}/webhooks/{webhook_id}/headers":{"get":{"description":"List the names of custom HTTP headers included with deliveries to this inbox-scoped webhook.\nHeader values are write-only and are never returned.","operationId":"inboxes_webhooks_getHeaders","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhookHeaderNamesResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Webhook Headers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"get-headers"},"patch":{"description":"Atomically set, replace, or remove custom HTTP headers included with deliveries to this\ninbox-scoped webhook. Header values remain write-only.","operationId":"inboxes_webhooks_updateHeaders","tags":["InboxesWebhooks"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"204":{"description":""},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Webhook Headers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksUpdateWebhookHeadersRequest"}}}},"x-fern-sdk-group-name":["inboxes","webhooks"],"x-fern-sdk-method-name":"update-headers"}},"/v0/lists/{direction}/{type}":{"get":{"description":"**CLI:**\n```bash\nagentmail lists list --direction --type \n```","operationId":"lists_list","tags":["Lists"],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListListEntriesResponse"}}}}},"summary":"List Entries","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["lists"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail lists create --direction --type --entry user@example.com\n```","operationId":"lists_create","tags":["Lists"],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEntry"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateListEntryRequest"}}}},"x-fern-sdk-group-name":["lists"],"x-fern-sdk-method-name":"create"}},"/v0/lists/{direction}/{type}/{entry}":{"get":{"description":"**CLI:**\n```bash\nagentmail lists get --direction --type --entry \n```","operationId":"lists_get","tags":["Lists"],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"entry","in":"path","description":"Email address or domain.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEntry"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["lists"],"x-fern-sdk-method-name":"get"},"delete":{"description":"**CLI:**\n```bash\nagentmail lists delete --direction --type --entry \n```","operationId":"lists_delete","tags":["Lists"],"parameters":[{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"entry","in":"path","description":"Email address or domain.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["lists"],"x-fern-sdk-method-name":"delete"}},"/v0/metrics/events":{"get":{"description":"Counts of email events (sent, delivered, bounced, etc.) over time for\nthe organization. Defaults to the last 24 hours; `start` must be within\nthe last 90 days, and a future `end` is clamped to now. Omit `period`\nfor individual event counts, or set it to sum counts into buckets of\nthat many seconds.\n\n**CLI:**\n```bash\nagentmail metrics query-events\n```","operationId":"metrics_queryEvents","tags":["Metrics"],"parameters":[{"name":"event_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricEventTypes","nullable":true}},{"name":"start","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Start","nullable":true}},{"name":"end","in":"query","required":false,"schema":{"$ref":"#/components/schemas/End","nullable":true}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricLimit","nullable":true}},{"name":"descending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Descending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryMetricsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Events","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["metrics"],"x-fern-sdk-method-name":"query-events"}},"/v0/metrics/usage":{"get":{"description":"Cumulative usage series for the organization. Each point is the running\ntotal of the usage type at that timestamp, not the change within the\nbucket. Defaults to the last 24 hours; `start` must be within the last\n90 days, and a future `end` is clamped to now. The range divided by\n`period` must not exceed 1000 buckets.","operationId":"metrics_queryUsage","tags":["Metrics"],"parameters":[{"name":"usage_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/UsageTypes","nullable":true}},{"name":"start","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Start","nullable":true}},{"name":"end","in":"query","required":false,"schema":{"$ref":"#/components/schemas/End","nullable":true}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricLimit","nullable":true}},{"name":"descending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Descending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryUsageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Usage","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["metrics"],"x-fern-sdk-method-name":"query-usage"}},"/v0/organizations":{"get":{"description":"Returns the organization for the authenticated API key (usage limits, counts, and billing metadata).\n\n**CLI:**\n```bash\nagentmail organizations get\n```","operationId":"organizations_get","tags":["Organizations"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}}},"summary":"Get Organization","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["organizations"],"x-fern-sdk-method-name":"get"}},"/v0/pods/{pod_id}/api-keys":{"get":{"description":"**CLI:**\n```bash\nagentmail pods api-keys list --pod-id \n```","operationId":"pods_apiKeys_list","tags":["PodsApiKeys"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApiKeysResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List API Keys","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","apiKeys"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail pods api-keys create --pod-id --name \"My Key\"\n```","operationId":"pods_apiKeys_create","tags":["PodsApiKeys"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"x-fern-sdk-group-name":["pods","apiKeys"],"x-fern-sdk-method-name":"create"}},"/v0/pods/{pod_id}/api-keys/{api_key_id}":{"patch":{"description":"**CLI:**\n```bash\nagentmail pods api-keys update --pod-id --api-key-id --name \"Renamed\"\n```","operationId":"pods_apiKeys_update","tags":["PodsApiKeys"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"api_key_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ApiKeyId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateApiKeyRequest"}}}},"x-fern-sdk-group-name":["pods","apiKeys"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail pods api-keys delete --pod-id --api-key-id \n```","operationId":"pods_apiKeys_delete","tags":["PodsApiKeys"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"api_key_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ApiKeyId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete API Key","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","apiKeys"],"x-fern-sdk-method-name":"delete"}},"/v0/pods/{pod_id}/domains":{"get":{"description":"**CLI:**\n```bash\nagentmail pods domains list --pod-id \n```","operationId":"pods_domains_list","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDomainsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Domains","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail pods domains create --pod-id --domain example.com\n```","operationId":"pods_domains_create","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDomainRequest"}}}},"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"create"}},"/v0/pods/{pod_id}/domains/{domain_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods domains get --pod-id --domain-id \n```","operationId":"pods_domains_get","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail pods domains update --pod-id --domain-id \n```","operationId":"pods_domains_update","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDomainRequest"}}}},"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail pods domains delete --pod-id --domain-id \n```","operationId":"pods_domains_delete","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"delete"}},"/v0/pods/{pod_id}/domains/{domain_id}/zone-file":{"get":{"description":"**CLI:**\n```bash\nagentmail pods domains get-zone-file --pod-id --domain-id \n```","operationId":"pods_domains_getZoneFile","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Zone File","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"get-zone-file"}},"/v0/pods/{pod_id}/domains/{domain_id}/verify":{"post":{"description":"**CLI:**\n```bash\nagentmail pods domains verify --pod-id --domain-id \n```","operationId":"pods_domains_verify","tags":["PodsDomains"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"domain_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DomainId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Verify Domain","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","domains"],"x-fern-sdk-method-name":"verify"}},"/v0/pods/{pod_id}/drafts":{"get":{"description":"**CLI:**\n```bash\nagentmail pods drafts list --pod-id \n```","operationId":"pods_drafts_list","tags":["PodsDrafts"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDraftsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Drafts","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","drafts"],"x-fern-sdk-method-name":"list"}},"/v0/pods/{pod_id}/drafts/{draft_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods drafts get --pod-id --draft-id \n```","operationId":"pods_drafts_get","tags":["PodsDrafts"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Draft","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","drafts"],"x-fern-sdk-method-name":"get"}},"/v0/pods/{pod_id}/drafts/{draft_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods drafts get-attachment --pod-id --draft-id --attachment-id \n```","operationId":"pods_drafts_getAttachment","tags":["PodsDrafts"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"draft_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/DraftId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","drafts"],"x-fern-sdk-method-name":"get-attachment"}},"/v0/pods/{pod_id}/inboxes":{"get":{"description":"**CLI:**\n```bash\nagentmail pods inboxes list --pod-id \n```","operationId":"pods_inboxes_list","tags":["PodsInboxes"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesListInboxesResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Inboxes","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","inboxes"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail pods inboxes create --pod-id --username myagent --domain example.com\n```","operationId":"pods_inboxes_create","tags":["PodsInboxes"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesInbox"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesCreateInboxRequest"}}}},"x-fern-sdk-group-name":["pods","inboxes"],"x-fern-sdk-method-name":"create"}},"/v0/pods/{pod_id}/inboxes/search":{"get":{"description":"Searches inboxes in the pod by address or display name, ranked by\nrelevance. Each word in the query matches the start of a word in the\naddress or display name, so `sup` matches `support@example.com` but\n`port` does not. An exact address match always ranks first. `limit`\ncannot exceed 100. A page can be empty and still carry a\n`next_page_token`; keep paging until the token is absent.","operationId":"pods_inboxes_search","tags":["PodsInboxes"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"q","in":"query","description":"Address or display name to search for. Matches word prefixes. Must be 2 to 256 characters.","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesSearchInboxesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Search Inboxes","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","inboxes"],"x-fern-sdk-method-name":"search"}},"/v0/pods/{pod_id}/inboxes/{inbox_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods inboxes get --pod-id --inbox-id \n```","operationId":"pods_inboxes_get","tags":["PodsInboxes"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesInbox"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","inboxes"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail pods inboxes update --pod-id --inbox-id \n```","operationId":"pods_inboxes_update","tags":["PodsInboxes"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesInbox"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/inboxesUpdateInboxRequest"}}}},"x-fern-sdk-group-name":["pods","inboxes"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail pods inboxes delete --pod-id --inbox-id \n```","operationId":"pods_inboxes_delete","tags":["PodsInboxes"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Inbox","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","inboxes"],"x-fern-sdk-method-name":"delete"}},"/v0/pods/{pod_id}/lists/{direction}/{type}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods lists list --pod-id --direction --type \n```","operationId":"pods_lists_list","tags":["PodsLists"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodListListEntriesResponse"}}}}},"summary":"List Entries","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","lists"],"x-fern-sdk-method-name":"list"},"post":{"description":"**CLI:**\n```bash\nagentmail pods lists create --pod-id --direction --type --entry user@example.com\n```","operationId":"pods_lists_create","tags":["PodsLists"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodListEntry"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateListEntryRequest"}}}},"x-fern-sdk-group-name":["pods","lists"],"x-fern-sdk-method-name":"create"}},"/v0/pods/{pod_id}/lists/{direction}/{type}/{entry}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods lists get --pod-id --direction --type --entry \n```","operationId":"pods_lists_get","tags":["PodsLists"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"entry","in":"path","description":"Email address or domain.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodListEntry"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","lists"],"x-fern-sdk-method-name":"get"},"delete":{"description":"**CLI:**\n```bash\nagentmail pods lists delete --pod-id --direction --type --entry \n```","operationId":"pods_lists_delete","tags":["PodsLists"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"direction","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Direction"}},{"name":"type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ListType"}},{"name":"entry","in":"path","description":"Email address or domain.","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete List Entry","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","lists"],"x-fern-sdk-method-name":"delete"}},"/v0/pods/{pod_id}/metrics/events":{"get":{"description":"Counts of email events (sent, delivered, bounced, etc.) over time for\nthe pod. Defaults to the last 24 hours; `start` must be within the last\n90 days, and a future `end` is clamped to now. Omit `period` for\nindividual event counts, or set it to sum counts into buckets of that\nmany seconds.\n\n**CLI:**\n```bash\nagentmail pods metrics query-events --pod-id \n```","operationId":"pods_metrics_queryEvents","tags":["PodsMetrics"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"event_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricEventTypes","nullable":true}},{"name":"start","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Start","nullable":true}},{"name":"end","in":"query","required":false,"schema":{"$ref":"#/components/schemas/End","nullable":true}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricLimit","nullable":true}},{"name":"descending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Descending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryMetricsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Events","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","metrics"],"x-fern-sdk-method-name":"query-events"}},"/v0/pods/{pod_id}/metrics/usage":{"get":{"description":"Cumulative usage series for the pod. Each point is the running total of\nthe usage type at that timestamp, not the change within the bucket.\nPod-scoped queries carry every usage type except `pod_count`; requested\ntypes that don't apply to the scope are ignored. Defaults to the last\n24 hours; `start` must be within the last 90 days, and a future `end`\nis clamped to now. The range divided by `period` must not exceed 1000\nbuckets.","operationId":"pods_metrics_queryUsage","tags":["PodsMetrics"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"usage_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/UsageTypes","nullable":true}},{"name":"start","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Start","nullable":true}},{"name":"end","in":"query","required":false,"schema":{"$ref":"#/components/schemas/End","nullable":true}},{"name":"period","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Period","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MetricLimit","nullable":true}},{"name":"descending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Descending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryUsageResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Usage","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","metrics"],"x-fern-sdk-method-name":"query-usage"}},"/v0/pods/{pod_id}/threads":{"get":{"description":"Lists threads in the pod, most recent first. Pass `senders`,\n`recipients`, or `subject` to filter by substring. Filtered requests are\nserved by search, which caps `limit` at 100. For relevance-ranked\nfull-text search, use `Search Threads`.\n\n**CLI:**\n```bash\nagentmail pods threads list --pod-id \n```","operationId":"pods_threads_list","tags":["PodsThreads"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}},{"name":"include_spam","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeSpam","nullable":true}},{"name":"include_blocked","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeBlocked","nullable":true}},{"name":"include_unauthenticated","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeUnauthenticated","nullable":true}},{"name":"include_trash","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeTrash","nullable":true}},{"name":"senders","in":"query","description":"Filter to threads whose senders contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"recipients","in":"query","description":"Filter to threads whose recipients contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"subject","in":"query","description":"Filter to threads whose subject contains this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListThreadsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Threads","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","threads"],"x-fern-sdk-method-name":"list"}},"/v0/pods/{pod_id}/threads/search":{"get":{"description":"Full-text search across threads in the pod, ranked by relevance. The\nquery is matched against senders, recipients, and subject (substring)\nand the message body (tokenized full text). Spam, trash, blocked, and\nunauthenticated threads are always excluded. `limit` cannot exceed 100.","operationId":"pods_threads_search","tags":["PodsThreads"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"q","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Query"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchThreadsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Search Threads","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","threads"],"x-fern-sdk-method-name":"search"}},"/v0/pods/{pod_id}/threads/{thread_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods threads get --pod-id --thread-id \n```","operationId":"pods_threads_get","tags":["PodsThreads"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}},{"name":"limit","in":"query","description":"Maximum number of messages to return. Cannot exceed 100.","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","description":"Token returned by the previous response for retrieving the next, older page.","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","threads"],"x-fern-sdk-method-name":"get"},"patch":{"description":"Updates thread labels. Cannot add or remove system labels (sent, received, bounced, etc.). Rejects requests with a `422` for threads with 100 or more messages.","operationId":"pods_threads_update","tags":["PodsThreads"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadRequest"}}}},"x-fern-sdk-group-name":["pods","threads"],"x-fern-sdk-method-name":"update"},"delete":{"description":"Permanently deletes a thread and all of its messages.\n\n**CLI:**\n```bash\nagentmail pods threads delete --pod-id --thread-id \n```","operationId":"pods_threads_delete","tags":["PodsThreads"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","threads"],"x-fern-sdk-method-name":"delete"}},"/v0/pods/{pod_id}/threads/{thread_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods threads get-attachment --pod-id --thread-id --attachment-id \n```","operationId":"pods_threads_getAttachment","tags":["PodsThreads"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","threads"],"x-fern-sdk-method-name":"get-attachment"}},"/v0/pods/{pod_id}/webhooks":{"get":{"description":"**CLI:**\n```bash\nagentmail pods webhooks list --pod-id \n```","operationId":"pods_webhooks_list","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksListWebhooksResponse"}}}}},"summary":"List Webhooks","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"list"},"post":{"description":"Create a webhook scoped to this pod.\n\n**CLI:**\n```bash\nagentmail pods webhooks create --pod-id --url https://example.com/webhook --event-types message.received\n```","operationId":"pods_webhooks_create","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Create Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksCreatePodWebhookRequest"}}}},"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"create"}},"/v0/pods/{pod_id}/webhooks/{webhook_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail pods webhooks get --pod-id --webhook-id \n```","operationId":"pods_webhooks_get","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"get"},"patch":{"description":"**CLI:**\n```bash\nagentmail pods webhooks update --pod-id --webhook-id --add-inbox-ids \n```","operationId":"pods_webhooks_update","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhook"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksUpdatePodWebhookRequest"}}}},"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"update"},"delete":{"description":"**CLI:**\n```bash\nagentmail pods webhooks delete --pod-id --webhook-id \n```","operationId":"pods_webhooks_delete","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Webhook","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"delete"}},"/v0/pods/{pod_id}/webhooks/{webhook_id}/headers":{"get":{"description":"List the names of custom HTTP headers included with deliveries to this pod-scoped webhook.\nHeader values are write-only and are never returned.","operationId":"pods_webhooks_getHeaders","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksWebhookHeaderNamesResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Webhook Headers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"get-headers"},"patch":{"description":"Atomically set, replace, or remove custom HTTP headers included with deliveries to this\npod-scoped webhook. Header values remain write-only.","operationId":"pods_webhooks_updateHeaders","tags":["PodsWebhooks"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"webhook_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/webhooksWebhookId"}}],"responses":{"204":{"description":""},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Webhook Headers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/webhooksUpdateWebhookHeadersRequest"}}}},"x-fern-sdk-group-name":["pods","webhooks"],"x-fern-sdk-method-name":"update-headers"}},"/v0/providers":{"get":{"description":"Lists providers, most popular first.","operationId":"providers_list","tags":["Providers"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProvidersResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"List Providers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["providers"],"x-fern-sdk-method-name":"list"}},"/v0/providers/search":{"get":{"description":"Searches providers by name prefix.","operationId":"providers_search","tags":["Providers"],"parameters":[{"name":"q","in":"query","description":"Name prefix to search for.","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchProvidersResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Search Providers","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["providers"],"x-fern-sdk-method-name":"search"}},"/v0/providers/{provider_id}":{"get":{"operationId":"providers_get","tags":["Providers"],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Provider"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Provider","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["providers"],"x-fern-sdk-method-name":"get"}},"/v0/providers/{provider_id}/accounts":{"get":{"description":"Lists accounts at one provider, most recent sign-in first.","operationId":"providers_listAccounts","tags":["Providers"],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderId"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProviderAccountsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"List Provider Accounts","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["providers"],"x-fern-sdk-method-name":"list-accounts"}},"/v0/providers/{provider_id}/connect":{"post":{"description":"Starts signing an inbox in to a provider. Returns a single-use `magic_url`,\nvalid for five minutes, to open in the client that will hold the sign-in;\nthe client enrolls as the inbox and continues to the provider. Poll\n[Get API Key](/api-reference/api-keys/get) with `api_key_id` for `status`.","operationId":"providers_connect","tags":["Providers"],"parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderId"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Unique key that makes the connect idempotent. The endpoint requires one; the CLI generates a UUID when the flag is omitted and reuses it across retries, so a transient failure cannot start a second sign-in. Pass a value to make a manual re-run resolve to the same attempt.","schema":{"type":"string"}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectAccepted"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Connect Provider","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectProviderBody","nullable":true}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["providers"],"x-fern-sdk-method-name":"connect"}},"/v0/threads":{"get":{"description":"Lists threads, most recent first. Pass `senders`, `recipients`, or\n`subject` to filter by substring. Filtered requests are served by\nsearch, which caps `limit` at 100. For relevance-ranked full-text\nsearch across senders, recipients, subject, and message body, use\n`Search Threads`.\n\n**CLI:**\n```bash\nagentmail threads list\n```","operationId":"threads_list","tags":["Threads"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"labels","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Labels","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}},{"name":"ascending","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Ascending","nullable":true}},{"name":"include_spam","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeSpam","nullable":true}},{"name":"include_blocked","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeBlocked","nullable":true}},{"name":"include_unauthenticated","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeUnauthenticated","nullable":true}},{"name":"include_trash","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeTrash","nullable":true}},{"name":"senders","in":"query","description":"Filter to threads whose senders contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"recipients","in":"query","description":"Filter to threads whose recipients contain this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}},{"name":"subject","in":"query","description":"Filter to threads whose subject contains this value (substring match). Repeatable; all values must match.","required":false,"schema":{"type":"array","items":{"type":"string"},"nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListThreadsResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"List Threads","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["threads"],"x-fern-sdk-method-name":"list"}},"/v0/threads/search":{"get":{"description":"Full-text search across threads in the organization, ranked by\nrelevance. The query is matched against senders, recipients, and\nsubject (substring) and the message body (tokenized full text). Spam,\ntrash, blocked, and unauthenticated threads are always excluded.\n`limit` cannot exceed 100.","operationId":"threads_search","tags":["Threads"],"parameters":[{"name":"q","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Query"}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Before","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/After","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchThreadsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Search Threads","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["threads"],"x-fern-sdk-method-name":"search"}},"/v0/threads/{thread_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail threads get --thread-id \n```","operationId":"threads_get","tags":["Threads"],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}},{"name":"limit","in":"query","description":"Maximum number of messages to return. Cannot exceed 100.","required":false,"schema":{"$ref":"#/components/schemas/Limit","nullable":true}},{"name":"page_token","in":"query","description":"Token returned by the previous response for retrieving the next, older page.","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["threads"],"x-fern-sdk-method-name":"get"},"patch":{"description":"Updates thread labels. Cannot add or remove system labels (sent, received, bounced, etc.). Rejects requests with a `422` for threads with 100 or more messages.","operationId":"threads_update","tags":["Threads"],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadRequest"}}}},"x-fern-sdk-group-name":["threads"],"x-fern-sdk-method-name":"update"},"delete":{"description":"Permanently deletes a thread and all of its messages.\n\n**CLI:**\n```bash\nagentmail threads delete --thread-id \n```","operationId":"threads_delete","tags":["Threads"],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}}],"responses":{"204":{"description":""},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Thread","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["threads"],"x-fern-sdk-method-name":"delete"}},"/v0/threads/{thread_id}/attachments/{attachment_id}":{"get":{"description":"**CLI:**\n```bash\nagentmail threads get-attachment --thread-id --attachment-id \n```","operationId":"threads_getAttachment","tags":["Threads"],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ThreadId"}},{"name":"attachment_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AttachmentId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Attachment","servers":[{"url":"https://api.agentmail.to"},{"url":"https://x402.api.agentmail.to"},{"url":"https://mpp.api.agentmail.to"},{"url":"https://api.agentmail.eu"}],"security":[{"BearerAuth":[]}],"x-fern-sdk-group-name":["threads"],"x-fern-sdk-method-name":"get-attachment"}}},"components":{"schemas":{"Limit":{"title":"Limit","type":"integer","description":"Limit of number of items returned."},"Count":{"title":"Count","type":"integer","description":"Number of items returned."},"PageToken":{"title":"PageToken","type":"string","description":"Page token for pagination."},"Labels":{"title":"Labels","type":"array","items":{"type":"string"},"description":"Labels to filter by."},"Before":{"title":"Before","type":"string","format":"date-time","description":"Timestamp before which to filter by."},"After":{"title":"After","type":"string","format":"date-time","description":"Timestamp after which to filter by."},"Ascending":{"title":"Ascending","type":"boolean","description":"Sort in ascending temporal order."},"IncludeSpam":{"title":"IncludeSpam","type":"boolean","description":"Include spam in results."},"IncludeBlocked":{"title":"IncludeBlocked","type":"boolean","description":"Include blocked in results."},"IncludeUnauthenticated":{"title":"IncludeUnauthenticated","type":"boolean","description":"Include unauthenticated in results."},"IncludeTrash":{"title":"IncludeTrash","type":"boolean","description":"Include trash in results."},"OrganizationId":{"title":"OrganizationId","type":"string","description":"ID of organization."},"Query":{"title":"Query","type":"string","description":"Full-text search query. Matched against the sender, recipients, and\nsubject (substring) and the message body (tokenized full text)."},"ErrorName":{"title":"ErrorName","type":"string","description":"Name of error."},"ErrorMessage":{"title":"ErrorMessage","type":"string","description":"Error message."},"ErrorCode":{"title":"ErrorCode","type":"string","description":"Stable, machine-readable error code in snake_case (for example, not_found or missing_permission). Branch on this rather than the message text."},"ErrorFix":{"title":"ErrorFix","type":"string","description":"The concrete next action that resolves the error."},"ErrorDocs":{"title":"ErrorDocs","type":"string","description":"Link to the error reference entry for this code."},"ErrorResponse":{"title":"ErrorResponse","type":"object","properties":{"name":{"$ref":"#/components/schemas/ErrorName"},"code":{"$ref":"#/components/schemas/ErrorCode","nullable":true},"message":{"$ref":"#/components/schemas/ErrorMessage"},"fix":{"$ref":"#/components/schemas/ErrorFix","nullable":true},"docs":{"$ref":"#/components/schemas/ErrorDocs","nullable":true}},"required":["name","message"]},"ValidationErrorResponse":{"title":"ValidationErrorResponse","type":"object","properties":{"name":{"$ref":"#/components/schemas/ErrorName"},"code":{"$ref":"#/components/schemas/ErrorCode","nullable":true},"message":{"$ref":"#/components/schemas/ErrorMessage","nullable":true},"errors":{"description":"Validation errors. Each entry has a path and a message identifying the invalid field."},"fix":{"$ref":"#/components/schemas/ErrorFix","nullable":true},"docs":{"$ref":"#/components/schemas/ErrorDocs","nullable":true}},"required":["name","errors"]},"inboxesInboxId":{"title":"inboxesInboxId","type":"string","description":"The ID of the inbox."},"inboxesEmail":{"title":"inboxesEmail","type":"string","description":"Email address of the inbox."},"inboxesDisplayName":{"title":"inboxesDisplayName","type":"string","description":"Display name: `Display Name `."},"inboxesClientId":{"title":"inboxesClientId","type":"string","description":"Client ID of inbox."},"inboxesMetadataValue":{"title":"inboxesMetadataValue","oneOf":[{"type":"string"},{"type":"number","format":"double"},{"type":"boolean"}],"description":"A metadata value. May be a string, number, or boolean."},"inboxesMetadata":{"title":"inboxesMetadata","type":"object","additionalProperties":{"$ref":"#/components/schemas/inboxesMetadataValue"},"description":"Custom key-value pairs attached to the inbox. Up to 256 keys. Keys and\nstring values are each limited to 256 characters. When updating metadata,\nsend a key with a null value to remove that key."},"inboxesUpdateMetadata":{"title":"inboxesUpdateMetadata","type":"object","additionalProperties":{"$ref":"#/components/schemas/inboxesMetadataValue","nullable":true},"description":"Custom key-value pairs to merge into the inbox's existing metadata. A\nvalue may be a string, number, boolean, or null. Setting a key to null\nremoves it. Up to 256 keys; keys and string values are each limited to\n256 characters."},"inboxesInbox":{"title":"inboxesInbox","type":"object","properties":{"pod_id":{"$ref":"#/components/schemas/podsPodId"},"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"email":{"$ref":"#/components/schemas/inboxesEmail"},"display_name":{"$ref":"#/components/schemas/inboxesDisplayName","nullable":true},"client_id":{"$ref":"#/components/schemas/inboxesClientId","nullable":true},"metadata":{"$ref":"#/components/schemas/inboxesMetadata","nullable":true,"description":"Custom metadata attached to the inbox."},"updated_at":{"type":"string","format":"date-time","description":"Time at which inbox was last updated."},"created_at":{"type":"string","format":"date-time","description":"Time at which inbox was created."}},"required":["pod_id","inbox_id","email","updated_at","created_at"]},"inboxesListInboxesResponse":{"title":"inboxesListInboxesResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"inboxes":{"type":"array","items":{"$ref":"#/components/schemas/inboxesInbox"},"description":"Ordered by `created_at` descending."}},"required":["count","inboxes"]},"inboxesSearchInboxesResponse":{"title":"inboxesSearchInboxesResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"inboxes":{"type":"array","items":{"$ref":"#/components/schemas/inboxesInbox"},"description":"Ordered by relevance, best match first."}},"required":["count","inboxes"]},"inboxesCreateInboxRequest":{"title":"inboxesCreateInboxRequest","type":"object","properties":{"username":{"type":"string","nullable":true,"description":"Username of address. Randomly generated if not specified."},"domain":{"type":"string","nullable":true,"description":"Domain of address. Must be a verified domain, or any subdomain of a\nverified domain that has subdomains enabled (e.g., `bot.example.com`).\nDefaults to `agentmail.to`."},"display_name":{"$ref":"#/components/schemas/inboxesDisplayName","nullable":true},"client_id":{"$ref":"#/components/schemas/inboxesClientId","nullable":true},"metadata":{"$ref":"#/components/schemas/inboxesMetadata","nullable":true,"description":"Custom metadata to attach to the inbox."}}},"inboxesUpdateInboxRequest":{"title":"inboxesUpdateInboxRequest","type":"object","properties":{"display_name":{"$ref":"#/components/schemas/inboxesDisplayName","nullable":true},"metadata":{"$ref":"#/components/schemas/inboxesUpdateMetadata","nullable":true,"description":"Metadata to merge into the inbox's existing metadata. Keys you include\nare added or overwritten; keys you omit are left unchanged. To remove a\nsingle key, send it with a null value. To clear all metadata, send\n`metadata` as null. Sending an empty object is rejected; use null to\nclear. Each update must include at least one of `display_name` or\n`metadata`."}}},"inboxesAuthorizeInboxRequest":{"title":"inboxesAuthorizeInboxRequest","type":"object","description":"Authorize one pending AgentID sign-in for the inbox in the path. The\ninbox is selected by the trusted path parameter, never by an AgentID\n`login_hint`.","properties":{"auth_token":{"$ref":"#/components/schemas/AuthToken"},"accept_disclosure":{"$ref":"#/components/schemas/AcceptDisclosure","nullable":true}},"required":["auth_token"]},"podsPodId":{"title":"podsPodId","type":"string","description":"ID of pod."},"podsName":{"title":"podsName","type":"string","description":"Name of pod."},"podsClientId":{"title":"podsClientId","type":"string","description":"Client ID of pod."},"podsPod":{"title":"podsPod","type":"object","properties":{"pod_id":{"$ref":"#/components/schemas/podsPodId"},"name":{"$ref":"#/components/schemas/podsName"},"updated_at":{"type":"string","format":"date-time","description":"Time at which pod was last updated."},"created_at":{"type":"string","format":"date-time","description":"Time at which pod was created."},"client_id":{"$ref":"#/components/schemas/podsClientId","nullable":true}},"required":["pod_id","name","updated_at","created_at"]},"podsListPodsResponse":{"title":"podsListPodsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"pods":{"type":"array","items":{"$ref":"#/components/schemas/podsPod"},"description":"Ordered by `created_at` descending."}},"required":["count","pods"]},"podsCreatePodRequest":{"title":"podsCreatePodRequest","type":"object","properties":{"name":{"$ref":"#/components/schemas/podsName","nullable":true},"client_id":{"$ref":"#/components/schemas/podsClientId","nullable":true}}},"webhooksWebhookId":{"title":"webhooksWebhookId","type":"string","description":"ID of webhook."},"webhooksClientId":{"title":"webhooksClientId","type":"string","description":"Client ID of webhook."},"webhooksUrl":{"title":"webhooksUrl","type":"string","description":"URL of webhook endpoint."},"webhooksWebhookHeaders":{"title":"webhooksWebhookHeaders","type":"object","additionalProperties":{"type":"string"},"description":"Custom HTTP headers to include with every delivery to this webhook. Header values are write-only:\nAgentMail never returns them from webhook read endpoints. The map must contain at least one entry\nwhen provided, and every name and value must be a valid HTTP header."},"webhooksWebhookHeaderNamesResponse":{"title":"webhooksWebhookHeaderNamesResponse","type":"object","properties":{"header_names":{"type":"array","items":{"type":"string"},"description":"Names of the custom delivery headers configured for this webhook. Header values are never returned."}},"required":["header_names"]},"webhooksWebhook":{"title":"webhooksWebhook","type":"object","properties":{"webhook_id":{"$ref":"#/components/schemas/webhooksWebhookId"},"url":{"$ref":"#/components/schemas/webhooksUrl"},"event_types":{"$ref":"#/components/schemas/EventTypes","nullable":true},"pod_ids":{"$ref":"#/components/schemas/PodIds","nullable":true},"inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true},"secret":{"type":"string","description":"Secret for webhook signature verification."},"enabled":{"type":"boolean","description":"Webhook is enabled."},"updated_at":{"type":"string","format":"date-time","description":"Time at which webhook was last updated."},"created_at":{"type":"string","format":"date-time","description":"Time at which webhook was created."},"client_id":{"$ref":"#/components/schemas/webhooksClientId","nullable":true}},"required":["webhook_id","url","secret","enabled","updated_at","created_at"]},"webhooksListWebhooksResponse":{"title":"webhooksListWebhooksResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/webhooksWebhook"},"description":"Ordered by `created_at` descending."}},"required":["count","webhooks"]},"webhooksCreateWebhookEventTypes":{"title":"webhooksCreateWebhookEventTypes","$ref":"#/components/schemas/EventTypes","description":"Full list of event types this webhook should receive. At least one type is required. Send every type you\nwant in this array (not incremental). See [Webhooks overview](https://docs.agentmail.to/webhooks-overview)\nfor spam, blocked, and unauthenticated events and required permissions."},"webhooksUpdateWebhookEventTypes":{"title":"webhooksUpdateWebhookEventTypes","$ref":"#/components/schemas/EventTypes","description":"When you send a non-empty list, it replaces the webhook's subscribed event types in full (the same\n\"set the list\" behavior as create). It is not a merge or diff: include every event type you want after\nthe update. Sending a one-element array means the webhook will only receive that one type afterward.\nOmit this field or send an empty array to leave event types unchanged. Clearing all types with an empty\nlist is not supported. Subscribing to `message.received.spam`, `message.received.blocked`, or\n`message.received.unauthenticated` requires the matching label permission on the API key."},"webhooksCreateInboxWebhookRequest":{"title":"webhooksCreateInboxWebhookRequest","type":"object","description":"Create a webhook scoped to an inbox. The inbox comes from the path, so `inbox_ids` and `pod_ids`\nare not accepted.","properties":{"url":{"$ref":"#/components/schemas/webhooksUrl"},"event_types":{"$ref":"#/components/schemas/webhooksCreateWebhookEventTypes"},"client_id":{"$ref":"#/components/schemas/webhooksClientId","nullable":true},"headers":{"$ref":"#/components/schemas/webhooksWebhookHeaders","nullable":true}},"required":["url","event_types"]},"webhooksCreatePodWebhookRequest":{"title":"webhooksCreatePodWebhookRequest","type":"object","description":"Create a webhook scoped to a pod. The pod comes from the path, so `pod_ids` is not accepted.\nOptionally pass `inbox_ids` to narrow the webhook to specific inboxes within the pod; omit to\nreceive events for the whole pod.","properties":{"inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true}},"allOf":[{"$ref":"#/components/schemas/webhooksCreateInboxWebhookRequest"}]},"webhooksCreateWebhookRequest":{"title":"webhooksCreateWebhookRequest","type":"object","properties":{"pod_ids":{"$ref":"#/components/schemas/PodIds","nullable":true}},"allOf":[{"$ref":"#/components/schemas/webhooksCreatePodWebhookRequest"}]},"webhooksUpdateInboxWebhookRequest":{"title":"webhooksUpdateInboxWebhookRequest","type":"object","description":"Update an inbox-scoped webhook. It is fixed to its inbox, so only `event_types` can change.","properties":{"event_types":{"$ref":"#/components/schemas/webhooksUpdateWebhookEventTypes","nullable":true}}},"webhooksUpdatePodWebhookRequest":{"title":"webhooksUpdatePodWebhookRequest","type":"object","description":"Update a pod-scoped webhook. You can adjust which inboxes within the pod it listens to and replace\nits `event_types`, but not the pod scope itself.","properties":{"add_inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true,"description":"Inbox IDs to subscribe to the webhook."},"remove_inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true,"description":"Inbox IDs to unsubscribe from the webhook."}},"allOf":[{"$ref":"#/components/schemas/webhooksUpdateInboxWebhookRequest"}]},"webhooksUpdateWebhookRequest":{"title":"webhooksUpdateWebhookRequest","type":"object","properties":{"add_pod_ids":{"$ref":"#/components/schemas/PodIds","nullable":true,"description":"Pod IDs to subscribe to the webhook."},"remove_pod_ids":{"$ref":"#/components/schemas/PodIds","nullable":true,"description":"Pod IDs to unsubscribe from the webhook."}},"allOf":[{"$ref":"#/components/schemas/webhooksUpdatePodWebhookRequest"}]},"webhooksUpdateWebhookHeadersRequest":{"title":"webhooksUpdateWebhookHeadersRequest","type":"object","description":"Set, replace, or remove custom delivery headers. Provide at least one of `headers` or\n`remove_headers`. A header cannot be set and removed in the same request, regardless of casing.","properties":{"headers":{"$ref":"#/components/schemas/webhooksWebhookHeaders","nullable":true},"remove_headers":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Names of custom delivery headers to remove."}}},"AccountId":{"title":"AccountId","type":"string","format":"uuid","description":"ID of account."},"ProviderId":{"title":"ProviderId","type":"string","format":"uuid","description":"ID of provider."},"Account":{"title":"Account","type":"object","description":"One inbox signed in at one provider.","properties":{"account_id":{"$ref":"#/components/schemas/AccountId"},"provider_id":{"$ref":"#/components/schemas/ProviderId"},"provider_name":{"type":"string","nullable":true,"description":"Display name of provider."},"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"pod_id":{"$ref":"#/components/schemas/podsPodId"},"organization_id":{"$ref":"#/components/schemas/OrganizationId"},"first_signed_in_at":{"type":"string","format":"date-time","description":"Time of first sign-in at provider."},"last_signed_in_at":{"type":"string","format":"date-time","description":"Time of most recent sign-in at provider."},"sign_in_count":{"type":"integer","description":"Number of sign-ins at provider."}},"required":["account_id","provider_id","inbox_id","pod_id","organization_id","first_signed_in_at","last_signed_in_at","sign_in_count"]},"ListAccountsResponse":{"title":"ListAccountsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}},"required":["count","limit","accounts"]},"AgentSignupRequest":{"title":"AgentSignupRequest","type":"object","description":"Request body to sign up an agent.","properties":{"human_email":{"type":"string","description":"Email address of the human who owns the agent. A 6-digit OTP will be sent to this address."},"username":{"type":"string","description":"Username for the auto-created inbox (e.g. \"my-agent\" creates my-agent@agentmail.to)."},"source":{"type":"string","nullable":true,"description":"The SDK, framework, or platform issuing this sign-up (e.g. `agentmail-python`, `agentmail-cli`, `agentmail-mcp`).\nIdentifies the caller — answers \"who is signing up\".\nMax 2048 characters."},"referrer":{"type":"string","nullable":true,"description":"The channel that drove this sign-up — where the agent or its developer discovered AgentMail\n(e.g. `agent.email`, a partner URL, a campaign tag). Answers \"where did this sign-up come from\".\nMax 2048 characters."}},"required":["human_email","username"]},"AgentSignupResponse":{"title":"AgentSignupResponse","type":"object","description":"Response after successful agent sign-up.","properties":{"organization_id":{"type":"string","description":"ID of the created organization."},"inbox_id":{"type":"string","description":"ID of the auto-created inbox."},"api_key":{"type":"string","description":"API key for authenticating subsequent requests. Store this securely, it cannot be retrieved again."}},"required":["organization_id","inbox_id","api_key"]},"AgentVerifyRequest":{"title":"AgentVerifyRequest","type":"object","description":"Request body to verify an agent with an OTP code.","properties":{"otp_code":{"type":"string","description":"6-digit verification code sent to the human's email address."}},"required":["otp_code"]},"AgentVerifyResponse":{"title":"AgentVerifyResponse","type":"object","description":"Response after successful agent verification.","properties":{"verified":{"type":"boolean","description":"Whether the organization was verified."}},"required":["verified"]},"ApiKeyId":{"title":"ApiKeyId","type":"string","description":"ID of api key."},"Prefix":{"title":"Prefix","type":"string","description":"Prefix of api key."},"Name":{"title":"Name","type":"string","description":"Name of api key."},"CreatedAt":{"title":"CreatedAt","type":"string","format":"date-time","description":"Time at which api key was created."},"UpdatedAt":{"title":"UpdatedAt","type":"string","format":"date-time","description":"Time at which api key was last updated."},"ExpiresAt":{"title":"ExpiresAt","type":"string","format":"date-time","description":"Time at which api key expires. Omitted when it does not expire."},"UsedAt":{"title":"UsedAt","type":"string","format":"date-time","description":"Time at which api key was last used."},"PodScopeId":{"title":"PodScopeId","type":"string","description":"Pod ID the api key is scoped to. If set, the key can only access resources within this pod."},"InboxScopeId":{"title":"InboxScopeId","type":"string","description":"Inbox ID the api key is scoped to. If set, the key can only access resources within this inbox."},"PublicKeyClientId":{"title":"PublicKeyClientId","type":"string","description":"Caller-chosen alias for a public key, unique within the organization and\nreusable after deletion. Accepted in place of `api_key_id` on get, update,\nand delete. Registration is idempotent on it: the same alias returns the\nexisting key, a conflicting one returns `409`. URL-safe; no slash or `@`."},"AcceptDisclosure":{"title":"AcceptDisclosure","type":"boolean","description":"Accept the provider's disclosure on the agent's behalf, skipping the\nfirst-use disclosure page. Requires `provider_share_owner` when owner\nscopes are involved."},"PublicJwkCoordinate":{"title":"PublicJwkCoordinate","type":"string","pattern":"^[A-Za-z0-9_-]{43}$","minLength":43,"maxLength":43,"description":"A 32-byte P-256 coordinate encoded as unpadded base64url."},"PublicJwk":{"title":"PublicJwk","type":"object","description":"A public P-256 JWK. The object accepts exactly `kty`, `crv`, `x`, and `y`.\nPrivate key material such as `d`, embedded key IDs, and all other members\nare rejected. The server also rejects coordinates that are not a point on\nP-256.","properties":{"kty":{"type":"string","const":"EC"},"crv":{"type":"string","const":"P-256"},"x":{"$ref":"#/components/schemas/PublicJwkCoordinate"},"y":{"$ref":"#/components/schemas/PublicJwkCoordinate"}},"required":["kty","crv","x","y"]},"PublicKeyMaterial":{"title":"PublicKeyMaterial","type":"object","description":"Registered public key material and its server-computed RFC 7638 thumbprint.","properties":{"jwk":{"$ref":"#/components/schemas/PublicJwk"},"fingerprint":{"type":"string","pattern":"^[A-Za-z0-9_-]{43}$","minLength":43,"maxLength":43,"description":"RFC 7638 SHA-256 JWK thumbprint encoded as unpadded base64url."}},"required":["jwk","fingerprint"]},"PublicKeyCredential":{"title":"PublicKeyCredential","type":"object","description":"An AgentID sign-in credential, scoped like a bearer key; `api_key_id` is\nthe JWS `kid`. A sign-in key carries `status`, gains `public_key` once\nthe client has proved it, expires 30 days after\nactivation, and carries exactly `provider_connect` and\n`provider_share_owner`, snapshotted from the bearer key that created it\nand enforced from the key itself.","properties":{"type":{"type":"string","const":"public_key"},"api_key_id":{"$ref":"#/components/schemas/ApiKeyId"},"client_id":{"$ref":"#/components/schemas/PublicKeyClientId","nullable":true},"name":{"$ref":"#/components/schemas/Name"},"public_key":{"$ref":"#/components/schemas/PublicKeyMaterial","nullable":true},"pod_id":{"$ref":"#/components/schemas/PodScopeId","nullable":true},"inbox_id":{"$ref":"#/components/schemas/InboxScopeId","nullable":true},"status":{"$ref":"#/components/schemas/PublicKeyStatus","nullable":true},"used_at":{"$ref":"#/components/schemas/UsedAt","nullable":true},"permissions":{"$ref":"#/components/schemas/ApiKeyPermissions"},"created_by":{"$ref":"#/components/schemas/ApiKeyCreator"},"created_at":{"$ref":"#/components/schemas/CreatedAt"},"updated_at":{"$ref":"#/components/schemas/UpdatedAt"},"expires_at":{"$ref":"#/components/schemas/ExpiresAt","nullable":true}},"required":["type","api_key_id","name","permissions","created_by","created_at","updated_at"]},"CreatePublicKeyRequest":{"title":"CreatePublicKeyRequest","type":"object","description":"Registers a public P-256 JWK at the route's scope. `type` and\n`api_key_id` are server-owned. `name` defaults to\n`AgentID key {first eight fingerprint characters}`; `permissions`\ndefaults to the registering key's, and only grants it holds may be\ntrue; `expires_at` defaults to the registering key's expiry and is\nindependent of that key afterward.","properties":{"public_key":{"$ref":"#/components/schemas/PublicJwk"},"client_id":{"$ref":"#/components/schemas/PublicKeyClientId","nullable":true},"name":{"$ref":"#/components/schemas/Name","nullable":true},"permissions":{"$ref":"#/components/schemas/ApiKeyPermissions","nullable":true},"expires_at":{"$ref":"#/components/schemas/ExpiresAt","nullable":true}},"required":["public_key"]},"AuthToken":{"title":"AuthToken","type":"string","pattern":"^[A-Za-z0-9_-]{22}$","minLength":22,"maxLength":22,"description":"Token identifying one pending AgentID sign-in, read from the sign-in action on exactly `https://auth.agentid.com`."},"ApiKeyPermissions":{"title":"ApiKeyPermissions","type":"object","description":"Granular permissions for the API key. When ommitted all permissions are granted. Otherwise, only permissions set to true are granted.","properties":{"inbox_read":{"type":"boolean","nullable":true,"description":"Read inbox details."},"inbox_create":{"type":"boolean","nullable":true,"description":"Create new inboxes."},"inbox_update":{"type":"boolean","nullable":true,"description":"Update inbox settings."},"inbox_delete":{"type":"boolean","nullable":true,"description":"Delete inboxes."},"message_read":{"type":"boolean","nullable":true,"description":"Read messages. Also required to read threads."},"message_send":{"type":"boolean","nullable":true,"description":"Send messages."},"message_update":{"type":"boolean","nullable":true,"description":"Update message labels. Also required to update threads."},"message_delete":{"type":"boolean","nullable":true,"description":"Delete messages. Also required to delete threads."},"label_spam_read":{"type":"boolean","nullable":true,"description":"Access messages labeled spam."},"label_blocked_read":{"type":"boolean","nullable":true,"description":"Access messages labeled blocked."},"label_unauthenticated_read":{"type":"boolean","nullable":true,"description":"Access messages labeled unauthenticated."},"label_trash_read":{"type":"boolean","nullable":true,"description":"Access messages labeled trash."},"draft_read":{"type":"boolean","nullable":true,"description":"Read drafts."},"draft_create":{"type":"boolean","nullable":true,"description":"Create drafts."},"draft_update":{"type":"boolean","nullable":true,"description":"Update drafts."},"draft_delete":{"type":"boolean","nullable":true,"description":"Delete drafts."},"draft_send":{"type":"boolean","nullable":true,"description":"Send drafts."},"webhook_read":{"type":"boolean","nullable":true,"description":"Read webhook configurations."},"webhook_create":{"type":"boolean","nullable":true,"description":"Create webhooks."},"webhook_update":{"type":"boolean","nullable":true,"description":"Update webhooks."},"webhook_delete":{"type":"boolean","nullable":true,"description":"Delete webhooks."},"domain_read":{"type":"boolean","nullable":true,"description":"Read domain details."},"domain_create":{"type":"boolean","nullable":true,"description":"Create domains."},"domain_update":{"type":"boolean","nullable":true,"description":"Update domains."},"domain_delete":{"type":"boolean","nullable":true,"description":"Delete domains."},"list_entry_read":{"type":"boolean","nullable":true,"description":"Read list entries."},"list_entry_create":{"type":"boolean","nullable":true,"description":"Create list entries."},"list_entry_delete":{"type":"boolean","nullable":true,"description":"Delete list entries."},"metrics_read":{"type":"boolean","nullable":true,"description":"Read metrics."},"api_key_read":{"type":"boolean","nullable":true,"description":"Read API keys."},"api_key_create":{"type":"boolean","nullable":true,"description":"Create API keys."},"api_key_update":{"type":"boolean","nullable":true,"description":"Update API keys."},"api_key_delete":{"type":"boolean","nullable":true,"description":"Delete API keys."},"provider_connect":{"type":"boolean","nullable":true,"description":"Sign in to providers as an inbox: connect a provider, authorize an inbox, and mint the\nsign-in keys. Omitted on a new bearer key means false, whatever else the key holds."},"provider_share_owner":{"type":"boolean","nullable":true,"description":"Share the organization owner's name and email with providers at sign-in. One permission\nfor both values."},"pod_read":{"type":"boolean","nullable":true,"description":"Read pods."},"pod_create":{"type":"boolean","nullable":true,"description":"Create pods."},"pod_delete":{"type":"boolean","nullable":true,"description":"Delete pods."}}},"BearerApiKey":{"title":"BearerApiKey","type":"object","description":"An API key presented as a bearer token in the `Authorization` header.","properties":{"type":{"type":"string","const":"bearer"},"api_key_id":{"$ref":"#/components/schemas/ApiKeyId"},"prefix":{"$ref":"#/components/schemas/Prefix"},"name":{"$ref":"#/components/schemas/Name"},"pod_id":{"$ref":"#/components/schemas/PodScopeId","nullable":true},"inbox_id":{"$ref":"#/components/schemas/InboxScopeId","nullable":true},"used_at":{"$ref":"#/components/schemas/UsedAt","nullable":true},"permissions":{"$ref":"#/components/schemas/ApiKeyPermissions","nullable":true},"created_at":{"$ref":"#/components/schemas/CreatedAt"},"updated_at":{"$ref":"#/components/schemas/UpdatedAt"},"expires_at":{"$ref":"#/components/schemas/ExpiresAt","nullable":true}},"required":["type","api_key_id","prefix","name","created_at","updated_at"]},"ApiKeyCreator":{"title":"ApiKeyCreator","type":"object","description":"The bearer API key that created the credential. Provenance only; the credential outlives it.","properties":{"api_key_id":{"$ref":"#/components/schemas/ApiKeyId"}},"required":["api_key_id"]},"PublicKeyStatus":{"title":"PublicKeyStatus","type":"string","enum":["pending","active"],"description":"Lifecycle of a sign-in key: `pending` until the client finishes\ncreating it on the AgentID page, `active` once it can sign in as the\ninbox. Absent on a registered key."},"ApiKey":{"title":"ApiKey","oneOf":[{"$ref":"#/components/schemas/BearerApiKey"},{"$ref":"#/components/schemas/PublicKeyCredential"}],"description":"One credential of any family. `type` is `bearer` or `public_key`. A\npublic key carrying `status` is a sign-in key; one without it is a\nregistered signing key."},"ApiKeyType":{"title":"ApiKeyType","type":"string","enum":["bearer","public_key"]},"CreateApiKeyResponse":{"title":"CreateApiKeyResponse","type":"object","properties":{"api_key_id":{"$ref":"#/components/schemas/ApiKeyId"},"api_key":{"type":"string","description":"API key."},"prefix":{"$ref":"#/components/schemas/Prefix"},"name":{"$ref":"#/components/schemas/Name"},"pod_id":{"$ref":"#/components/schemas/PodScopeId","nullable":true},"inbox_id":{"$ref":"#/components/schemas/InboxScopeId","nullable":true},"permissions":{"$ref":"#/components/schemas/ApiKeyPermissions","nullable":true},"created_at":{"$ref":"#/components/schemas/CreatedAt"}},"required":["api_key_id","api_key","prefix","name","created_at"]},"ListApiKeysResponse":{"title":"ListApiKeysResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"api_keys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"},"description":"Every credential family, ordered by `created_at`. `type` restricts\nto one family."}},"required":["count","api_keys"]},"ApiKeyMutableFields":{"title":"ApiKeyMutableFields","type":"object","description":"The fields a caller may set on a bearer key at creation and change afterward.","properties":{"name":{"$ref":"#/components/schemas/Name","nullable":true},"permissions":{"$ref":"#/components/schemas/ApiKeyPermissions","nullable":true}}},"CreateBearerApiKeyRequest":{"title":"CreateBearerApiKeyRequest","type":"object","properties":{},"allOf":[{"$ref":"#/components/schemas/ApiKeyMutableFields"}]},"CreateApiKeyRequest":{"title":"CreateApiKeyRequest","oneOf":[{"$ref":"#/components/schemas/CreateBearerApiKeyRequest"},{"$ref":"#/components/schemas/CreatePublicKeyRequest"}],"description":"A body with `public_key` registers a public-key credential; any other\nbody mints a bearer key."},"CreateApiKeyResult":{"title":"CreateApiKeyResult","oneOf":[{"$ref":"#/components/schemas/CreateApiKeyResponse"},{"$ref":"#/components/schemas/PublicKeyCredential"}],"description":"The secret-bearing bearer key, or the registered public key without any secret."},"UpdateApiKeyRequest":{"title":"UpdateApiKeyRequest","type":"object","description":"Rename a credential or change its permissions. Key material, type,\nscope, and expiry are immutable.","properties":{},"allOf":[{"$ref":"#/components/schemas/ApiKeyMutableFields"}]},"AttachmentId":{"title":"AttachmentId","type":"string","description":"ID of attachment."},"AttachmentFilename":{"title":"AttachmentFilename","type":"string","description":"Filename of attachment."},"AttachmentSize":{"title":"AttachmentSize","type":"integer","description":"Size of attachment in bytes."},"AttachmentContentType":{"title":"AttachmentContentType","type":"string","description":"Content type of attachment."},"AttachmentContentDisposition":{"title":"AttachmentContentDisposition","type":"string","enum":["inline","attachment"],"description":"Content disposition of attachment."},"AttachmentContentId":{"title":"AttachmentContentId","type":"string","description":"Content ID of attachment."},"Attachment":{"title":"Attachment","type":"object","properties":{"attachment_id":{"$ref":"#/components/schemas/AttachmentId"},"filename":{"$ref":"#/components/schemas/AttachmentFilename","nullable":true},"size":{"$ref":"#/components/schemas/AttachmentSize"},"content_type":{"$ref":"#/components/schemas/AttachmentContentType","nullable":true},"content_disposition":{"$ref":"#/components/schemas/AttachmentContentDisposition","nullable":true},"content_id":{"$ref":"#/components/schemas/AttachmentContentId","nullable":true}},"required":["attachment_id","size"]},"AttachmentResponse":{"title":"AttachmentResponse","type":"object","properties":{"attachment_id":{"$ref":"#/components/schemas/AttachmentId"},"filename":{"$ref":"#/components/schemas/AttachmentFilename","nullable":true},"size":{"$ref":"#/components/schemas/AttachmentSize"},"content_type":{"$ref":"#/components/schemas/AttachmentContentType","nullable":true},"content_disposition":{"$ref":"#/components/schemas/AttachmentContentDisposition","nullable":true},"content_id":{"$ref":"#/components/schemas/AttachmentContentId","nullable":true},"download_url":{"type":"string","description":"URL to download the attachment."},"expires_at":{"type":"string","format":"date-time","description":"Time at which the download URL expires."}},"required":["attachment_id","size","download_url","expires_at"]},"SendAttachment":{"title":"SendAttachment","type":"object","description":"Provide either `content` or `url` for each attachment.","properties":{"filename":{"$ref":"#/components/schemas/AttachmentFilename","nullable":true},"content_type":{"$ref":"#/components/schemas/AttachmentContentType","nullable":true},"content_disposition":{"$ref":"#/components/schemas/AttachmentContentDisposition","nullable":true},"content_id":{"$ref":"#/components/schemas/AttachmentContentId","nullable":true},"content":{"type":"string","nullable":true,"description":"Base64 encoded content of the attachment. The entire request, including the message body and all attachments, is limited to 6 MB."},"url":{"type":"string","nullable":true,"description":"URL that AgentMail can download without custom authentication headers or cookies.\nRedirects and pre-signed URLs are supported, and the final response must be a\nsuccessful 2xx response. Keep URL-backed attachments around 30 MB total per message."}}},"ScopeType":{"title":"ScopeType","type":"string","enum":["organization","pod","inbox"],"description":"The scope tier the authenticated credential is bound to."},"Identity":{"title":"Identity","type":"object","description":"Identity and scope of the authenticated credential.","properties":{"scope_type":{"$ref":"#/components/schemas/ScopeType"},"scope_id":{"type":"string","description":"ID of the most specific scope the credential is bound to.\nEquals inbox_id when scope_type is inbox, pod_id when pod, organization_id when organization."},"organization_id":{"$ref":"#/components/schemas/OrganizationId"},"pod_id":{"type":"string","nullable":true,"description":"ID of the pod the credential is scoped to. Present when scope_type is pod or inbox."},"inbox_id":{"type":"string","nullable":true,"description":"ID of the inbox the credential is scoped to. Present when scope_type is inbox."},"api_key_id":{"type":"string","nullable":true,"description":"ID of the API key used to authenticate. Absent for JWT and proxy credentials."}},"required":["scope_type","scope_id","organization_id"]},"DomainId":{"title":"DomainId","type":"string","description":"The ID of the domain."},"DomainName":{"title":"DomainName","type":"string","description":"The name of the domain (e.g., `example.com`)."},"RecordType":{"title":"RecordType","type":"string","enum":["TXT","CNAME","MX"]},"VerificationStatus":{"title":"VerificationStatus","type":"string","enum":["NOT_STARTED","PENDING","INVALID","FAILED","VERIFYING","VERIFIED"]},"RecordStatus":{"title":"RecordStatus","type":"string","enum":["MISSING","INVALID","VALID"]},"VerificationRecord":{"title":"VerificationRecord","type":"object","properties":{"type":{"$ref":"#/components/schemas/RecordType","description":"The type of the DNS record."},"name":{"type":"string","description":"The name or host of the record."},"value":{"type":"string","description":"The value of the record."},"status":{"$ref":"#/components/schemas/RecordStatus","description":"The verification status of this specific record."},"priority":{"type":"integer","nullable":true,"description":"The priority of the MX record."},"reason":{"type":"string","nullable":true,"description":"Why the record is INVALID, when known. `duplicate_records` means the expected value is present but extra records coexist at the same name; `value_mismatch` means a record exists but does not match the expected value."}},"required":["type","name","value","status"]},"Status":{"title":"Status","$ref":"#/components/schemas/VerificationStatus","description":"The verification status of the domain."},"FeedbackEnabled":{"title":"FeedbackEnabled","type":"boolean","description":"Bounce and complaint notifications are sent to your inboxes."},"SubdomainsEnabled":{"title":"SubdomainsEnabled","type":"boolean","description":"Allow inboxes on any subdomain of this domain. Adds a required wildcard MX\nrecord (`*.`) to `records`."},"TrackingEnabled":{"title":"TrackingEnabled","type":"boolean","description":"Serve open tracking pixels from this domain. Adds a required `link.`\nCNAME record to `records`, which must be published and verified before\n`track_opens` can be used on a send."},"ClientId":{"title":"ClientId","type":"string","description":"Client ID of domain."},"Domain":{"title":"Domain","type":"object","properties":{"pod_id":{"$ref":"#/components/schemas/podsPodId","nullable":true},"domain_id":{"$ref":"#/components/schemas/DomainId"},"domain":{"$ref":"#/components/schemas/DomainName"},"status":{"$ref":"#/components/schemas/Status"},"reason":{"type":"string","nullable":true,"description":"Why the domain is not (yet) VERIFIED, when known. `dns_records_missing` / `dns_records_invalid` point at the DNS records. The `ses_*` values mean the records look right and sending-infrastructure validation has not converged: `ses_dkim_pending` / `ses_mail_from_pending` (still checking), `ses_dkim_temporary_failure` / `ses_mail_from_temporary_failure` (a transient error the infrastructure keeps retrying on its own — usually resolves without changes), `ses_dkim_failed` / `ses_mail_from_failed` (a terminal verdict; re-verify after fixing), `ses_dkim_not_started` / `ses_mail_from_not_started` (the attribute was never configured on the identity — re-verify to push it), and `ses_not_verified_for_sending`. Absent when VERIFIED."},"feedback_enabled":{"$ref":"#/components/schemas/FeedbackEnabled"},"subdomains_enabled":{"$ref":"#/components/schemas/SubdomainsEnabled"},"tracking_enabled":{"$ref":"#/components/schemas/TrackingEnabled"},"records":{"type":"array","items":{"$ref":"#/components/schemas/VerificationRecord"},"description":"A list of DNS records required to verify the domain. Includes a\nwildcard MX record (`*.`) when `subdomains_enabled` is true."},"client_id":{"$ref":"#/components/schemas/ClientId","nullable":true},"updated_at":{"type":"string","format":"date-time","description":"Time at which the domain was last updated."},"created_at":{"type":"string","format":"date-time","description":"Time at which the domain was created."}},"required":["domain_id","domain","status","feedback_enabled","subdomains_enabled","tracking_enabled","records","updated_at","created_at"]},"DomainItem":{"title":"DomainItem","type":"object","properties":{"pod_id":{"$ref":"#/components/schemas/podsPodId","nullable":true},"domain_id":{"$ref":"#/components/schemas/DomainId"},"domain":{"$ref":"#/components/schemas/DomainName"},"feedback_enabled":{"$ref":"#/components/schemas/FeedbackEnabled"},"subdomains_enabled":{"$ref":"#/components/schemas/SubdomainsEnabled"},"tracking_enabled":{"$ref":"#/components/schemas/TrackingEnabled"},"client_id":{"$ref":"#/components/schemas/ClientId","nullable":true},"updated_at":{"type":"string","format":"date-time","description":"Time at which the domain was last updated."},"created_at":{"type":"string","format":"date-time","description":"Time at which the domain was created."}},"required":["domain_id","domain","feedback_enabled","subdomains_enabled","tracking_enabled","updated_at","created_at"]},"ListDomainsResponse":{"title":"ListDomainsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"domains":{"type":"array","items":{"$ref":"#/components/schemas/DomainItem"},"description":"Ordered by `created_at` descending."}},"required":["count","domains"]},"GetSetupLinkResponse":{"title":"GetSetupLinkResponse","type":"object","properties":{"supported":{"type":"boolean","description":"Whether one-click setup is available for this domain. `false` means the domain's DNS provider does not support Domain Connect (or does not carry the AgentMail template yet) — add the domain's `records` manually instead."},"provider_name":{"type":"string","nullable":true,"description":"Display name of the domain's DNS provider, for the setup button label."},"url":{"type":"string","nullable":true,"description":"The signed Domain Connect apply URL. Open it in a browser: the domain owner signs in at their DNS provider, reviews the records, and approves — the provider writes them."},"width":{"type":"integer","nullable":true,"description":"Suggested popup width from the provider, in pixels."},"height":{"type":"integer","nullable":true,"description":"Suggested popup height from the provider, in pixels."},"state":{"type":"string","nullable":true,"description":"Opaque value echoed back on the provider's redirect. Store it before opening the URL and compare on return to tie the redirect to this request."},"conflicting_provider":{"type":"string","nullable":true,"description":"Set when the domain currently has another email provider's MX records (for example Google Workspace). Applying the template would replace them — warn before proceeding."}},"required":["supported"]},"CreateDomainRequest":{"title":"CreateDomainRequest","type":"object","properties":{"domain":{"$ref":"#/components/schemas/DomainName"},"feedback_enabled":{"$ref":"#/components/schemas/FeedbackEnabled","nullable":true},"subdomains_enabled":{"$ref":"#/components/schemas/SubdomainsEnabled","nullable":true},"tracking_enabled":{"$ref":"#/components/schemas/TrackingEnabled","nullable":true}},"required":["domain"]},"UpdateDomainRequest":{"title":"UpdateDomainRequest","type":"object","description":"Provide at least one of `feedback_enabled`, `subdomains_enabled`, or\n`tracking_enabled`. Omitted\nfields are left unchanged; an empty body is rejected. Enabling\n`subdomains_enabled` on a verified domain returns it to `PENDING` until the\nnewly-required wildcard MX record (`*.`) is published and verified.","properties":{"feedback_enabled":{"$ref":"#/components/schemas/FeedbackEnabled","nullable":true},"subdomains_enabled":{"$ref":"#/components/schemas/SubdomainsEnabled","nullable":true},"tracking_enabled":{"$ref":"#/components/schemas/TrackingEnabled","nullable":true}}},"DraftId":{"title":"DraftId","type":"string","description":"ID of draft."},"DraftClientId":{"title":"DraftClientId","type":"string","description":"Client ID of draft."},"DraftLabels":{"title":"DraftLabels","type":"array","items":{"type":"string"},"description":"Labels of draft."},"DraftReplyTo":{"title":"DraftReplyTo","type":"array","items":{"type":"string"},"description":"Reply-to addresses. In format `username@domain.com` or `Display Name `."},"DraftTo":{"title":"DraftTo","type":"array","items":{"type":"string"},"description":"Addresses of recipients. In format `username@domain.com` or `Display Name `."},"DraftCc":{"title":"DraftCc","type":"array","items":{"type":"string"},"description":"Addresses of CC recipients. In format `username@domain.com` or `Display Name `."},"DraftBcc":{"title":"DraftBcc","type":"array","items":{"type":"string"},"description":"Addresses of BCC recipients. In format `username@domain.com` or `Display Name `."},"DraftSubject":{"title":"DraftSubject","type":"string","description":"Subject of draft."},"DraftPreview":{"title":"DraftPreview","type":"string","description":"Text preview of draft."},"DraftText":{"title":"DraftText","type":"string","description":"Plain text body of draft."},"DraftHtml":{"title":"DraftHtml","type":"string","description":"HTML body of draft."},"DraftAttachments":{"title":"DraftAttachments","type":"array","items":{"$ref":"#/components/schemas/Attachment"},"description":"Attachments in draft."},"DraftInReplyTo":{"title":"DraftInReplyTo","type":"string","description":"ID of message being replied to."},"DraftForwardOf":{"title":"DraftForwardOf","type":"string","description":"ID of message being forwarded."},"DraftReplyAll":{"title":"DraftReplyAll","type":"boolean","description":"Reply to all recipients of the original message."},"DraftSendStatus":{"title":"DraftSendStatus","type":"string","enum":["scheduled","sending","failed"],"description":"Schedule send status of draft."},"DraftSendAt":{"title":"DraftSendAt","type":"string","format":"date-time","description":"Time at which to schedule send draft."},"DraftUpdatedAt":{"title":"DraftUpdatedAt","type":"string","format":"date-time","description":"Time at which draft was last updated."},"DraftItem":{"title":"DraftItem","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"draft_id":{"$ref":"#/components/schemas/DraftId"},"labels":{"$ref":"#/components/schemas/DraftLabels"},"to":{"$ref":"#/components/schemas/DraftTo","nullable":true},"cc":{"$ref":"#/components/schemas/DraftCc","nullable":true},"bcc":{"$ref":"#/components/schemas/DraftBcc","nullable":true},"subject":{"$ref":"#/components/schemas/DraftSubject","nullable":true},"preview":{"$ref":"#/components/schemas/DraftPreview","nullable":true},"attachments":{"$ref":"#/components/schemas/DraftAttachments","nullable":true},"in_reply_to":{"$ref":"#/components/schemas/DraftInReplyTo","nullable":true},"forward_of":{"$ref":"#/components/schemas/DraftForwardOf","nullable":true},"send_status":{"$ref":"#/components/schemas/DraftSendStatus","nullable":true},"send_at":{"$ref":"#/components/schemas/DraftSendAt","nullable":true},"updated_at":{"$ref":"#/components/schemas/DraftUpdatedAt"}},"required":["inbox_id","draft_id","labels","updated_at"]},"Draft":{"title":"Draft","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"draft_id":{"$ref":"#/components/schemas/DraftId"},"client_id":{"$ref":"#/components/schemas/DraftClientId","nullable":true},"labels":{"$ref":"#/components/schemas/DraftLabels"},"reply_to":{"$ref":"#/components/schemas/DraftReplyTo","nullable":true},"to":{"$ref":"#/components/schemas/DraftTo","nullable":true},"cc":{"$ref":"#/components/schemas/DraftCc","nullable":true},"bcc":{"$ref":"#/components/schemas/DraftBcc","nullable":true},"subject":{"$ref":"#/components/schemas/DraftSubject","nullable":true},"preview":{"$ref":"#/components/schemas/DraftPreview","nullable":true},"text":{"$ref":"#/components/schemas/DraftText","nullable":true},"html":{"$ref":"#/components/schemas/DraftHtml","nullable":true},"attachments":{"$ref":"#/components/schemas/DraftAttachments","nullable":true},"in_reply_to":{"$ref":"#/components/schemas/DraftInReplyTo","nullable":true},"forward_of":{"$ref":"#/components/schemas/DraftForwardOf","nullable":true},"references":{"type":"array","items":{"type":"string"},"nullable":true,"description":"IDs of previous messages in thread."},"send_status":{"$ref":"#/components/schemas/DraftSendStatus","nullable":true},"send_at":{"$ref":"#/components/schemas/DraftSendAt","nullable":true},"updated_at":{"$ref":"#/components/schemas/DraftUpdatedAt"},"created_at":{"type":"string","format":"date-time","description":"Time at which draft was created."}},"required":["inbox_id","draft_id","labels","updated_at","created_at"]},"ListDraftsResponse":{"title":"ListDraftsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"drafts":{"type":"array","items":{"$ref":"#/components/schemas/DraftItem"},"description":"Ordered by `updated_at` descending."}},"required":["count","drafts"]},"CreateDraftRequest":{"title":"CreateDraftRequest","type":"object","description":"Body for creating a draft. Supports plain, reply, reply-all, and forward\ndrafts:\n\n- **Plain draft:** supply `to`, `subject`, `text`, etc.\n- **Reply:** set `in_reply_to` to a message ID. Recipients, subject, and\n threading are derived from that message. Set `reply_all` to address the\n whole thread (you then cannot also pass `to`, `cc`, or `bcc`).\n- **Forward:** set `forward_of` to a message ID. The subject and threading\n are derived from the source message, whose body and attachments are\n merged in at send time.\n\n`in_reply_to` and `forward_of` are mutually exclusive, and reading the\nreferenced message requires `message_read` permission.","properties":{"labels":{"$ref":"#/components/schemas/DraftLabels","nullable":true},"reply_to":{"$ref":"#/components/schemas/DraftReplyTo","nullable":true},"to":{"$ref":"#/components/schemas/DraftTo","nullable":true},"cc":{"$ref":"#/components/schemas/DraftCc","nullable":true},"bcc":{"$ref":"#/components/schemas/DraftBcc","nullable":true},"subject":{"$ref":"#/components/schemas/DraftSubject","nullable":true},"text":{"$ref":"#/components/schemas/DraftText","nullable":true},"html":{"$ref":"#/components/schemas/DraftHtml","nullable":true},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/SendAttachment"},"nullable":true,"description":"Attachments to include in draft."},"in_reply_to":{"$ref":"#/components/schemas/DraftInReplyTo","nullable":true},"forward_of":{"$ref":"#/components/schemas/DraftForwardOf","nullable":true},"reply_all":{"$ref":"#/components/schemas/DraftReplyAll","nullable":true},"send_at":{"$ref":"#/components/schemas/DraftSendAt","nullable":true},"client_id":{"$ref":"#/components/schemas/DraftClientId","nullable":true}}},"UpdateDraftRequest":{"title":"UpdateDraftRequest","type":"object","description":"Edit fields on an existing draft. A draft's kind (plain, reply, or forward)\nis fixed at creation and cannot be changed here. Omitting a field leaves it\nunchanged; passing `null` (or `[]` for a recipient field) clears it. Pass\n`send_at` to schedule or reschedule the draft, or `null` to un-schedule it.","properties":{"reply_to":{"$ref":"#/components/schemas/DraftReplyTo","nullable":true},"to":{"$ref":"#/components/schemas/DraftTo","nullable":true},"cc":{"$ref":"#/components/schemas/DraftCc","nullable":true},"bcc":{"$ref":"#/components/schemas/DraftBcc","nullable":true},"subject":{"$ref":"#/components/schemas/DraftSubject","nullable":true},"text":{"$ref":"#/components/schemas/DraftText","nullable":true},"html":{"$ref":"#/components/schemas/DraftHtml","nullable":true},"add_attachments":{"type":"array","items":{"$ref":"#/components/schemas/SendAttachment"},"nullable":true,"description":"Attachments to add to the draft."},"remove_attachments":{"type":"array","items":{"$ref":"#/components/schemas/AttachmentId"},"nullable":true,"description":"IDs of attachments to remove from the draft."},"add_labels":{"$ref":"#/components/schemas/DraftLabels","nullable":true,"description":"Label or labels to add to the draft."},"remove_labels":{"$ref":"#/components/schemas/DraftLabels","nullable":true,"description":"Label or labels to remove from the draft."},"send_at":{"$ref":"#/components/schemas/DraftSendAt","nullable":true}}},"EventType":{"title":"EventType","type":"string","enum":["message.received","message.received.spam","message.received.blocked","message.received.unauthenticated","message.sent","message.delivered","message.bounced","message.complained","message.rejected","message.opened","domain.verified"]},"EventTypes":{"title":"EventTypes","type":"array","items":{"$ref":"#/components/schemas/EventType"},"description":"Event types for which to send events."},"MessageReceivedEventType":{"title":"MessageReceivedEventType","type":"string","enum":["message.received","message.received.spam","message.received.blocked","message.received.unauthenticated"]},"PodIds":{"title":"PodIds","type":"array","items":{"type":"string"},"description":"Pods for which to send events. Maximum 10 per webhook."},"InboxIds":{"title":"InboxIds","type":"array","items":{"type":"string"},"description":"Inboxes for which to send events. Maximum 10 per webhook."},"EventId":{"title":"EventId","type":"string","description":"ID of event."},"Timestamp":{"title":"Timestamp","type":"string","format":"date-time","description":"Timestamp of event."},"Recipient":{"title":"Recipient","type":"object","properties":{"address":{"type":"string","description":"Recipient address."},"status":{"type":"string","description":"Recipient status."}},"required":["address","status"]},"Send":{"title":"Send","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"recipients":{"type":"array","items":{"type":"string"},"description":"Sent recipients."}},"required":["inbox_id","thread_id","message_id","timestamp","recipients"],"x-fern-type-name":"SendEvent"},"Delivery":{"title":"Delivery","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"recipients":{"type":"array","items":{"type":"string"},"description":"Delivered recipients."}},"required":["inbox_id","thread_id","message_id","timestamp","recipients"]},"Bounce":{"title":"Bounce","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"type":{"type":"string","description":"Bounce type."},"sub_type":{"type":"string","description":"Bounce sub-type."},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/Recipient"},"description":"Bounced recipients."}},"required":["inbox_id","thread_id","message_id","timestamp","type","sub_type","recipients"]},"Complaint":{"title":"Complaint","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"type":{"type":"string","description":"Complaint type."},"sub_type":{"type":"string","description":"Complaint sub-type."},"recipients":{"type":"array","items":{"type":"string"},"description":"Complained recipients."}},"required":["inbox_id","thread_id","message_id","timestamp","type","sub_type","recipients"]},"Reject":{"title":"Reject","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"reason":{"type":"string","description":"Reject reason."}},"required":["inbox_id","thread_id","message_id","timestamp","reason"]},"Open":{"title":"Open","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"timestamp":{"$ref":"#/components/schemas/Timestamp"}},"required":["inbox_id","thread_id","message_id","timestamp"]},"MessageReceivedEvent":{"title":"MessageReceivedEvent","type":"object","description":"A message was received. Spam, blocked, and unauthenticated received-message events use the same payload shape with different `event_type` values.","properties":{"type":{"type":"string","const":"event"},"event_type":{"$ref":"#/components/schemas/MessageReceivedEventType"},"event_id":{"$ref":"#/components/schemas/EventId"},"message":{"$ref":"#/components/schemas/Message"},"thread":{"$ref":"#/components/schemas/ThreadItem"}},"required":["type","event_type","event_id","message","thread"]},"MessageSentEvent":{"title":"MessageSentEvent","type":"object","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"message.sent"},"event_id":{"$ref":"#/components/schemas/EventId"},"send":{"$ref":"#/components/schemas/Send"}},"required":["type","event_type","event_id","send"]},"MessageDeliveredEvent":{"title":"MessageDeliveredEvent","type":"object","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"message.delivered"},"event_id":{"$ref":"#/components/schemas/EventId"},"delivery":{"$ref":"#/components/schemas/Delivery"}},"required":["type","event_type","event_id","delivery"]},"MessageBouncedEvent":{"title":"MessageBouncedEvent","type":"object","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"message.bounced"},"event_id":{"$ref":"#/components/schemas/EventId"},"bounce":{"$ref":"#/components/schemas/Bounce"}},"required":["type","event_type","event_id","bounce"]},"MessageComplainedEvent":{"title":"MessageComplainedEvent","type":"object","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"message.complained"},"event_id":{"$ref":"#/components/schemas/EventId"},"complaint":{"$ref":"#/components/schemas/Complaint"}},"required":["type","event_type","event_id","complaint"]},"MessageRejectedEvent":{"title":"MessageRejectedEvent","type":"object","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"message.rejected"},"event_id":{"$ref":"#/components/schemas/EventId"},"reject":{"$ref":"#/components/schemas/Reject"}},"required":["type","event_type","event_id","reject"]},"MessageOpenedEvent":{"title":"MessageOpenedEvent","type":"object","description":"A tracked message was opened for the first time. Sent once per message: repeat opens do not\nresend it.","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"message.opened"},"event_id":{"$ref":"#/components/schemas/EventId"},"open":{"$ref":"#/components/schemas/Open"}},"required":["type","event_type","event_id","open"]},"DomainVerifiedEvent":{"title":"DomainVerifiedEvent","type":"object","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"domain.verified"},"event_id":{"$ref":"#/components/schemas/EventId"},"domain":{"$ref":"#/components/schemas/Domain"}},"required":["type","event_type","event_id","domain"]},"InboxEventId":{"title":"InboxEventId","type":"string","description":"ID of event."},"InboxEventType":{"title":"InboxEventType","type":"string","enum":["label.added","label.removed"],"description":"Type of inbox event. Wire format is dot.case to match the\nconvention used by webhook events (`message.received`,\n`domain.verified`, etc. in events.yml). Pre-2026-04 these were\n`label_added`/`label_removed` (snake_case). The Fern enum's `name`\nfield stays uppercase-snake (Fern convention); only the wire\n`value` changed."},"InboxEvent":{"title":"InboxEvent","type":"object","properties":{"organization_id":{"$ref":"#/components/schemas/OrganizationId"},"pod_id":{"type":"string","description":"ID of pod."},"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"event_id":{"$ref":"#/components/schemas/InboxEventId"},"event_type":{"$ref":"#/components/schemas/InboxEventType"},"message_id":{"type":"string","description":"ID of message."},"label":{"type":"string","description":"Label added or removed."},"event_at":{"type":"string","format":"date-time","description":"Time at which the event occurred."},"created_at":{"type":"string","format":"date-time","description":"Time at which the event was recorded."}},"required":["organization_id","pod_id","inbox_id","event_id","event_type","message_id","label","event_at","created_at"]},"ListInboxEventsResponse":{"title":"ListInboxEventsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"events":{"type":"array","items":{"$ref":"#/components/schemas/InboxEvent"},"description":"Ordered by `event_id` descending."}},"required":["count","events"]},"Direction":{"title":"Direction","type":"string","enum":["send","receive","reply"],"description":"Direction of list entry."},"ListType":{"title":"ListType","type":"string","enum":["allow","block"],"description":"Type of list entry."},"EntryType":{"title":"EntryType","type":"string","enum":["email","domain"],"description":"Whether the entry is an email address or domain."},"ListEntryBase":{"title":"ListEntryBase","type":"object","properties":{"entry":{"type":"string","description":"Email address or domain of list entry."},"organization_id":{"$ref":"#/components/schemas/OrganizationId"},"reason":{"type":"string","nullable":true,"description":"Reason for adding the entry."},"direction":{"$ref":"#/components/schemas/Direction"},"list_type":{"$ref":"#/components/schemas/ListType"},"entry_type":{"$ref":"#/components/schemas/EntryType"},"created_at":{"type":"string","format":"date-time","description":"Time at which entry was created."},"read_only":{"type":"boolean","nullable":true,"description":"Whether the entry is read-only and cannot be deleted via the API."}},"required":["entry","organization_id","direction","list_type","entry_type","created_at"]},"ListEntry":{"title":"ListEntry","type":"object","properties":{},"allOf":[{"$ref":"#/components/schemas/ListEntryBase"}]},"PodListEntry":{"title":"PodListEntry","type":"object","properties":{"pod_id":{"type":"string","description":"ID of pod."},"inbox_id":{"type":"string","nullable":true,"description":"ID of inbox, if entry is inbox-scoped."}},"required":["pod_id"],"allOf":[{"$ref":"#/components/schemas/ListEntryBase"}]},"PodListListEntriesResponse":{"title":"PodListListEntriesResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"entries":{"type":"array","items":{"$ref":"#/components/schemas/PodListEntry"},"description":"Ordered by entry ascending."}},"required":["count","entries"]},"ListListEntriesResponse":{"title":"ListListEntriesResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"entries":{"type":"array","items":{"$ref":"#/components/schemas/ListEntry"},"description":"Ordered by entry ascending."}},"required":["count","entries"]},"CreateListEntryRequest":{"title":"CreateListEntryRequest","type":"object","properties":{"entry":{"type":"string","description":"Email address or domain to add."},"reason":{"type":"string","nullable":true,"description":"Reason for adding the entry."}},"required":["entry"]},"MessageId":{"title":"MessageId","type":"string","description":"ID of message."},"MessageLabels":{"title":"MessageLabels","type":"array","items":{"type":"string"},"description":"Labels of message."},"MessageTimestamp":{"title":"MessageTimestamp","type":"string","format":"date-time","description":"Time at which message was sent or drafted."},"MessageFrom":{"title":"MessageFrom","type":"string","description":"Address of sender. In format `username@domain.com` or `Display Name `."},"MessageReplyTo":{"title":"MessageReplyTo","type":"array","items":{"type":"string"},"description":"Addresses of reply-to recipients. In format `username@domain.com` or `Display Name `."},"MessageTo":{"title":"MessageTo","type":"array","items":{"type":"string"},"description":"Addresses of recipients. In format `username@domain.com` or `Display Name `."},"MessageCc":{"title":"MessageCc","type":"array","items":{"type":"string"},"description":"Addresses of CC recipients. In format `username@domain.com` or `Display Name `."},"MessageBcc":{"title":"MessageBcc","type":"array","items":{"type":"string"},"description":"Addresses of BCC recipients. In format `username@domain.com` or `Display Name `."},"MessageSubject":{"title":"MessageSubject","type":"string","description":"Subject of message."},"MessagePreview":{"title":"MessagePreview","type":"string","description":"Text preview of message."},"MessageText":{"title":"MessageText","type":"string","description":"Plain text body of message."},"MessageHtml":{"title":"MessageHtml","type":"string","description":"HTML body of message."},"MessageAttachments":{"title":"MessageAttachments","type":"array","items":{"$ref":"#/components/schemas/Attachment"},"description":"Attachments in message."},"MessageInReplyTo":{"title":"MessageInReplyTo","type":"string","description":"ID of message being replied to."},"MessageReferences":{"title":"MessageReferences","type":"array","items":{"type":"string"},"description":"IDs of previous messages in thread."},"MessageHeaders":{"title":"MessageHeaders","type":"object","additionalProperties":{"type":"string"},"description":"Headers in message."},"MessageSize":{"title":"MessageSize","type":"integer","description":"Size of message in bytes."},"MessageUpdatedAt":{"title":"MessageUpdatedAt","type":"string","format":"date-time","description":"Time at which message was last updated."},"MessageCreatedAt":{"title":"MessageCreatedAt","type":"string","format":"date-time","description":"Time at which message was created."},"MessageItem":{"title":"MessageItem","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"labels":{"$ref":"#/components/schemas/MessageLabels"},"timestamp":{"$ref":"#/components/schemas/MessageTimestamp"},"from":{"$ref":"#/components/schemas/MessageFrom"},"to":{"$ref":"#/components/schemas/MessageTo"},"cc":{"$ref":"#/components/schemas/MessageCc","nullable":true},"bcc":{"$ref":"#/components/schemas/MessageBcc","nullable":true},"subject":{"$ref":"#/components/schemas/MessageSubject","nullable":true},"preview":{"$ref":"#/components/schemas/MessagePreview","nullable":true},"attachments":{"$ref":"#/components/schemas/MessageAttachments","nullable":true},"in_reply_to":{"$ref":"#/components/schemas/MessageInReplyTo","nullable":true},"references":{"$ref":"#/components/schemas/MessageReferences","nullable":true},"headers":{"$ref":"#/components/schemas/MessageHeaders","nullable":true},"size":{"$ref":"#/components/schemas/MessageSize"},"updated_at":{"$ref":"#/components/schemas/MessageUpdatedAt"},"created_at":{"$ref":"#/components/schemas/MessageCreatedAt"}},"required":["inbox_id","thread_id","message_id","labels","timestamp","from","to","size","updated_at","created_at"]},"Message":{"title":"Message","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"message_id":{"$ref":"#/components/schemas/MessageId"},"labels":{"$ref":"#/components/schemas/MessageLabels"},"timestamp":{"$ref":"#/components/schemas/MessageTimestamp"},"from":{"$ref":"#/components/schemas/MessageFrom"},"reply_to":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Reply-to addresses. In format `username@domain.com` or `Display Name `."},"to":{"$ref":"#/components/schemas/MessageTo"},"cc":{"$ref":"#/components/schemas/MessageCc","nullable":true},"bcc":{"$ref":"#/components/schemas/MessageBcc","nullable":true},"subject":{"$ref":"#/components/schemas/MessageSubject","nullable":true},"preview":{"$ref":"#/components/schemas/MessagePreview","nullable":true},"text":{"$ref":"#/components/schemas/MessageText","nullable":true},"html":{"$ref":"#/components/schemas/MessageHtml","nullable":true},"extracted_text":{"type":"string","nullable":true,"description":"Extracted new text content."},"extracted_html":{"type":"string","nullable":true,"description":"Extracted new HTML content."},"attachments":{"$ref":"#/components/schemas/MessageAttachments","nullable":true},"in_reply_to":{"$ref":"#/components/schemas/MessageInReplyTo","nullable":true},"references":{"$ref":"#/components/schemas/MessageReferences","nullable":true},"headers":{"$ref":"#/components/schemas/MessageHeaders","nullable":true},"size":{"$ref":"#/components/schemas/MessageSize"},"updated_at":{"$ref":"#/components/schemas/MessageUpdatedAt"},"created_at":{"$ref":"#/components/schemas/MessageCreatedAt"}},"required":["inbox_id","thread_id","message_id","labels","timestamp","from","to","size","updated_at","created_at"]},"ListMessagesResponse":{"title":"ListMessagesResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"messages":{"type":"array","items":{"$ref":"#/components/schemas/MessageItem"},"description":"Ordered by `timestamp` descending."}},"required":["count","messages"]},"SearchMessageHighlights":{"title":"SearchMessageHighlights","type":"object","description":"Matched fragments per field on a message search result, with matched terms\nwrapped in `**`. A field key is present only when the query matched that\nfield, so the present keys also tell you which fields produced the hit.","properties":{"from":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from the sender address."},"recipients":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from the recipient addresses (to, cc, or bcc)."},"subject":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from the subject."},"text":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from the message body."}}},"SearchMessageItem":{"title":"SearchMessageItem","type":"object","properties":{"highlights":{"$ref":"#/components/schemas/SearchMessageHighlights","nullable":true,"description":"Matched fragments per field. Present only when the query matched an indexed field."}},"allOf":[{"$ref":"#/components/schemas/MessageItem"}]},"SearchMessagesResponse":{"title":"SearchMessagesResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"messages":{"type":"array","items":{"$ref":"#/components/schemas/SearchMessageItem"},"description":"Ordered by relevance, best match first."}},"required":["count","messages"]},"BatchGetMessagesMessageIds":{"title":"BatchGetMessagesMessageIds","type":"array","items":{"$ref":"#/components/schemas/MessageId"},"description":"IDs of messages to fetch. Maximum 500 ids per request. Duplicates are\nrejected with a validation error. IDs not found in the inbox (including\ncross-inbox or permission-restricted) are silently omitted from the\nresponse; callers detect misses by comparing `count` against `limit`."},"BatchGetMessagesRequest":{"title":"BatchGetMessagesRequest","type":"object","properties":{"message_ids":{"$ref":"#/components/schemas/BatchGetMessagesMessageIds"}},"required":["message_ids"]},"BatchGetMessagesResponse":{"title":"BatchGetMessagesResponse","type":"object","properties":{"limit":{"$ref":"#/components/schemas/Limit"},"count":{"$ref":"#/components/schemas/Count"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"},"description":"Found messages. Order matches `message_ids` in the request. Body\nfields (`text`, `html`, `extracted_text`, `extracted_html`) are\nnever populated; use the single-message endpoint to retrieve bodies."}},"required":["limit","count","messages"]},"BatchUpdateMessagesMessageIds":{"title":"BatchUpdateMessagesMessageIds","type":"array","items":{"$ref":"#/components/schemas/MessageId"},"description":"IDs of messages to update. Maximum 50 ids per request. Duplicates are\nrejected with a validation error. IDs not found in the inbox (including\ncross-inbox or permission-restricted) are silently excluded from the\nupdate; callers detect exclusions by comparing `count` against `limit`."},"BatchUpdateMessagesRequest":{"title":"BatchUpdateMessagesRequest","type":"object","properties":{"message_ids":{"$ref":"#/components/schemas/BatchUpdateMessagesMessageIds"},"add_labels":{"$ref":"#/components/schemas/UpdateMessageLabels","nullable":true,"description":"Label or labels to add to every message."},"remove_labels":{"$ref":"#/components/schemas/UpdateMessageLabels","nullable":true,"description":"Label or labels to remove from every message."}},"required":["message_ids"]},"BatchUpdateMessagesResponse":{"title":"BatchUpdateMessagesResponse","type":"object","properties":{"limit":{"$ref":"#/components/schemas/Limit"},"count":{"$ref":"#/components/schemas/Count"},"updates":{"type":"array","items":{"$ref":"#/components/schemas/UpdateMessageResponse"},"description":"Updated messages with their new labels. Order matches `message_ids`\nin the request. Excluded ids are omitted, so `count` may be less than\n`limit`."}},"required":["limit","count","updates"]},"RawMessageResponse":{"title":"RawMessageResponse","type":"object","description":"S3 presigned URL to download the raw .eml file.","properties":{"message_id":{"$ref":"#/components/schemas/MessageId","description":"ID of the message."},"size":{"$ref":"#/components/schemas/MessageSize","description":"Size of the raw message in bytes."},"download_url":{"type":"string","description":"S3 presigned URL to download the raw message. Expires at expires_at."},"expires_at":{"type":"string","format":"date-time","description":"Time at which the download URL expires."}},"required":["message_id","size","download_url","expires_at"]},"Addresses":{"title":"Addresses","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"SendMessageReplyTo":{"title":"SendMessageReplyTo","$ref":"#/components/schemas/Addresses","description":"Reply-to address or addresses."},"SendMessageTo":{"title":"SendMessageTo","$ref":"#/components/schemas/Addresses","description":"Recipient address or addresses."},"SendMessageCc":{"title":"SendMessageCc","$ref":"#/components/schemas/Addresses","description":"CC recipient address or addresses."},"SendMessageBcc":{"title":"SendMessageBcc","$ref":"#/components/schemas/Addresses","description":"BCC recipient address or addresses."},"SendMessageAttachments":{"title":"SendMessageAttachments","type":"array","items":{"$ref":"#/components/schemas/SendAttachment"},"description":"Attachments to include in message."},"SendMessageHeaders":{"title":"SendMessageHeaders","type":"object","additionalProperties":{"type":"string"},"description":"Headers to include in message."},"TrackOpens":{"title":"TrackOpens","type":"boolean","description":"Track when this message is first opened. Requires a custom domain with tracking enabled and\nan HTML body. Opens surface as the `opened` label on the message and as a `message.opened`\nevent. One pixel is injected per message, not per recipient, so a message with several\nrecipients fires once when any of them opens it, and the event does not identify which one."},"SendMessageRequest":{"title":"SendMessageRequest","type":"object","properties":{"labels":{"$ref":"#/components/schemas/MessageLabels","nullable":true},"reply_to":{"$ref":"#/components/schemas/SendMessageReplyTo","nullable":true},"to":{"$ref":"#/components/schemas/SendMessageTo","nullable":true},"cc":{"$ref":"#/components/schemas/SendMessageCc","nullable":true},"bcc":{"$ref":"#/components/schemas/SendMessageBcc","nullable":true},"subject":{"$ref":"#/components/schemas/MessageSubject","nullable":true},"text":{"$ref":"#/components/schemas/MessageText","nullable":true},"html":{"$ref":"#/components/schemas/MessageHtml","nullable":true},"attachments":{"$ref":"#/components/schemas/SendMessageAttachments","nullable":true},"headers":{"$ref":"#/components/schemas/SendMessageHeaders","nullable":true},"track_opens":{"$ref":"#/components/schemas/TrackOpens","nullable":true}}},"SendMessageResponse":{"title":"SendMessageResponse","type":"object","properties":{"message_id":{"$ref":"#/components/schemas/MessageId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"}},"required":["message_id","thread_id"]},"UpdateMessageResponse":{"title":"UpdateMessageResponse","type":"object","properties":{"message_id":{"$ref":"#/components/schemas/MessageId"},"labels":{"$ref":"#/components/schemas/MessageLabels"}},"required":["message_id","labels"]},"ReplyAll":{"title":"ReplyAll","type":"boolean","description":"Reply to all recipients of the original message."},"ReplyToMessageRequest":{"title":"ReplyToMessageRequest","type":"object","properties":{"labels":{"$ref":"#/components/schemas/MessageLabels","nullable":true},"reply_to":{"$ref":"#/components/schemas/SendMessageReplyTo","nullable":true},"to":{"$ref":"#/components/schemas/SendMessageTo","nullable":true},"cc":{"$ref":"#/components/schemas/SendMessageCc","nullable":true},"bcc":{"$ref":"#/components/schemas/SendMessageBcc","nullable":true},"reply_all":{"$ref":"#/components/schemas/ReplyAll","nullable":true},"text":{"$ref":"#/components/schemas/MessageText","nullable":true},"html":{"$ref":"#/components/schemas/MessageHtml","nullable":true},"attachments":{"$ref":"#/components/schemas/SendMessageAttachments","nullable":true},"headers":{"$ref":"#/components/schemas/SendMessageHeaders","nullable":true},"track_opens":{"$ref":"#/components/schemas/TrackOpens","nullable":true}}},"ReplyAllMessageRequest":{"title":"ReplyAllMessageRequest","type":"object","properties":{"labels":{"$ref":"#/components/schemas/MessageLabels","nullable":true},"reply_to":{"$ref":"#/components/schemas/SendMessageReplyTo","nullable":true},"text":{"$ref":"#/components/schemas/MessageText","nullable":true},"html":{"$ref":"#/components/schemas/MessageHtml","nullable":true},"attachments":{"$ref":"#/components/schemas/SendMessageAttachments","nullable":true},"headers":{"$ref":"#/components/schemas/SendMessageHeaders","nullable":true},"track_opens":{"$ref":"#/components/schemas/TrackOpens","nullable":true}}},"UpdateMessageLabels":{"title":"UpdateMessageLabels","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Label or list of labels."},"UpdateMessageRequest":{"title":"UpdateMessageRequest","type":"object","properties":{"add_labels":{"$ref":"#/components/schemas/UpdateMessageLabels","nullable":true,"description":"Label or labels to add to message."},"remove_labels":{"$ref":"#/components/schemas/UpdateMessageLabels","nullable":true,"description":"Label or labels to remove from message."}}},"MetricEventType":{"title":"MetricEventType","type":"string","enum":["message.received","message.received.spam","message.received.blocked","message.received.unauthenticated","message.sent","message.delivered","message.bounced","message.complained","message.rejected","domain.verified"],"description":"Type of metric event."},"MetricEventTypes":{"title":"MetricEventTypes","type":"array","items":{"$ref":"#/components/schemas/MetricEventType"},"description":"List of metric event types to query."},"Start":{"title":"Start","type":"string","format":"date-time","description":"Start timestamp for the query."},"End":{"title":"End","type":"string","format":"date-time","description":"End timestamp for the query."},"Period":{"title":"Period","type":"integer","description":"Size of each time bucket as a whole number of seconds, between 1 and 86400."},"MetricLimit":{"title":"MetricLimit","type":"integer","description":"Limit on number of buckets to return."},"Descending":{"title":"Descending","type":"boolean","description":"Sort in descending order."},"MetricBucket":{"title":"MetricBucket","type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"Timestamp of the bucket."},"count":{"type":"integer","description":"Count of events in the bucket."}},"required":["timestamp","count"]},"QueryMetricsResponse":{"title":"QueryMetricsResponse","type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/MetricBucket"}},"description":"Metrics grouped by event type."},"UsageType":{"title":"UsageType","type":"string","enum":["storage_bytes","message_count","thread_count","inbox_count","pod_count","domain_count"],"description":"Type of usage metric. Inbox-scoped queries carry `storage_bytes`,\n`message_count`, and `thread_count`; pod-scoped queries add `inbox_count`\nand `domain_count`; organization-scoped queries add `pod_count`."},"UsageTypes":{"title":"UsageTypes","type":"array","items":{"$ref":"#/components/schemas/UsageType"},"description":"List of usage metric types to query. Omit to query every type valid for the scope."},"UsagePoint":{"title":"UsagePoint","type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"Timestamp of the point."},"value":{"type":"integer","format":"int64","description":"Cumulative value of the usage metric at the timestamp."}},"required":["timestamp","value"]},"QueryUsageResponse":{"title":"QueryUsageResponse","type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/UsagePoint"}},"description":"Cumulative usage series grouped by usage type."},"Organization":{"title":"Organization","type":"object","description":"Organization details with usage limits and counts.","properties":{"organization_id":{"$ref":"#/components/schemas/OrganizationId"},"inbox_count":{"type":"integer","description":"Current number of inboxes."},"domain_count":{"type":"integer","description":"Current number of domains."},"inbox_limit":{"type":"integer","nullable":true,"description":"Maximum number of inboxes allowed."},"domain_limit":{"type":"integer","nullable":true,"description":"Maximum number of domains allowed."},"billing_id":{"type":"string","nullable":true,"description":"Provider-agnostic billing customer ID."},"billing_type":{"type":"string","nullable":true,"description":"Billing provider type (e.g. \"stripe\")."},"billing_subscription_id":{"type":"string","nullable":true,"description":"Active billing subscription ID."},"authentication_id":{"type":"string","nullable":true,"description":"Provider-agnostic authentication ID."},"authentication_type":{"type":"string","nullable":true,"description":"Authentication provider type."},"updated_at":{"type":"string","format":"date-time","description":"Time at which organization was last updated."},"created_at":{"type":"string","format":"date-time","description":"Time at which organization was created."}},"required":["organization_id","inbox_count","domain_count","updated_at","created_at"]},"Provider":{"title":"Provider","type":"object","description":"A provider an inbox can sign in to.","properties":{"provider_id":{"$ref":"#/components/schemas/ProviderId"},"name":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Time at which provider was last updated."},"description":{"type":"string","nullable":true},"logo_url":{"type":"string","nullable":true},"terms_url":{"type":"string","nullable":true},"privacy_url":{"type":"string","nullable":true}},"required":["provider_id"]},"ListProvidersResponse":{"title":"ListProvidersResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"providers":{"type":"array","items":{"$ref":"#/components/schemas/Provider"}}},"required":["count","limit","providers"]},"SearchProvidersResponse":{"title":"SearchProvidersResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"providers":{"type":"array","items":{"$ref":"#/components/schemas/Provider"}}},"required":["count","limit","providers"]},"ListProviderAccountsResponse":{"title":"ListProviderAccountsResponse","type":"object","properties":{"provider":{"$ref":"#/components/schemas/Provider","nullable":true},"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}},"required":["count","limit","accounts"]},"ConnectInboxId":{"title":"ConnectInboxId","$ref":"#/components/schemas/inboxesInboxId","description":"Inbox to sign in as. Required unless the API key is scoped to an inbox."},"ConnectProviderBody":{"title":"ConnectProviderBody","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/ConnectInboxId","nullable":true},"accept_disclosure":{"$ref":"#/components/schemas/AcceptDisclosure","nullable":true}}},"MagicUrl":{"title":"MagicUrl","type":"string","description":"Single-use URL to open in the client that will hold the key."},"ConnectAccepted":{"title":"ConnectAccepted","type":"object","description":"The pending sign-in key the client will activate. Poll Get API Key with `api_key_id` for `status`.","properties":{"api_key_id":{"$ref":"#/components/schemas/ApiKeyId"},"magic_url":{"$ref":"#/components/schemas/MagicUrl"},"expires_at":{"$ref":"#/components/schemas/ExpiresAt"}},"required":["api_key_id","magic_url","expires_at"]},"ThreadId":{"title":"ThreadId","type":"string","description":"ID of thread."},"ThreadLabels":{"title":"ThreadLabels","type":"array","items":{"type":"string"},"description":"Labels of thread."},"ThreadTimestamp":{"title":"ThreadTimestamp","type":"string","format":"date-time","description":"Timestamp of last sent or received message."},"ThreadReceivedTimestamp":{"title":"ThreadReceivedTimestamp","type":"string","format":"date-time","description":"Timestamp of last received message."},"ThreadSentTimestamp":{"title":"ThreadSentTimestamp","type":"string","format":"date-time","description":"Timestamp of last sent message."},"ThreadSenders":{"title":"ThreadSenders","type":"array","items":{"type":"string"},"description":"Senders in thread. In format `username@domain.com` or `Display Name `."},"ThreadRecipients":{"title":"ThreadRecipients","type":"array","items":{"type":"string"},"description":"Recipients in thread. In format `username@domain.com` or `Display Name `."},"ThreadSubject":{"title":"ThreadSubject","type":"string","description":"Subject of thread."},"ThreadPreview":{"title":"ThreadPreview","type":"string","description":"Text preview of last message in thread."},"ThreadAttachments":{"title":"ThreadAttachments","type":"array","items":{"$ref":"#/components/schemas/Attachment"},"description":"Attachments in thread."},"ThreadLastMessageId":{"title":"ThreadLastMessageId","type":"string","description":"ID of last message in thread."},"ThreadMessageCount":{"title":"ThreadMessageCount","type":"integer","description":"Number of messages in thread."},"ThreadSize":{"title":"ThreadSize","type":"integer","description":"Size of thread in bytes."},"ThreadUpdatedAt":{"title":"ThreadUpdatedAt","type":"string","format":"date-time","description":"Time at which thread was last updated."},"ThreadCreatedAt":{"title":"ThreadCreatedAt","type":"string","format":"date-time","description":"Time at which thread was created."},"ThreadItem":{"title":"ThreadItem","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"labels":{"$ref":"#/components/schemas/ThreadLabels"},"timestamp":{"$ref":"#/components/schemas/ThreadTimestamp"},"received_timestamp":{"$ref":"#/components/schemas/ThreadReceivedTimestamp","nullable":true},"sent_timestamp":{"$ref":"#/components/schemas/ThreadSentTimestamp","nullable":true},"senders":{"$ref":"#/components/schemas/ThreadSenders"},"recipients":{"$ref":"#/components/schemas/ThreadRecipients"},"subject":{"$ref":"#/components/schemas/ThreadSubject","nullable":true},"preview":{"$ref":"#/components/schemas/ThreadPreview","nullable":true},"attachments":{"$ref":"#/components/schemas/ThreadAttachments","nullable":true},"last_message_id":{"$ref":"#/components/schemas/ThreadLastMessageId"},"message_count":{"$ref":"#/components/schemas/ThreadMessageCount"},"size":{"$ref":"#/components/schemas/ThreadSize"},"updated_at":{"$ref":"#/components/schemas/ThreadUpdatedAt"},"created_at":{"$ref":"#/components/schemas/ThreadCreatedAt"}},"required":["inbox_id","thread_id","labels","timestamp","senders","recipients","last_message_id","message_count","size","updated_at","created_at"]},"Thread":{"title":"Thread","type":"object","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"thread_id":{"$ref":"#/components/schemas/ThreadId"},"labels":{"$ref":"#/components/schemas/ThreadLabels"},"timestamp":{"$ref":"#/components/schemas/ThreadTimestamp"},"received_timestamp":{"$ref":"#/components/schemas/ThreadReceivedTimestamp","nullable":true},"sent_timestamp":{"$ref":"#/components/schemas/ThreadSentTimestamp","nullable":true},"senders":{"$ref":"#/components/schemas/ThreadSenders"},"recipients":{"$ref":"#/components/schemas/ThreadRecipients"},"subject":{"$ref":"#/components/schemas/ThreadSubject","nullable":true},"preview":{"$ref":"#/components/schemas/ThreadPreview","nullable":true},"attachments":{"$ref":"#/components/schemas/ThreadAttachments","nullable":true},"last_message_id":{"$ref":"#/components/schemas/ThreadLastMessageId"},"message_count":{"$ref":"#/components/schemas/ThreadMessageCount"},"size":{"$ref":"#/components/schemas/ThreadSize"},"updated_at":{"$ref":"#/components/schemas/ThreadUpdatedAt"},"created_at":{"$ref":"#/components/schemas/ThreadCreatedAt"},"count":{"$ref":"#/components/schemas/Count","description":"Number of messages in this response page."},"limit":{"$ref":"#/components/schemas/Limit","nullable":true,"description":"Maximum number of messages requested for this page."},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true,"description":"Token for the next, older page of messages. Omitted when this page completes the thread."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"},"description":"Messages in this page, ordered by `timestamp` ascending. The first page contains the newest messages; follow `next_page_token` to retrieve older pages."}},"required":["inbox_id","thread_id","labels","timestamp","senders","recipients","last_message_id","message_count","size","updated_at","created_at","count","messages"]},"UpdateThreadRequest":{"title":"UpdateThreadRequest","type":"object","properties":{"add_labels":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Labels to add to thread. Cannot be system labels."},"remove_labels":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Labels to remove from thread. Cannot be system labels. Takes priority over `add_labels` (in the event of duplicate labels passed in)."}}},"UpdateThreadResponse":{"title":"UpdateThreadResponse","type":"object","properties":{"thread_id":{"$ref":"#/components/schemas/ThreadId"},"labels":{"$ref":"#/components/schemas/ThreadLabels"}},"required":["thread_id","labels"]},"ListThreadsResponse":{"title":"ListThreadsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"threads":{"type":"array","items":{"$ref":"#/components/schemas/ThreadItem"},"description":"Ordered by `timestamp` descending."}},"required":["count","threads"]},"SearchThreadHighlights":{"title":"SearchThreadHighlights","type":"object","description":"Matched fragments per field on a thread search result, with matched terms\nwrapped in `**`. A field key is present only when the query matched that\nfield, so the present keys also tell you which fields produced the hit.","properties":{"from":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from a sender address in the thread."},"recipients":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from a recipient address in the thread (to, cc, or bcc)."},"subject":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from the subject."},"text":{"type":"array","items":{"type":"string"},"nullable":true,"description":"Matched fragments from a message body in the thread."}}},"SearchThreadItem":{"title":"SearchThreadItem","type":"object","properties":{"highlights":{"$ref":"#/components/schemas/SearchThreadHighlights","nullable":true,"description":"Matched fragments per field. Present only when the query matched an indexed field."}},"allOf":[{"$ref":"#/components/schemas/ThreadItem"}]},"SearchThreadsResponse":{"title":"SearchThreadsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit","nullable":true},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"threads":{"type":"array","items":{"$ref":"#/components/schemas/SearchThreadItem"},"description":"Ordered by relevance, best match first."}},"required":["count","threads"]},"webhooksSvixId":{"title":"webhooksSvixId","type":"string","description":"ID of webhook message."},"webhooksSvixTimestamp":{"title":"webhooksSvixTimestamp","type":"string","format":"date-time","description":"Timestamp of webhook message."},"webhooksSvixSignature":{"title":"webhooksSvixSignature","type":"string","description":"Signature of webhook message."},"Subscribe":{"title":"Subscribe","type":"object","properties":{"type":{"type":"string","const":"subscribe"},"event_types":{"$ref":"#/components/schemas/EventTypes","nullable":true},"inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true},"pod_ids":{"$ref":"#/components/schemas/PodIds","nullable":true}},"required":["type"]},"Subscribed":{"title":"Subscribed","type":"object","properties":{"type":{"type":"string","const":"subscribed"},"event_types":{"$ref":"#/components/schemas/EventTypes","nullable":true},"inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true},"pod_ids":{"$ref":"#/components/schemas/PodIds","nullable":true}},"required":["type"]},"Error":{"title":"Error","type":"object","properties":{"type":{"type":"string","const":"error"},"name":{"$ref":"#/components/schemas/ErrorName"},"message":{"$ref":"#/components/schemas/ErrorMessage"}},"required":["type","name","message"]}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}}} \ No newline at end of file diff --git a/cli/agentmail/sdk.rs b/cli/agentmail/sdk.rs index 591bb17..27c0e1b 100644 --- a/cli/agentmail/sdk.rs +++ b/cli/agentmail/sdk.rs @@ -65,7 +65,6 @@ pub fn client(ctx: &AppContext) -> agentmail_sdk::api::ApiClient { inboxes: agentmail_sdk::api::InboxesClient { http_client: http_client.clone(), api_keys: agentmail_sdk::api::resources::inboxes::ApiKeysClient2 { http_client: http_client.clone() }, - browser_credentials: agentmail_sdk::api::resources::inboxes::BrowserCredentialsClient { http_client: http_client.clone() }, drafts: agentmail_sdk::api::resources::inboxes::DraftsClient2 { http_client: http_client.clone() }, events: agentmail_sdk::api::resources::inboxes::EventsClient { http_client: http_client.clone() }, lists: agentmail_sdk::api::resources::inboxes::ListsClient2 { http_client: http_client.clone() }, diff --git a/reference.md b/reference.md index 5ff6b1e..4aef57b 100644 --- a/reference.md +++ b/reference.md @@ -12,7 +12,6 @@ Full command reference for `agentmail`. - [`agentmail drafts`](#agentmail-drafts) - [`agentmail inboxes`](#agentmail-inboxes) - [`agentmail inboxes api-keys`](#agentmail-inboxes-api-keys) -- [`agentmail inboxes browser-credentials`](#agentmail-inboxes-browser-credentials) - [`agentmail inboxes drafts`](#agentmail-inboxes-drafts) - [`agentmail inboxes events`](#agentmail-inboxes-events) - [`agentmail inboxes lists`](#agentmail-inboxes-lists) @@ -110,18 +109,11 @@ agentmail agent verify --otp-code 123456 ### `agentmail api-keys` -#### `agentmail api-keys cancel-browser-enrollment` - -Cancel one pending, unexpired browser enrollment intent. Requires `api_key_delete`. - -`DELETE /v0/api-keys/browser-credentials/enrollments/{enrollment_id}` - -| Flag | Type | Required | Description | -|------|------|----------|-------------| -| `--enrollment-id` | `string (uuid)` | Yes | | - #### `agentmail api-keys create` +Creates a bearer key, or registers a public key when the body carries +`public_key`. The route selects the scope. Bearer secrets are returned once. + **CLI:** ```bash agentmail api-keys create --name "My Key" @@ -133,21 +125,11 @@ agentmail api-keys create --name "My Key" |------|------|----------|-------------| | `--json` | `JSON` | Yes | Request body as JSON (or use individual body-field flags) | -#### `agentmail api-keys create-public-key` - -Register a public P-256 JWK using an existing AgentMail bearer API key -with `api_key_create`. Re-registering the same JWK creates a new -credential ID; it does not replace or recover an earlier credential. -The private key must never be sent to AgentMail. - -`POST /v0/api-keys/public-keys` - -| Flag | Type | Required | Description | -|------|------|----------|-------------| -| `--json` | `JSON` | Yes | Request body as JSON (or use individual body-field flags) | - #### `agentmail api-keys delete` +Deletes one credential of any family. A pending sign-in key is +cancelled; an active one is revoked. Public keys also resolve by `client_id`. + **CLI:** ```bash agentmail api-keys delete --api-key-id @@ -159,28 +141,23 @@ agentmail api-keys delete --api-key-id |------|------|----------|-------------| | `--api-key-id` | `ApiKeyId` | Yes | | -#### `agentmail api-keys delete-browser-consent` +#### `agentmail api-keys get` -Revoke one remembered AgentID client approval. Requires `api_key_delete`. +Returns one credential of any family. Public keys also resolve by +`client_id`. Poll a sign-in key until `status` is `active`. -`DELETE /v0/api-keys/browser-consents/{consent_id}` +`GET /v0/api-keys/{api_key_id}` | Flag | Type | Required | Description | |------|------|----------|-------------| -| `--consent-id` | `string` | Yes | | - -#### `agentmail api-keys delete-browser-credential` - -Permanently revoke one active browser credential. Requires `api_key_delete`. - -`DELETE /v0/api-keys/browser-credentials/{credential_id}` - -| Flag | Type | Required | Description | -|------|------|----------|-------------| -| `--credential-id` | `string (uuid)` | Yes | | +| `--api-key-id` | `ApiKeyId` | Yes | | #### `agentmail api-keys list` +Lists every credential, newest first. Filter one family with `type`. +Page to token exhaustion: a page can be empty and still carry a +`next_page_token`. + **CLI:** ```bash agentmail api-keys list @@ -190,98 +167,22 @@ agentmail api-keys list | Flag | Type | Required | Description | |------|------|----------|-------------| +| `--type` | `ApiKeyType` | No | Restrict the list to one credential family. Omit for every family. | | `--limit` | `Limit` | No | | | `--page-token` | `PageToken` | No | | | `--ascending` | `Ascending` | No | | -#### `agentmail api-keys list-browser-consents` - -List remembered AgentID client approvals for one live inbox. Requires `api_key_read`. - -`GET /v0/api-keys/browser-consents` - -| Flag | Type | Required | Description | -|------|------|----------|-------------| -| `--inbox-id` | `string (email)` | Yes | | -| `--limit` | `BrowserAuthorizationListLimit` | No | | -| `--page-token` | `PageToken` | No | | - -#### `agentmail api-keys list-browser-credential-events` - -List owner-facing browser credential and consent lifecycle events. Requires `api_key_read`. - -`GET /v0/api-keys/browser-credentials/events` - -| Flag | Type | Required | Description | -|------|------|----------|-------------| -| `--limit` | `BrowserAuthorizationListLimit` | No | | -| `--page-token` | `PageToken` | No | | - -#### `agentmail api-keys list-browser-credentials` - -List active browser credentials visible to the caller's scope. Requires `api_key_read`. - -`GET /v0/api-keys/browser-credentials` - -| Flag | Type | Required | Description | -|------|------|----------|-------------| -| `--limit` | `BrowserAuthorizationListLimit` | No | | -| `--page-token` | `PageToken` | No | | - -#### `agentmail api-keys list-public-keys` - -List only public-key credentials visible to the bearer caller's scope. -Bearer credentials are never returned, even though both credential types -share storage and pagination indexes. Requires `api_key_read`. - -`GET /v0/api-keys/public-keys` - -| Flag | Type | Required | Description | -|------|------|----------|-------------| -| `--limit` | `Limit` | No | | -| `--page-token` | `PageToken` | No | | -| `--ascending` | `Ascending` | No | | - -#### `agentmail api-keys revoke-all-agent-id-sign-in-keys` - -Invalidate every current public-key credential in the caller's -organization by advancing its AgentID key generation. The caller must be -organization-scoped and either have `api_key_delete` or, for a verified -self-serve agent organization, use an unrestricted unmanaged bearer -credential. No request body is accepted. - -`Idempotency-Key` is required and must be a UUID. Reusing the same UUID -returns the original permanent receipt without advancing the generation -again. A new UUID performs a new generation advance. - -`POST /v0/api-keys/public-keys/agentid-sign-in/revoke-all` - -| Flag | Type | Required | Description | -|------|------|----------|-------------| -| `--idempotency-key` | `string (uuid)` | Yes | Required UUID identifying this revoke-all operation permanently. | - -#### `agentmail api-keys revoke-public-key` - -Permanently revoke one public-key credential. This hard-deletes the -credential; repeating the request returns not found. Requires -`api_key_delete`. - -`DELETE /v0/api-keys/public-keys/{api_key_id}` - -| Flag | Type | Required | Description | -|------|------|----------|-------------| -| `--api-key-id` | `string (uuid)` | Yes | Public-key credential ID returned by registration. | - -#### `agentmail api-keys update-public-key-name` +#### `agentmail api-keys update` -Rename the credential. All security-relevant fields are immutable. -Requires `api_key_update`. +Renames a credential or changes its permissions. Public keys also resolve +by `client_id`; a sign-in key accepts only `provider_connect` and +`provider_share_owner`. -`PATCH /v0/api-keys/public-keys/{api_key_id}` +`PATCH /v0/api-keys/{api_key_id}` | Flag | Type | Required | Description | |------|------|----------|-------------| -| `--api-key-id` | `string (uuid)` | Yes | Public-key credential ID returned by registration. | +| `--api-key-id` | `ApiKeyId` | Yes | | | `--json` | `JSON` | Yes | Request body as JSON (or use individual body-field flags) | --- @@ -460,6 +361,19 @@ agentmail drafts list ### `agentmail inboxes` +#### `agentmail inboxes authorize` + +Authorizes the AgentID sign-in a client is already waiting in, for the +inbox in the path, and returns the pending public key it will activate. A +repeat for the same token, inbox, and bearer returns the same key. + +`POST /v0/inboxes/{inbox_id}/authorize` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--inbox-id` | `inboxesInboxId` | Yes | | +| `--json` | `JSON` | Yes | Request body as JSON (or use individual body-field flags) | + #### `agentmail inboxes create` **CLI:** @@ -514,6 +428,23 @@ agentmail inboxes list | `--page-token` | `PageToken` | No | | | `--ascending` | `Ascending` | No | | +#### `agentmail inboxes search` + +Searches inboxes in the organization by address or display name, ranked +by relevance. Each word in the query matches the start of a word in the +address or display name, so `sup` matches `support@example.com` but +`port` does not. An exact address match always ranks first. `limit` +cannot exceed 100. A page can be empty and still carry a +`next_page_token`; keep paging until the token is absent. + +`GET /v0/inboxes/search` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--q` | `string` | Yes | Address or display name to search for. Matches word prefixes. Must be 2 to 256 characters. | +| `--limit` | `Limit` | No | | +| `--page-token` | `PageToken` | No | | + #### `agentmail inboxes update` **CLI:** @@ -575,43 +506,19 @@ agentmail inboxes api-keys list --inbox-id | `--limit` | `Limit` | No | | | `--page-token` | `PageToken` | No | | ---- - -### `agentmail inboxes browser-credentials` - -#### `agentmail inboxes browser-credentials create-enrollment` - -Attach a browser enrollment intent to the inbox. Requires -`api_key_create`. Before submitting `transaction_jti`, independently -verify that the browser page's final origin is exactly -`https://auth.agentid.com`. +#### `agentmail inboxes api-keys update` -This endpoint is available to every organization using US production. -It is not available in EU production. - -Select `inbox_id` from trusted AgentMail configuration. An AgentID -`login_hint` is not authoritative for selecting the inbox; when the -transaction includes one, it must match the path inbox. - -**AgentMail API keys are sent only to `https://api.agentmail.to`; AgentID never requests them.** - -A new intent returns `202`; an idempotent retry for the same pending -transaction, inbox, and bearer key returns `200` with the same receipt. -An intent lasts at most five minutes. An activated credential lasts at -most 30 days and cannot outlive its authorizing bearer API key. - -Creation is limited to 20 intents per bearer API key per hour, 100 per -organization per hour, and five live unused intents per bearer API key. -Browser activation is separately limited to 20 activations per -authorizing bearer API key per UTC day. Either kind of limit can return -`429`; honor the `Retry-After` header. Cancelling an enrollment releases -its live-intent slot but does not reset the daily activation counter. +**CLI:** +```bash +agentmail inboxes api-keys update --inbox-id --api-key-id --name "Renamed" +``` -`POST /v0/inboxes/{inbox_id}/browser-credentials/enrollments` +`PATCH /v0/inboxes/{inbox_id}/api-keys/{api_key_id}` | Flag | Type | Required | Description | |------|------|----------|-------------| | `--inbox-id` | `inboxesInboxId` | Yes | | +| `--api-key-id` | `ApiKeyId` | Yes | | | `--json` | `JSON` | Yes | Request body as JSON (or use individual body-field flags) | --- @@ -1140,6 +1047,8 @@ agentmail inboxes threads get --inbox-id --thread-id |------|------|----------|-------------| | `--inbox-id` | `inboxesInboxId` | Yes | | | `--thread-id` | `ThreadId` | Yes | | +| `--limit` | `Limit` | No | Maximum number of messages to return. Cannot exceed 100. | +| `--page-token` | `PageToken` | No | Token returned by the previous response for retrieving the next, older page. | #### `agentmail inboxes threads get-attachment` @@ -1553,6 +1462,21 @@ agentmail pods api-keys list --pod-id | `--limit` | `Limit` | No | | | `--page-token` | `PageToken` | No | | +#### `agentmail pods api-keys update` + +**CLI:** +```bash +agentmail pods api-keys update --pod-id --api-key-id --name "Renamed" +``` + +`PATCH /v0/pods/{pod_id}/api-keys/{api_key_id}` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--pod-id` | `podsPodId` | Yes | | +| `--api-key-id` | `ApiKeyId` | Yes | | +| `--json` | `JSON` | Yes | Request body as JSON (or use individual body-field flags) | + --- ### `agentmail pods domains` @@ -1772,6 +1696,24 @@ agentmail pods inboxes list --pod-id | `--page-token` | `PageToken` | No | | | `--ascending` | `Ascending` | No | | +#### `agentmail pods inboxes search` + +Searches inboxes in the pod by address or display name, ranked by +relevance. Each word in the query matches the start of a word in the +address or display name, so `sup` matches `support@example.com` but +`port` does not. An exact address match always ranks first. `limit` +cannot exceed 100. A page can be empty and still carry a +`next_page_token`; keep paging until the token is absent. + +`GET /v0/pods/{pod_id}/inboxes/search` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--pod-id` | `podsPodId` | Yes | | +| `--q` | `string` | Yes | Address or display name to search for. Matches word prefixes. Must be 2 to 256 characters. | +| `--limit` | `Limit` | No | | +| `--page-token` | `PageToken` | No | | + #### `agentmail pods inboxes update` **CLI:** @@ -1940,6 +1882,8 @@ agentmail pods threads get --pod-id --thread-id |------|------|----------|-------------| | `--pod-id` | `podsPodId` | Yes | | | `--thread-id` | `ThreadId` | Yes | | +| `--limit` | `Limit` | No | Maximum number of messages to return. Cannot exceed 100. | +| `--page-token` | `PageToken` | No | Token returned by the previous response for retrieving the next, older page. | #### `agentmail pods threads get-attachment` @@ -2127,9 +2071,10 @@ pod-scoped webhook. Header values remain write-only. #### `agentmail providers connect` -Starts signing an inbox in to a provider. Returns a `magic_url` valid -for five minutes; open it in the browser that will hold the sign-in. -Requires `api_key_create` and an `Idempotency-Key` header. +Starts signing an inbox in to a provider. Returns a single-use `magic_url`, +valid for five minutes, to open in the client that will hold the sign-in; +the client enrolls as the inbox and continues to the provider. Poll +[Get API Key](/api-reference/api-keys/get) with `api_key_id` for `status`. `POST /v0/providers/{provider_id}/connect` @@ -2214,6 +2159,8 @@ agentmail threads get --thread-id | Flag | Type | Required | Description | |------|------|----------|-------------| | `--thread-id` | `ThreadId` | Yes | | +| `--limit` | `Limit` | No | Maximum number of messages to return. Cannot exceed 100. | +| `--page-token` | `PageToken` | No | Token returned by the previous response for retrieving the next, older page. | #### `agentmail threads get-attachment`