From 47a19c4567d26790a573fc0d6c5012fcfe22211d Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 6 Oct 2026 05:27:26 +0000 Subject: [PATCH 1/2] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-cli-generator: 0.38.10 --- .agents/skills/custom-commands/SKILL.md | 1 + .github/workflows/ci.yml | 10 +- Cargo.lock | 104 +-- Cargo.toml | 2 +- .../src/api/resources/agent/agent.rs | 2 +- agentmail-sdk/src/api/resources/apps/apps.rs | 30 +- .../inboxes/calendar/inboxes_calendar.rs | 744 ++++++++++++++++++ .../src/api/resources/inboxes/calendar/mod.rs | 2 + .../src/api/resources/inboxes/mod.rs | 7 + agentmail-sdk/src/error.rs | 181 ++++- .../src/types/api_key_permissions.rs | 60 ++ agentmail-types/src/types/app.rs | 20 + agentmail-types/src/types/app_category.rs | 101 +++ .../src/types/apps_list_query_request.rs | 10 + agentmail-types/src/types/attendee.rs | 89 +++ agentmail-types/src/types/attendee_role.rs | 45 ++ agentmail-types/src/types/attendee_status.rs | 53 ++ agentmail-types/src/types/calendar.rs | 98 +++ .../src/types/calendar_consistency.rs | 47 ++ agentmail-types/src/types/calendar_event.rs | 357 +++++++++ .../src/types/calendar_event_created_event.rs | 77 ++ ...calendar_event_created_event_event_type.rs | 17 + .../calendar_event_created_event_type.rs | 17 + .../src/types/calendar_event_deleted_event.rs | 77 ++ ...calendar_event_deleted_event_event_type.rs | 17 + .../calendar_event_deleted_event_type.rs | 17 + .../src/types/calendar_event_ending_event.rs | 90 +++ .../calendar_event_ending_event_event_type.rs | 17 + .../types/calendar_event_ending_event_type.rs | 17 + .../src/types/calendar_event_id.rs | 6 + .../src/types/calendar_event_kind.rs | 55 ++ .../types/calendar_event_mutation_response.rs | 46 ++ .../src/types/calendar_event_previous.rs | 136 ++++ .../types/calendar_event_responded_event.rs | 77 ++ ...lendar_event_responded_event_event_type.rs | 17 + .../calendar_event_responded_event_type.rs | 17 + .../src/types/calendar_event_source.rs | 47 ++ .../types/calendar_event_starting_event.rs | 93 +++ ...alendar_event_starting_event_event_type.rs | 17 + .../calendar_event_starting_event_type.rs | 17 + .../src/types/calendar_event_status.rs | 52 ++ .../src/types/calendar_event_updated_event.rs | 88 +++ ...calendar_event_updated_event_event_type.rs | 17 + .../calendar_event_updated_event_type.rs | 17 + agentmail-types/src/types/calendar_limit.rs | 6 + .../types/create_calendar_event_request.rs | 178 +++++ .../src/types/create_domain_request.rs | 10 + .../types/delete_calendar_event_response.rs | 56 ++ .../src/types/delete_event_query_request.rs | 47 ++ agentmail-types/src/types/deletion_id.rs | 6 + agentmail-types/src/types/domain.rs | 15 +- agentmail-types/src/types/domain_item.rs | 10 + agentmail-types/src/types/duration_mode.rs | 51 ++ agentmail-types/src/types/event_type.rs | 24 + .../src/types/get_agenda_query_request.rs | 82 ++ .../src/types/get_event_query_request.rs | 37 + agentmail-types/src/types/iana_timezone.rs | 6 + agentmail-types/src/types/inbound_enabled.rs | 6 + .../inboxes_calendar_get_query_request.rs | 37 + .../src/types/inboxes_create_inbox_request.rs | 10 + agentmail-types/src/types/inboxes_inbox.rs | 12 + .../src/types/inboxes_inbox_status.rs | 48 ++ .../src/types/inboxes_update_inbox_request.rs | 16 +- .../src/types/include_overlapping.rs | 6 + .../src/types/instance_mutation_mode.rs | 47 ++ .../types/list_calendar_events_response.rs | 68 ++ .../list_event_instances_query_request.rs | 82 ++ .../src/types/list_events_query_request.rs | 46 ++ agentmail-types/src/types/mod.rs | 128 ++- agentmail-types/src/types/operation_id.rs | 6 + .../precondition_failed_error_response.rs | 84 ++ agentmail-types/src/types/recurrence.rs | 68 ++ agentmail-types/src/types/recurrence_date.rs | 59 ++ agentmail-types/src/types/recurrence_input.rs | 68 ++ .../src/types/recurrence_period.rs | 57 ++ .../src/types/resource_revision.rs | 6 + .../types/respond_calendar_event_request.rs | 59 ++ agentmail-types/src/types/respond_status.rs | 49 ++ .../types/update_calendar_event_request.rs | 165 ++++ .../src/types/update_calendar_request.rs | 39 + .../src/types/update_domain_request.rs | 18 +- agentmail-types/src/types/wall_time.rs | 6 + agentmail-types/src/types/window_after.rs | 9 + agentmail-types/src/types/window_before.rs | 9 + cli/agentmail/openapi0.json | 2 +- cli/agentmail/sdk.rs | 1 + reference.md | 301 ++++++- 87 files changed, 4936 insertions(+), 115 deletions(-) create mode 100644 agentmail-sdk/src/api/resources/inboxes/calendar/inboxes_calendar.rs create mode 100644 agentmail-sdk/src/api/resources/inboxes/calendar/mod.rs create mode 100644 agentmail-types/src/types/app_category.rs create mode 100644 agentmail-types/src/types/attendee.rs create mode 100644 agentmail-types/src/types/attendee_role.rs create mode 100644 agentmail-types/src/types/attendee_status.rs create mode 100644 agentmail-types/src/types/calendar.rs create mode 100644 agentmail-types/src/types/calendar_consistency.rs create mode 100644 agentmail-types/src/types/calendar_event.rs create mode 100644 agentmail-types/src/types/calendar_event_created_event.rs create mode 100644 agentmail-types/src/types/calendar_event_created_event_event_type.rs create mode 100644 agentmail-types/src/types/calendar_event_created_event_type.rs create mode 100644 agentmail-types/src/types/calendar_event_deleted_event.rs create mode 100644 agentmail-types/src/types/calendar_event_deleted_event_event_type.rs create mode 100644 agentmail-types/src/types/calendar_event_deleted_event_type.rs create mode 100644 agentmail-types/src/types/calendar_event_ending_event.rs create mode 100644 agentmail-types/src/types/calendar_event_ending_event_event_type.rs create mode 100644 agentmail-types/src/types/calendar_event_ending_event_type.rs create mode 100644 agentmail-types/src/types/calendar_event_id.rs create mode 100644 agentmail-types/src/types/calendar_event_kind.rs create mode 100644 agentmail-types/src/types/calendar_event_mutation_response.rs create mode 100644 agentmail-types/src/types/calendar_event_previous.rs create mode 100644 agentmail-types/src/types/calendar_event_responded_event.rs create mode 100644 agentmail-types/src/types/calendar_event_responded_event_event_type.rs create mode 100644 agentmail-types/src/types/calendar_event_responded_event_type.rs create mode 100644 agentmail-types/src/types/calendar_event_source.rs create mode 100644 agentmail-types/src/types/calendar_event_starting_event.rs create mode 100644 agentmail-types/src/types/calendar_event_starting_event_event_type.rs create mode 100644 agentmail-types/src/types/calendar_event_starting_event_type.rs create mode 100644 agentmail-types/src/types/calendar_event_status.rs create mode 100644 agentmail-types/src/types/calendar_event_updated_event.rs create mode 100644 agentmail-types/src/types/calendar_event_updated_event_event_type.rs create mode 100644 agentmail-types/src/types/calendar_event_updated_event_type.rs create mode 100644 agentmail-types/src/types/calendar_limit.rs create mode 100644 agentmail-types/src/types/create_calendar_event_request.rs create mode 100644 agentmail-types/src/types/delete_calendar_event_response.rs create mode 100644 agentmail-types/src/types/delete_event_query_request.rs create mode 100644 agentmail-types/src/types/deletion_id.rs create mode 100644 agentmail-types/src/types/duration_mode.rs create mode 100644 agentmail-types/src/types/get_agenda_query_request.rs create mode 100644 agentmail-types/src/types/get_event_query_request.rs create mode 100644 agentmail-types/src/types/iana_timezone.rs create mode 100644 agentmail-types/src/types/inbound_enabled.rs create mode 100644 agentmail-types/src/types/inboxes_calendar_get_query_request.rs create mode 100644 agentmail-types/src/types/inboxes_inbox_status.rs create mode 100644 agentmail-types/src/types/include_overlapping.rs create mode 100644 agentmail-types/src/types/instance_mutation_mode.rs create mode 100644 agentmail-types/src/types/list_calendar_events_response.rs create mode 100644 agentmail-types/src/types/list_event_instances_query_request.rs create mode 100644 agentmail-types/src/types/list_events_query_request.rs create mode 100644 agentmail-types/src/types/operation_id.rs create mode 100644 agentmail-types/src/types/precondition_failed_error_response.rs create mode 100644 agentmail-types/src/types/recurrence.rs create mode 100644 agentmail-types/src/types/recurrence_date.rs create mode 100644 agentmail-types/src/types/recurrence_input.rs create mode 100644 agentmail-types/src/types/recurrence_period.rs create mode 100644 agentmail-types/src/types/resource_revision.rs create mode 100644 agentmail-types/src/types/respond_calendar_event_request.rs create mode 100644 agentmail-types/src/types/respond_status.rs create mode 100644 agentmail-types/src/types/update_calendar_event_request.rs create mode 100644 agentmail-types/src/types/update_calendar_request.rs create mode 100644 agentmail-types/src/types/wall_time.rs create mode 100644 agentmail-types/src/types/window_after.rs create mode 100644 agentmail-types/src/types/window_before.rs diff --git a/.agents/skills/custom-commands/SKILL.md b/.agents/skills/custom-commands/SKILL.md index 12b17de..5ced6ca 100644 --- a/.agents/skills/custom-commands/SKILL.md +++ b/.agents/skills/custom-commands/SKILL.md @@ -68,6 +68,7 @@ with the following sub-clients: | `client.inboxes` | `agentmail_sdk::api::InboxesClient` | inboxes operations | | `client.accounts` | `agentmail_sdk::api::AccountsClient2` | accounts operations | | `client.api_keys` | `agentmail_sdk::api::ApiKeysClient2` | api_keys operations | +| `client.calendar` | `agentmail_sdk::api::CalendarClient` | calendar 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/.github/workflows/ci.yml b/.github/workflows/ci.yml index f445ed1..8a25fbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,6 +112,9 @@ jobs: - rust-target: aarch64-apple-darwin runner: macos-latest npm-platform-suffix: darwin-arm64 + - rust-target: x86_64-pc-windows-msvc + runner: windows-latest + npm-platform-suffix: win32-x64 steps: - name: Checkout repo uses: actions/checkout@v6 @@ -254,7 +257,8 @@ jobs: OPTIONAL_DEPS="${OPTIONAL_DEPS}\"agentmail-cli-linux-x64\": \"${VERSION}\"," OPTIONAL_DEPS="${OPTIONAL_DEPS}\"agentmail-cli-linux-arm64\": \"${VERSION}\"," OPTIONAL_DEPS="${OPTIONAL_DEPS}\"agentmail-cli-darwin-x64\": \"${VERSION}\"," - OPTIONAL_DEPS="${OPTIONAL_DEPS}\"agentmail-cli-darwin-arm64\": \"${VERSION}\"" + OPTIONAL_DEPS="${OPTIONAL_DEPS}\"agentmail-cli-darwin-arm64\": \"${VERSION}\"," + OPTIONAL_DEPS="${OPTIONAL_DEPS}\"agentmail-cli-win32-x64\": \"${VERSION}\"" cat > "${PKG_DIR}/package.json" <, ) -> Result { self.http_client .execute_request( Method::GET, - &format!("v0/apps/{}", app_id.0), + &format!("v0/apps/{}", app_id), None, None, options, @@ -167,6 +171,7 @@ impl AppsClient { /// /// # Arguments /// + /// * `app_id` - ID of app, or the `slug` of an app in the catalog. A slug ignores case, spaces and punctuation. /// * `options` - Additional request options such as headers, timeout, etc. /// /// # Returns @@ -188,7 +193,7 @@ impl AppsClient { /// client /// .apps /// .list_accounts( - /// &AppID("app_id".to_string()), + /// &"app_id".to_string(), /// &ListAccountsQueryRequest { /// ..Default::default() /// }, @@ -199,14 +204,14 @@ impl AppsClient { /// ``` pub async fn list_accounts( &self, - app_id: &AppId, + app_id: &str, request: &ListAccountsQueryRequest, options: Option, ) -> Result { self.http_client .execute_request( Method::GET, - &format!("v0/apps/{}/accounts", app_id.0), + &format!("v0/apps/{}/accounts", app_id), None, QueryBuilder::new() .serialize("limit", request.limit.clone()) @@ -220,12 +225,15 @@ impl AppsClient { /// Starts signing an inbox in to an app. 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 app. + /// An app in the catalog can be named by its `slug`, as in + /// `POST /v0/apps/firecrawl/connect`. /// A `404` names the missing resource: `App` or `Inbox`. /// A `403` `AppSignupLimitError` means the app accepts no more sign-ups from /// your organization; sign in with an inbox that already has an account there. /// /// # Arguments /// + /// * `app_id` - ID of app, or the `slug` of an app in the catalog. A slug ignores case, spaces and punctuation. /// * `options` - Additional request options such as headers, timeout, etc. /// /// # Returns @@ -247,7 +255,7 @@ impl AppsClient { /// client /// .apps /// .connect( - /// &AppID("app_id".to_string()), + /// &"app_id".to_string(), /// &ConnectAppBody { /// ..Default::default() /// }, @@ -258,14 +266,14 @@ impl AppsClient { /// ``` pub async fn connect( &self, - app_id: &AppId, + app_id: &str, request: &ConnectAppBody, options: Option, ) -> Result { self.http_client .execute_request( Method::POST, - &format!("v0/apps/{}/connect", app_id.0), + &format!("v0/apps/{}/connect", app_id), Some(serde_json::to_value(request).map_err(ApiError::Serialization)?), None, options, diff --git a/agentmail-sdk/src/api/resources/inboxes/calendar/inboxes_calendar.rs b/agentmail-sdk/src/api/resources/inboxes/calendar/inboxes_calendar.rs new file mode 100644 index 0000000..85ddc3d --- /dev/null +++ b/agentmail-sdk/src/api/resources/inboxes/calendar/inboxes_calendar.rs @@ -0,0 +1,744 @@ +use crate::api::*; +use crate::{ApiError, ClientConfig, HttpClient, QueryBuilder, RequestOptions}; +use reqwest::Method; + +pub struct CalendarClient { + pub http_client: HttpClient, +} + +impl CalendarClient { + pub fn new(config: ClientConfig) -> Result { + Ok(Self { + http_client: HttpClient::new(config.clone())?, + }) + } + + /// Gets the inbox's calendar. Every inbox has one calendar, so this works before any event is + /// created. Its `etag` (also the `ETag` response header) is the value to send in `If-Match` to + /// make an update conditional. + /// + /// Requires the `calendar_read` permission. Calendar is in private beta: organizations without + /// access receive a `403`. + /// + /// # 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 + /// .calendar + /// .get( + /// &InboxesInboxID("inbox_id".to_string()), + /// &InboxesCalendarGetQueryRequest { + /// ..Default::default() + /// }, + /// None, + /// ) + /// .await; + /// } + /// ``` + pub async fn get( + &self, + inbox_id: &InboxesInboxId, + request: &InboxesCalendarGetQueryRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::GET, + &format!("v0/inboxes/{}/calendar", inbox_id.0), + None, + QueryBuilder::new() + .serialize("consistency", request.consistency.clone()) + .build(), + options, + ) + .await + } + + /// Updates the calendar's default time zone. Existing events keep their own `timezone`; only + /// events created later without a `timezone` use the new default. + /// + /// Requires the `calendar_update` permission. To make the update conditional, send the + /// calendar's current `etag` in `If-Match`: a stale value returns `412`. Without `If-Match` the + /// update applies to the calendar as it is. + /// + /// Calendar is in private beta: organizations without access receive a `403`. + /// + /// # 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 + /// .calendar + /// .update( + /// &InboxesInboxID("inbox_id".to_string()), + /// &UpdateCalendarRequest { + /// timezone: IanaTimezone("America/New_York".to_string()), + /// }, + /// Some(RequestOptions::new().additional_header("If-Match", "\"rv-0\"")), + /// ) + /// .await; + /// } + /// ``` + pub async fn update( + &self, + inbox_id: &InboxesInboxId, + request: &UpdateCalendarRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::PATCH, + &format!("v0/inboxes/{}/calendar", inbox_id.0), + Some(serde_json::to_value(request).map_err(ApiError::Serialization)?), + None, + options, + ) + .await + } + + /// Lists the events stored on the calendar: one item per one-off or recurring event, plus one + /// item for each edited date of a recurring event (as that dated event, with + /// `is_exception: true`). Ordered by most recently updated, and cancelled events are included. + /// Use it to sync or manage what you created. To see what is on the calendar in a time window, + /// use Get Agenda. + /// + /// The list is always read in the region that serves the request, so it can trail a change made + /// moments earlier by a few seconds. Requires the `calendar_event_read` permission. + /// + /// Calendar is in private beta: organizations without access receive a `403`. + /// + /// # 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 + /// .calendar + /// .list_events( + /// &InboxesInboxID("inbox_id".to_string()), + /// &ListEventsQueryRequest { + /// ..Default::default() + /// }, + /// None, + /// ) + /// .await; + /// } + /// ``` + pub async fn list_events( + &self, + inbox_id: &InboxesInboxId, + request: &ListEventsQueryRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::GET, + &format!("v0/inboxes/{}/calendar/events", inbox_id.0), + None, + QueryBuilder::new() + .serialize("limit", request.limit.clone()) + .serialize("page_token", request.page_token.clone()) + .build(), + options, + ) + .await + } + + /// Creates a one-off or recurring event on the inbox's calendar. Times are wall-clock values in + /// `timezone` (the calendar's default time zone if omitted); the response also gives each + /// boundary as a UTC instant in `start_at` and `end_at`. + /// + /// `calendar.event.created` is sent once the event is stored, then `calendar.event.starting` + /// and `calendar.event.ending` as each date begins and ends. With `send_invites: true` the + /// inbox also emails an invitation to every attendee. + /// + /// Pass `client_id` to make retries safe: repeating the request with the same `client_id` and + /// body returns the original event with status `200` instead of `201`, for as long as the event + /// exists. + /// + /// With `send_invites: true`, each attendee counts as one send against the organization, pod + /// and inbox send limits, charged before the event is stored. An over-limit request returns + /// `429` `rate_limit_exceeded` and creates nothing. A replay of an earlier create is not + /// charged again. + /// + /// The event's `etag` is the value to send in `If-Match` to make a later update or delete + /// conditional. Requires the `calendar_event_create` permission. + /// + /// Calendar is in private beta: organizations without access receive a `403`. + /// + /// # 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 + /// .calendar + /// .create_event( + /// &InboxesInboxID("inbox_id".to_string()), + /// &CreateCalendarEventRequest { + /// client_id: Some("intro-acme-2026-10-15".to_string()), + /// title: "Intro call with Acme".to_string(), + /// description: Some("Walk Jane through the onboarding plan.".to_string()), + /// location: Some("https://meet.example.com/acme-intro".to_string()), + /// metadata: Some(serde_json::json!({"crm_deal_id":"D-1042"})), + /// start: WallTime("2026-10-15T14:00:00".to_string()), + /// end: WallTime("2026-10-15T14:30:00".to_string()), + /// timezone: Some(IanaTimezone("America/New_York".to_string())), + /// attendees: Some(vec![Attendee { + /// email: "jane@acme.com".to_string(), + /// name: Some("Jane Doe".to_string()), + /// ..Default::default() + /// }]), + /// send_invites: Some(true), + /// status: None, + /// all_day: None, + /// duration_mode: None, + /// recurrence: None, + /// }, + /// None, + /// ) + /// .await; + /// } + /// ``` + pub async fn create_event( + &self, + inbox_id: &InboxesInboxId, + request: &CreateCalendarEventRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::POST, + &format!("v0/inboxes/{}/calendar/events", inbox_id.0), + Some(serde_json::to_value(request).map_err(ApiError::Serialization)?), + None, + options, + ) + .await + } + + /// Lists every date on the calendar in a time window, ordered by start time: one-off events, + /// and recurring events expanded into their individual dates, with cancelled dates left out. + /// Use it to answer "what is on the calendar". + /// + /// The window defaults to now through 90 days from now and can be at most 366 days. Items omit + /// `description`, `metadata` and `attendees`; get an event by ID for the full object. Dates of + /// recurring events appear only up to about 90 days from now; use List Event Instances for a + /// recurring event's later dates. While a recurring event's dates are being regenerated after a + /// schedule change, which takes a few seconds, the agenda can briefly leave out some of them; + /// dates that have already started or ended stay as they ran. + /// + /// The agenda is read in the region that serves the request, so it can trail a change made + /// moments earlier by a few seconds. Pass `consistency=primary` to read your own change right + /// away. Requires the `calendar_event_read` permission. + /// + /// Calendar is in private beta: organizations without access receive a `403`. + /// + /// # 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 + /// .calendar + /// .get_agenda( + /// &InboxesInboxID("inbox_id".to_string()), + /// &GetAgendaQueryRequest { + /// ..Default::default() + /// }, + /// None, + /// ) + /// .await; + /// } + /// ``` + pub async fn get_agenda( + &self, + inbox_id: &InboxesInboxId, + request: &GetAgendaQueryRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::GET, + &format!("v0/inboxes/{}/calendar/agenda", inbox_id.0), + None, + QueryBuilder::new() + .serialize("consistency", request.consistency.clone()) + .serialize("after", request.after.clone()) + .serialize("before", request.before.clone()) + .serialize("include_overlapping", request.include_overlapping.clone()) + .serialize("limit", request.limit.clone()) + .serialize("page_token", request.page_token.clone()) + .build(), + options, + ) + .await + } + + /// Gets an event by its UUID, or one date of a recurring event by its dated ID + /// (`_`). A dated ID returns the date as it currently stands, including any edit + /// to it, with `kind: instance`. + /// + /// The response's `etag` (also the `ETag` header) is the value to send in `If-Match` to make an + /// update, delete or response to this event or date conditional. Treat it as opaque. + /// + /// Reads can trail a change made moments earlier by a few seconds; pass `consistency=primary` + /// to read the latest state of an event or a date. A date that has already started or ended + /// reads back as it ran, even if a later change to the series no longer produces it. Requires + /// the `calendar_event_read` permission. + /// + /// Calendar is in private beta: organizations without access receive a `403`. + /// + /// # 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 + /// .calendar + /// .get_event( + /// &InboxesInboxID("inbox_id".to_string()), + /// &CalendarEventID("event_id".to_string()), + /// &GetEventQueryRequest { + /// ..Default::default() + /// }, + /// None, + /// ) + /// .await; + /// } + /// ``` + pub async fn get_event( + &self, + inbox_id: &InboxesInboxId, + event_id: &CalendarEventId, + request: &GetEventQueryRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::GET, + &format!("v0/inboxes/{}/calendar/events/{}", inbox_id.0, event_id.0), + None, + QueryBuilder::new() + .serialize("consistency", request.consistency.clone()) + .build(), + options, + ) + .await + } + + /// Deletes an event, or cancels dates of a recurring event. + /// + /// - **One-off or series UUID:** deletes the event and every date of it. The event disappears + /// from reads immediately and is removed in the background; the response is `202` with a + /// `deletion_id`. A retry returns the same `deletion_id` while removal runs (send the same + /// `Idempotency-Key`, or none and the same `send_invites`); once it has finished, the event + /// no longer exists and a retry returns `404`. No `calendar.event.starting` or + /// `calendar.event.ending` webhook is sent for the event after the delete is accepted. + /// - **Dated ID (`_`):** cancels that date (`mode=single`, the default) or that date + /// and every later date (`mode=future`). Returns `202` with the cancelled date. A `mode=future` + /// delete from the first date deletes the whole series and returns a `deletion_id` instead. + /// A date that is already running still gets its `calendar.event.ending`. + /// + /// Deleting a one-off or series event sends `calendar.event.deleted`. Cancelling dates sends + /// `calendar.event.updated` with the cancelled date. With `send_invites=true` the organizer + /// inbox also emails a cancellation to every attendee. Requires the `calendar_event_delete` + /// permission. To make the delete conditional, send the current `etag` in `If-Match`. + /// + /// Emailing cancellations counts one send per attendee against the organization, pod and inbox + /// send limits, charged before the delete; an over-limit request returns `429` + /// `rate_limit_exceeded` and deletes nothing. + /// + /// Calendar is in private beta: organizations without access receive a `403`. + /// + /// # Arguments + /// + /// * `send_invites` - When `true`, emails a cancellation (iCalendar `CANCEL`) to every attendee. Only the organizer can send. Defaults to `false`. + /// * `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 + /// .calendar + /// .delete_event( + /// &InboxesInboxID("inbox_id".to_string()), + /// &CalendarEventID("event_id".to_string()), + /// &DeleteEventQueryRequest { + /// ..Default::default() + /// }, + /// Some( + /// RequestOptions::new() + /// .additional_header("If-Match", "\"rv-1\"") + /// .additional_header("Idempotency-Key", "delete-intro-acme"), + /// ), + /// ) + /// .await; + /// } + /// ``` + pub async fn delete_event( + &self, + inbox_id: &InboxesInboxId, + event_id: &CalendarEventId, + request: &DeleteEventQueryRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::DELETE, + &format!("v0/inboxes/{}/calendar/events/{}", inbox_id.0, event_id.0), + None, + QueryBuilder::new() + .serialize("mode", request.mode.clone()) + .serialize("send_invites", request.send_invites.clone()) + .build(), + options, + ) + .await + } + + /// Updates an event. Send only the fields to change. To make the update conditional, send the + /// event's current `etag` in `If-Match`: a stale value returns `412`. Without `If-Match` the + /// update applies to the event as it is; a change that lands while it runs returns `409` + /// `race_condition`, so retry. Send `If-Match` when replacing `attendees`, so you don't + /// overwrite a response that arrived in the meantime. + /// + /// - **One-off or series UUID:** changes the event itself. For a series, the change applies to + /// every date that has not been edited individually. + /// - **Dated ID (`_`):** changes one date (`mode=single`, the default) or that date + /// and every later date (`mode=future`). `all_day`, `timezone` and `recurrence` cannot be sent + /// for a dated ID. + /// + /// Once a date has started, its start can no longer change (409 `event_already_started`), but + /// its end and status can; for a one-off or series UUID, send the unchanged `start` with the new + /// `end`. Once it has ended, only `title`, `description`, `location`, + /// `metadata` and `attendees` can change. During the few seconds a date is starting, schedule + /// changes return 409 `event_starting`; retry shortly. + /// + /// Sends `calendar.event.updated`. With `send_invites: true` the organizer inbox also emails the + /// updated invitation to every attendee. Requires the `calendar_event_update` permission. + /// + /// Emailing attendees counts one send per attendee against the organization, pod and inbox + /// send limits, charged before the change is saved; an over-limit request returns `429` + /// `rate_limit_exceeded` and changes nothing. + /// + /// Calendar is in private beta: organizations without access receive a `403`. + /// + /// # 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 + /// .calendar + /// .update_event( + /// &InboxesInboxID("inbox_id".to_string()), + /// &CalendarEventID("event_id".to_string()), + /// &UpdateCalendarEventRequest { + /// start: Some(WallTime("2026-10-15T15:00:00".to_string())), + /// end: Some(WallTime("2026-10-15T15:30:00".to_string())), + /// send_invites: Some(true), + /// ..Default::default() + /// }, + /// Some(RequestOptions::new().additional_header("If-Match", "\"rv-0\"")), + /// ) + /// .await; + /// } + /// ``` + pub async fn update_event( + &self, + inbox_id: &InboxesInboxId, + event_id: &CalendarEventId, + request: &UpdateCalendarEventRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::PATCH, + &format!("v0/inboxes/{}/calendar/events/{}", inbox_id.0, event_id.0), + Some(serde_json::to_value(request).map_err(ApiError::Serialization)?), + QueryBuilder::new() + .serialize("mode", request.mode.clone()) + .build(), + options, + ) + .await + } + + /// Lists the dates of one recurring event in a time window, in start order, with each date's + /// edits applied. Dates are computed from the rule, so this works for any window up to 366 + /// days, including dates far in the future. Cancelled dates are left out. + /// + /// The window defaults to now through 90 days from now. Items omit `description`, `metadata` + /// and `attendees`; get a date by its ID for the full object. Like other reads, the list can + /// trail a change made moments earlier by a few seconds; pass `consistency=primary` to read + /// your own change right away. Requires the `calendar_event_read` permission. + /// + /// Calendar is in private beta: organizations without access receive a `403`. + /// + /// # Arguments + /// + /// * `event_id` - UUID of the recurring event. + /// * `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 + /// .calendar + /// .list_event_instances( + /// &InboxesInboxID("inbox_id".to_string()), + /// &"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47".to_string(), + /// &ListEventInstancesQueryRequest { + /// ..Default::default() + /// }, + /// None, + /// ) + /// .await; + /// } + /// ``` + pub async fn list_event_instances( + &self, + inbox_id: &InboxesInboxId, + event_id: &str, + request: &ListEventInstancesQueryRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::GET, + &format!( + "v0/inboxes/{}/calendar/events/{}/instances", + inbox_id.0, event_id + ), + None, + QueryBuilder::new() + .serialize("consistency", request.consistency.clone()) + .serialize("after", request.after.clone()) + .serialize("before", request.before.clone()) + .serialize("include_overlapping", request.include_overlapping.clone()) + .serialize("limit", request.limit.clone()) + .serialize("page_token", request.page_token.clone()) + .build(), + options, + ) + .await + } + + /// Accepts, declines or tentatively accepts an invitation the inbox received by email. Pass the + /// event's UUID to respond for every date, or a dated ID to respond for one date only. + /// + /// Only works on `email` events where the inbox is an attendee; anything else returns 409 + /// `calendar_response_invalid`. Updates the inbox's attendee entry and sends + /// `calendar.event.responded`. With `send_reply` (default `true`) the inbox emails the response + /// to the organizer. + /// + /// Requires the `calendar_event_update` permission. To make the response conditional, send the + /// current `etag` in `If-Match`. + /// + /// A reply email counts as one send against the organization, pod and inbox send limits, + /// charged before the response is saved; an over-limit request returns `429` + /// `rate_limit_exceeded` and changes nothing. + /// + /// Calendar is in private beta: organizations without access receive a `403`. + /// + /// # 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 + /// .calendar + /// .respond_to_event( + /// &InboxesInboxID("inbox_id".to_string()), + /// &CalendarEventID("event_id".to_string()), + /// &RespondCalendarEventRequest { + /// status: RespondStatus::Accepted, + /// comment: Some("See you there.".to_string()), + /// send_reply: None, + /// }, + /// Some(RequestOptions::new().additional_header("If-Match", "\"rv-0\"")), + /// ) + /// .await; + /// } + /// ``` + pub async fn respond_to_event( + &self, + inbox_id: &InboxesInboxId, + event_id: &CalendarEventId, + request: &RespondCalendarEventRequest, + options: Option, + ) -> Result { + self.http_client + .execute_request( + Method::POST, + &format!( + "v0/inboxes/{}/calendar/events/{}/respond", + inbox_id.0, event_id.0 + ), + Some(serde_json::to_value(request).map_err(ApiError::Serialization)?), + None, + options, + ) + .await + } +} diff --git a/agentmail-sdk/src/api/resources/inboxes/calendar/mod.rs b/agentmail-sdk/src/api/resources/inboxes/calendar/mod.rs new file mode 100644 index 0000000..8ea689c --- /dev/null +++ b/agentmail-sdk/src/api/resources/inboxes/calendar/mod.rs @@ -0,0 +1,2 @@ +pub mod inboxes_calendar; +pub use inboxes_calendar::CalendarClient; diff --git a/agentmail-sdk/src/api/resources/inboxes/mod.rs b/agentmail-sdk/src/api/resources/inboxes/mod.rs index e69cf4d..4c7ab7d 100644 --- a/agentmail-sdk/src/api/resources/inboxes/mod.rs +++ b/agentmail-sdk/src/api/resources/inboxes/mod.rs @@ -6,6 +6,8 @@ pub mod accounts; pub use accounts::AccountsClient2; pub mod api_keys; pub use api_keys::ApiKeysClient2; +pub mod calendar; +pub use calendar::CalendarClient; pub mod drafts; pub use drafts::DraftsClient2; pub mod events; @@ -24,6 +26,7 @@ pub struct InboxesClient { pub http_client: HttpClient, pub accounts: AccountsClient2, pub api_keys: ApiKeysClient2, + pub calendar: CalendarClient, pub drafts: DraftsClient2, pub events: EventsClient, pub lists: ListsClient2, @@ -39,6 +42,7 @@ impl InboxesClient { http_client: HttpClient::new(config.clone())?, accounts: AccountsClient2::new(config.clone())?, api_keys: ApiKeysClient2::new(config.clone())?, + calendar: CalendarClient::new(config.clone())?, drafts: DraftsClient2::new(config.clone())?, events: EventsClient::new(config.clone())?, lists: ListsClient2::new(config.clone())?, @@ -317,6 +321,9 @@ impl InboxesClient { /// agentmail inboxes update --inbox-id --display-name "Updated Name" /// ``` /// + /// To pause an inbox, set `status` to `paused`; set it back to `active` to + /// resume. See [Pausing an inbox](/inboxes#pausing-an-inbox). + /// /// # Arguments /// /// * `options` - Additional request options such as headers, timeout, etc. diff --git a/agentmail-sdk/src/error.rs b/agentmail-sdk/src/error.rs index 4fed77b..7619cf0 100644 --- a/agentmail-sdk/src/error.rs +++ b/agentmail-sdk/src/error.rs @@ -28,6 +28,14 @@ pub enum ApiError { fix: Option, docs: Option, }, + #[error("ConflictError: Conflict - {message}")] + ConflictError { + message: String, + name: Option, + code: Option, + fix: Option, + docs: Option, + }, #[error("ForbiddenError: Access forbidden - {message}")] ForbiddenError { message: String, @@ -36,8 +44,33 @@ pub enum ApiError { fix: Option, docs: Option, }, - #[error("ConflictError: Conflict - {message}")] - ConflictError { + #[error("PreconditionFailedError: {message}")] + PreconditionFailedError { + message: String, + name: Option, + code: Option, + current_revision: Option, + fix: Option, + docs: Option, + }, + #[error("ContentTooLargeError: {message}")] + ContentTooLargeError { + message: String, + name: Option, + code: Option, + fix: Option, + docs: Option, + }, + #[error("TooManyRequestsError: Rate limit exceeded - {message}")] + TooManyRequestsError { + message: String, + name: Option, + code: Option, + fix: Option, + docs: Option, + }, + #[error("GoneError: {message}")] + GoneError { message: String, name: Option, code: Option, @@ -172,6 +205,39 @@ impl ApiError { docs: None, }; } + 409 => { + // Parse error body for ConflictError; + if let Some(body_str) = body { + if let Ok(parsed) = serde_json::from_str::(body_str) { + return Self::ConflictError { + message: parsed + .get("message") + .and_then(|v| v.as_str()) + .unwrap_or("Unknown error") + .to_string(), + name: parsed + .get("name") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + code: parsed + .get("code") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + fix: parsed + .get("fix") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + docs: parsed + .get("docs") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + }; + } + } + return Self::ConflictError { + message: body.unwrap_or("Unknown error").to_string(), + name: None, + code: None, + fix: None, + docs: None, + }; + } 403 => { // Parse error body for ForbiddenError; if let Some(body_str) = body { @@ -205,11 +271,11 @@ impl ApiError { docs: None, }; } - 409 => { - // Parse error body for ConflictError; + 412 => { + // Parse error body for PreconditionFailedError; if let Some(body_str) = body { if let Ok(parsed) = serde_json::from_str::(body_str) { - return Self::ConflictError { + return Self::PreconditionFailedError { message: parsed .get("message") .and_then(|v| v.as_str()) @@ -221,6 +287,9 @@ impl ApiError { code: parsed .get("code") .and_then(|v| serde_json::from_value::(v.clone()).ok()), + current_revision: parsed + .get("current_revision") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), fix: parsed .get("fix") .and_then(|v| serde_json::from_value::(v.clone()).ok()), @@ -230,7 +299,107 @@ impl ApiError { }; } } - return Self::ConflictError { + return Self::PreconditionFailedError { + message: body.unwrap_or("Unknown error").to_string(), + name: None, + code: None, + current_revision: None, + fix: None, + docs: None, + }; + } + 413 => { + // Parse error body for ContentTooLargeError; + if let Some(body_str) = body { + if let Ok(parsed) = serde_json::from_str::(body_str) { + return Self::ContentTooLargeError { + message: parsed + .get("message") + .and_then(|v| v.as_str()) + .unwrap_or("Unknown error") + .to_string(), + name: parsed + .get("name") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + code: parsed + .get("code") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + fix: parsed + .get("fix") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + docs: parsed + .get("docs") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + }; + } + } + return Self::ContentTooLargeError { + message: body.unwrap_or("Unknown error").to_string(), + name: None, + code: None, + fix: None, + docs: None, + }; + } + 429 => { + // Parse error body for TooManyRequestsError; + if let Some(body_str) = body { + if let Ok(parsed) = serde_json::from_str::(body_str) { + return Self::TooManyRequestsError { + message: parsed + .get("message") + .and_then(|v| v.as_str()) + .unwrap_or("Unknown error") + .to_string(), + name: parsed + .get("name") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + code: parsed + .get("code") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + fix: parsed + .get("fix") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + docs: parsed + .get("docs") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + }; + } + } + return Self::TooManyRequestsError { + message: body.unwrap_or("Unknown error").to_string(), + name: None, + code: None, + fix: None, + docs: None, + }; + } + 410 => { + // Parse error body for GoneError; + if let Some(body_str) = body { + if let Ok(parsed) = serde_json::from_str::(body_str) { + return Self::GoneError { + message: parsed + .get("message") + .and_then(|v| v.as_str()) + .unwrap_or("Unknown error") + .to_string(), + name: parsed + .get("name") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + code: parsed + .get("code") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + fix: parsed + .get("fix") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + docs: parsed + .get("docs") + .and_then(|v| serde_json::from_value::(v.clone()).ok()), + }; + } + } + return Self::GoneError { message: body.unwrap_or("Unknown error").to_string(), name: None, code: None, diff --git a/agentmail-types/src/types/api_key_permissions.rs b/agentmail-types/src/types/api_key_permissions.rs index ad2393a..5b4dc52 100644 --- a/agentmail-types/src/types/api_key_permissions.rs +++ b/agentmail-types/src/types/api_key_permissions.rs @@ -131,6 +131,24 @@ pub struct ApiKeyPermissions { /// Delete pods. #[serde(skip_serializing_if = "Option::is_none")] pub pod_delete: Option, + /// Read inbox calendar settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub calendar_read: Option, + /// Update inbox calendar settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub calendar_update: Option, + /// Read calendar events, and receive `calendar.event.*` webhook and WebSocket events. + #[serde(skip_serializing_if = "Option::is_none")] + pub calendar_event_read: Option, + /// Create calendar events. + #[serde(skip_serializing_if = "Option::is_none")] + pub calendar_event_create: Option, + /// Update calendar events and respond to invitations. + #[serde(skip_serializing_if = "Option::is_none")] + pub calendar_event_update: Option, + /// Delete calendar events. + #[serde(skip_serializing_if = "Option::is_none")] + pub calendar_event_delete: Option, } impl ApiKeyPermissions { @@ -183,6 +201,12 @@ pub struct ApiKeyPermissionsBuilder { pod_create: Option, pod_update: Option, pod_delete: Option, + calendar_read: Option, + calendar_update: Option, + calendar_event_read: Option, + calendar_event_create: Option, + calendar_event_update: Option, + calendar_event_delete: Option, } impl ApiKeyPermissionsBuilder { @@ -391,6 +415,36 @@ impl ApiKeyPermissionsBuilder { self } + pub fn calendar_read(mut self, value: bool) -> Self { + self.calendar_read = Some(value); + self + } + + pub fn calendar_update(mut self, value: bool) -> Self { + self.calendar_update = Some(value); + self + } + + pub fn calendar_event_read(mut self, value: bool) -> Self { + self.calendar_event_read = Some(value); + self + } + + pub fn calendar_event_create(mut self, value: bool) -> Self { + self.calendar_event_create = Some(value); + self + } + + pub fn calendar_event_update(mut self, value: bool) -> Self { + self.calendar_event_update = Some(value); + self + } + + pub fn calendar_event_delete(mut self, value: bool) -> Self { + self.calendar_event_delete = Some(value); + self + } + /// Consumes the builder and constructs a [`ApiKeyPermissions`]. pub fn build(self) -> Result { Ok(ApiKeyPermissions { @@ -435,6 +489,12 @@ impl ApiKeyPermissionsBuilder { pod_create: self.pod_create, pod_update: self.pod_update, pod_delete: self.pod_delete, + calendar_read: self.calendar_read, + calendar_update: self.calendar_update, + calendar_event_read: self.calendar_event_read, + calendar_event_create: self.calendar_event_create, + calendar_event_update: self.calendar_event_update, + calendar_event_delete: self.calendar_event_delete, }) } } diff --git a/agentmail-types/src/types/app.rs b/agentmail-types/src/types/app.rs index 95de089..1c70614 100644 --- a/agentmail-types/src/types/app.rs +++ b/agentmail-types/src/types/app.rs @@ -7,6 +7,9 @@ use super::*; pub struct App { #[serde(default)] pub app_id: AppId, + /// Short name accepted in place of `app_id` by Get App, List App Accounts and Connect App. Set by AgentMail on apps in the catalog; renaming the app does not change it. Store `app_id`, the app's permanent ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub slug: Option, #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, /// Time at which app was last updated. @@ -20,6 +23,9 @@ pub struct App { pub terms_url: Option, #[serde(skip_serializing_if = "Option::is_none")] pub privacy_url: Option, + /// Kinds of app, up to 3. Omitted when the app sets none. + #[serde(skip_serializing_if = "Option::is_none")] + pub categories: Option>, /// Maximum number of accounts your organization may sign up at this app. Omitted when the app sets no limit. 0 means the app has paused new sign-ups; existing accounts keep signing in. #[serde(skip_serializing_if = "Option::is_none")] pub owner_signup_limit: Option, @@ -35,12 +41,14 @@ impl App { #[non_exhaustive] pub struct AppBuilder { app_id: Option, + slug: Option, name: Option, updated_at: Option>, description: Option, logo_url: Option, terms_url: Option, privacy_url: Option, + categories: Option>, owner_signup_limit: Option, } @@ -50,6 +58,11 @@ impl AppBuilder { self } + pub fn slug(mut self, value: impl Into) -> Self { + self.slug = Some(value.into()); + self + } + pub fn name(mut self, value: impl Into) -> Self { self.name = Some(value.into()); self @@ -80,6 +93,11 @@ impl AppBuilder { self } + pub fn categories(mut self, value: Vec) -> Self { + self.categories = Some(value); + self + } + pub fn owner_signup_limit(mut self, value: i64) -> Self { self.owner_signup_limit = Some(value); self @@ -91,12 +109,14 @@ impl AppBuilder { pub fn build(self) -> Result { Ok(App { app_id: self.app_id.ok_or_else(|| BuildError::missing_field("app_id"))?, + slug: self.slug, name: self.name, updated_at: self.updated_at, description: self.description, logo_url: self.logo_url, terms_url: self.terms_url, privacy_url: self.privacy_url, + categories: self.categories, owner_signup_limit: self.owner_signup_limit, }) } diff --git a/agentmail-types/src/types/app_category.rs b/agentmail-types/src/types/app_category.rs new file mode 100644 index 0000000..bc178f1 --- /dev/null +++ b/agentmail-types/src/types/app_category.rs @@ -0,0 +1,101 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Kind of app. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum AppCategory { + Ai, + Search, + Scraping, + Browser, + Data, + DeveloperTools, + Communication, + Productivity, + Payments, + Finance, + Commerce, + Marketing, + Analytics, + Security, + Infrastructure, + Other, + /// 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 AppCategory { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::Ai => serializer.serialize_str("ai"), + Self::Search => serializer.serialize_str("search"), + Self::Scraping => serializer.serialize_str("scraping"), + Self::Browser => serializer.serialize_str("browser"), + Self::Data => serializer.serialize_str("data"), + Self::DeveloperTools => serializer.serialize_str("developer-tools"), + Self::Communication => serializer.serialize_str("communication"), + Self::Productivity => serializer.serialize_str("productivity"), + Self::Payments => serializer.serialize_str("payments"), + Self::Finance => serializer.serialize_str("finance"), + Self::Commerce => serializer.serialize_str("commerce"), + Self::Marketing => serializer.serialize_str("marketing"), + Self::Analytics => serializer.serialize_str("analytics"), + Self::Security => serializer.serialize_str("security"), + Self::Infrastructure => serializer.serialize_str("infrastructure"), + Self::Other => serializer.serialize_str("other"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for AppCategory { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "ai" => Ok(Self::Ai), + "search" => Ok(Self::Search), + "scraping" => Ok(Self::Scraping), + "browser" => Ok(Self::Browser), + "data" => Ok(Self::Data), + "developer-tools" => Ok(Self::DeveloperTools), + "communication" => Ok(Self::Communication), + "productivity" => Ok(Self::Productivity), + "payments" => Ok(Self::Payments), + "finance" => Ok(Self::Finance), + "commerce" => Ok(Self::Commerce), + "marketing" => Ok(Self::Marketing), + "analytics" => Ok(Self::Analytics), + "security" => Ok(Self::Security), + "infrastructure" => Ok(Self::Infrastructure), + "other" => Ok(Self::Other), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for AppCategory { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Ai => write!(f, "ai"), + Self::Search => write!(f, "search"), + Self::Scraping => write!(f, "scraping"), + Self::Browser => write!(f, "browser"), + Self::Data => write!(f, "data"), + Self::DeveloperTools => write!(f, "developer-tools"), + Self::Communication => write!(f, "communication"), + Self::Productivity => write!(f, "productivity"), + Self::Payments => write!(f, "payments"), + Self::Finance => write!(f, "finance"), + Self::Commerce => write!(f, "commerce"), + Self::Marketing => write!(f, "marketing"), + Self::Analytics => write!(f, "analytics"), + Self::Security => write!(f, "security"), + Self::Infrastructure => write!(f, "infrastructure"), + Self::Other => write!(f, "other"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/apps_list_query_request.rs b/agentmail-types/src/types/apps_list_query_request.rs index 04b5072..5dba527 100644 --- a/agentmail-types/src/types/apps_list_query_request.rs +++ b/agentmail-types/src/types/apps_list_query_request.rs @@ -9,6 +9,9 @@ pub struct AppsListQueryRequest { pub limit: Option, #[serde(skip_serializing_if = "Option::is_none")] pub page_token: Option, + /// Only apps in this category. A filtered page can hold fewer than `limit` apps while more remain, so page until `next_page_token` is absent. A `page_token` works only with the `category` it was returned for. + #[serde(skip_serializing_if = "Option::is_none")] + pub category: Option, } impl AppsListQueryRequest { @@ -22,6 +25,7 @@ impl AppsListQueryRequest { pub struct AppsListQueryRequestBuilder { limit: Option, page_token: Option, + category: Option, } impl AppsListQueryRequestBuilder { @@ -35,11 +39,17 @@ impl AppsListQueryRequestBuilder { self } + pub fn category(mut self, value: AppCategory) -> Self { + self.category = Some(value); + self + } + /// Consumes the builder and constructs a [`AppsListQueryRequest`]. pub fn build(self) -> Result { Ok(AppsListQueryRequest { limit: self.limit, page_token: self.page_token, + category: self.category, }) } } diff --git a/agentmail-types/src/types/attendee.rs b/agentmail-types/src/types/attendee.rs new file mode 100644 index 0000000..918e251 --- /dev/null +++ b/agentmail-types/src/types/attendee.rs @@ -0,0 +1,89 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct Attendee { + /// Email address of the attendee. Stored in lowercase. Must be unique within the event. + #[serde(default)] + pub email: String, + /// Display name of the attendee. At most 256 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Response status. Defaults to `needs_action`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Defaults to `required`. + #[serde(skip_serializing_if = "Option::is_none")] + pub role: Option, + /// Comment the attendee sent with their response. At most 4,096 UTF-8 bytes; on create or + /// update, a longer comment is dropped rather than rejected. + #[serde(skip_serializing_if = "Option::is_none")] + pub comment: Option, + /// Time at which the attendee last responded. + #[serde(skip_serializing_if = "Option::is_none")] + pub responded_at: Option>, +} + +impl Attendee { + pub fn builder() -> AttendeeBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct AttendeeBuilder { + email: Option, + name: Option, + status: Option, + role: Option, + comment: Option, + responded_at: Option>, +} + +impl AttendeeBuilder { + pub fn email(mut self, value: impl Into) -> Self { + self.email = Some(value.into()); + self + } + + pub fn name(mut self, value: impl Into) -> Self { + self.name = Some(value.into()); + self + } + + pub fn status(mut self, value: AttendeeStatus) -> Self { + self.status = Some(value); + self + } + + pub fn role(mut self, value: AttendeeRole) -> Self { + self.role = Some(value); + self + } + + pub fn comment(mut self, value: impl Into) -> Self { + self.comment = Some(value.into()); + self + } + + pub fn responded_at(mut self, value: DateTime) -> Self { + self.responded_at = Some(value); + self + } + + /// Consumes the builder and constructs a [`Attendee`]. + /// This method will fail if any of the following fields are not set: + /// - [`email`](AttendeeBuilder::email) + pub fn build(self) -> Result { + Ok(Attendee { + email: self.email.ok_or_else(|| BuildError::missing_field("email"))?, + name: self.name, + status: self.status, + role: self.role, + comment: self.comment, + responded_at: self.responded_at, + }) + } +} diff --git a/agentmail-types/src/types/attendee_role.rs b/agentmail-types/src/types/attendee_role.rs new file mode 100644 index 0000000..c192295 --- /dev/null +++ b/agentmail-types/src/types/attendee_role.rs @@ -0,0 +1,45 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Whether the attendee's presence is required. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum AttendeeRole { + Required, + Optional, + /// 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 AttendeeRole { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::Required => serializer.serialize_str("required"), + Self::Optional => serializer.serialize_str("optional"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for AttendeeRole { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "required" => Ok(Self::Required), + "optional" => Ok(Self::Optional), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for AttendeeRole { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Required => write!(f, "required"), + Self::Optional => write!(f, "optional"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/attendee_status.rs b/agentmail-types/src/types/attendee_status.rs new file mode 100644 index 0000000..f6a5726 --- /dev/null +++ b/agentmail-types/src/types/attendee_status.rs @@ -0,0 +1,53 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// The attendee's response to the invitation. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum AttendeeStatus { + NeedsAction, + Accepted, + Declined, + Tentative, + /// 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 AttendeeStatus { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::NeedsAction => serializer.serialize_str("needs_action"), + Self::Accepted => serializer.serialize_str("accepted"), + Self::Declined => serializer.serialize_str("declined"), + Self::Tentative => serializer.serialize_str("tentative"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for AttendeeStatus { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "needs_action" => Ok(Self::NeedsAction), + "accepted" => Ok(Self::Accepted), + "declined" => Ok(Self::Declined), + "tentative" => Ok(Self::Tentative), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for AttendeeStatus { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::NeedsAction => write!(f, "needs_action"), + Self::Accepted => write!(f, "accepted"), + Self::Declined => write!(f, "declined"), + Self::Tentative => write!(f, "tentative"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/calendar.rs b/agentmail-types/src/types/calendar.rs new file mode 100644 index 0000000..50ae7f3 --- /dev/null +++ b/agentmail-types/src/types/calendar.rs @@ -0,0 +1,98 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// An inbox's calendar. Every inbox has exactly one calendar; it exists from the moment the inbox +/// does and is deleted with it. +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct Calendar { + #[serde(default)] + pub inbox_id: InboxesInboxId, + /// Default time zone for events created without a `timezone`. Defaults to `UTC`. Changing it + /// does not move existing events. + #[serde(default)] + pub timezone: IanaTimezone, + /// Number of one-off and recurring events on the calendar. Each recurring event counts once. + #[serde(default)] + pub event_count: i64, + /// Time at which the calendar was created. The calendar exists from the moment the inbox does, so this is the inbox's creation time. + #[serde(default)] + #[serde(with = "crate::core::flexible_datetime::offset")] + pub created_at: DateTime, + /// Time at which the calendar was last updated. + #[serde(default)] + #[serde(with = "crate::core::flexible_datetime::offset")] + pub updated_at: DateTime, + /// The calendar's current version, also sent as the `ETag` response header. Send it in + /// `If-Match` to make an update conditional. + #[serde(default)] + pub etag: String, +} + +impl Calendar { + pub fn builder() -> CalendarBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct CalendarBuilder { + inbox_id: Option, + timezone: Option, + event_count: Option, + created_at: Option>, + updated_at: Option>, + etag: Option, +} + +impl CalendarBuilder { + pub fn inbox_id(mut self, value: InboxesInboxId) -> Self { + self.inbox_id = Some(value); + self + } + + pub fn timezone(mut self, value: IanaTimezone) -> Self { + self.timezone = Some(value); + self + } + + pub fn event_count(mut self, value: i64) -> Self { + self.event_count = 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 etag(mut self, value: impl Into) -> Self { + self.etag = Some(value.into()); + self + } + + /// Consumes the builder and constructs a [`Calendar`]. + /// This method will fail if any of the following fields are not set: + /// - [`inbox_id`](CalendarBuilder::inbox_id) + /// - [`timezone`](CalendarBuilder::timezone) + /// - [`event_count`](CalendarBuilder::event_count) + /// - [`created_at`](CalendarBuilder::created_at) + /// - [`updated_at`](CalendarBuilder::updated_at) + /// - [`etag`](CalendarBuilder::etag) + pub fn build(self) -> Result { + Ok(Calendar { + inbox_id: self.inbox_id.ok_or_else(|| BuildError::missing_field("inbox_id"))?, + timezone: self.timezone.ok_or_else(|| BuildError::missing_field("timezone"))?, + event_count: self.event_count.ok_or_else(|| BuildError::missing_field("event_count"))?, + 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"))?, + etag: self.etag.ok_or_else(|| BuildError::missing_field("etag"))?, + }) + } +} diff --git a/agentmail-types/src/types/calendar_consistency.rs b/agentmail-types/src/types/calendar_consistency.rs new file mode 100644 index 0000000..ba64cd2 --- /dev/null +++ b/agentmail-types/src/types/calendar_consistency.rs @@ -0,0 +1,47 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Read consistency. `eventual` (default) reads from the region that serves your request and may +/// lag a write made moments earlier by up to a few seconds. `primary` reads from the primary region +/// and always reflects every completed write. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum CalendarConsistency { + Eventual, + Primary, + /// 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 CalendarConsistency { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::Eventual => serializer.serialize_str("eventual"), + Self::Primary => serializer.serialize_str("primary"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for CalendarConsistency { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "eventual" => Ok(Self::Eventual), + "primary" => Ok(Self::Primary), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for CalendarConsistency { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Eventual => write!(f, "eventual"), + Self::Primary => write!(f, "primary"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/calendar_event.rs b/agentmail-types/src/types/calendar_event.rs new file mode 100644 index 0000000..d01f912 --- /dev/null +++ b/agentmail-types/src/types/calendar_event.rs @@ -0,0 +1,357 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// A calendar event. The same shape is used by every response, list item and webhook. `kind` says +/// whether it is a one-off event, the definition of a recurring series, or one date of a series. +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct CalendarEvent { + #[serde(default)] + pub event_id: CalendarEventId, + pub kind: CalendarEventKind, + /// For `instance` events, the UUID of the series this date belongs to. + #[serde(skip_serializing_if = "Option::is_none")] + pub series_id: Option, + /// For `instance` events, the date's start as the series rule generated it, before any edit. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_start: Option, + /// For `instance` events, `original_start` as a UTC instant. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_start_at: Option>, + /// For `instance` events, `true` when this date was edited or moved, individually or by a `mode=future` change. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_exception: Option, + /// Title of the event. + #[serde(default)] + pub title: String, + /// Description of the event. Omitted from agenda and instance list items. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Location of the event. + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option, + /// Your own JSON value for the event, usually an object. Never sent to attendees. Omitted from agenda and instance list items. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option, + pub status: CalendarEventStatus, + /// Whether this is an all-day event. + #[serde(default)] + pub all_day: bool, + /// Local start time in `timezone`. For all-day events, the first day. + #[serde(default)] + pub start: WallTime, + /// Local end time in `timezone`. For all-day events, the last day (inclusive). + #[serde(default)] + pub end: WallTime, + #[serde(default)] + pub timezone: IanaTimezone, + pub duration_mode: DurationMode, + /// Length of the event, in milliseconds for timed events and in days for all-day events. + #[serde(default)] + pub duration_value: i64, + /// Start as a UTC instant. This is when `calendar.event.starting` is due. + #[serde(default)] + #[serde(with = "crate::core::flexible_datetime::offset")] + pub start_at: DateTime, + /// End as a UTC instant. This is when `calendar.event.ending` is due. + #[serde(default)] + #[serde(with = "crate::core::flexible_datetime::offset")] + pub end_at: DateTime, + /// For `series` events, the recurrence. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurrence: Option, + /// Attendees of the event. Omitted from agenda and instance list items; `attendee_count` is always present. + #[serde(skip_serializing_if = "Option::is_none")] + pub attendees: Option>, + /// Number of attendees. + #[serde(default)] + pub attendee_count: i64, + /// iCalendar UID of the event. Invitations about this event carry the same UID. + #[serde(default)] + pub uid: String, + /// iCalendar SEQUENCE number. It increases when a change to a one-off or series event affects + /// what attendees see (time, status, title, description, location, recurrence or attendees). + /// A change to a dated event increases it only when the change is sent with `send_invites`. + #[serde(default)] + pub sequence: i64, + pub source: CalendarEventSource, + /// Email address of the organizer. For `api` events, the inbox. + #[serde(skip_serializing_if = "Option::is_none")] + pub organizer_email: Option, + /// For `email` events, the ID of the message whose invitation last created or updated the event. + #[serde(skip_serializing_if = "Option::is_none")] + pub origin_message_id: Option, + /// Present on `single` and `series` events, except agenda items and + /// `calendar.event.starting` and `calendar.event.ending` payloads, which omit it. + #[serde(skip_serializing_if = "Option::is_none")] + pub resource_revision: Option, + /// Time at which the event (or, for a date, the definition governing it) was created. + #[serde(default)] + #[serde(with = "crate::core::flexible_datetime::offset")] + pub created_at: DateTime, + /// Time at which the event (or, for a date, the definition governing it) was last updated. + #[serde(default)] + #[serde(with = "crate::core::flexible_datetime::offset")] + pub updated_at: DateTime, + /// The event's or date's current version, also sent as the `ETag` response header. Send it in + /// `If-Match` to make an update, delete or response conditional. Present on Get, Create, + /// Update, Delete and Respond responses; list items and webhooks omit it. Treat it as opaque: + /// a dated event's `etag` (`"occ-..."`) is not derived from `resource_revision`. + #[serde(skip_serializing_if = "Option::is_none")] + pub etag: Option, +} + +impl CalendarEvent { + pub fn builder() -> CalendarEventBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct CalendarEventBuilder { + event_id: Option, + kind: Option, + series_id: Option, + original_start: Option, + original_start_at: Option>, + is_exception: Option, + title: Option, + description: Option, + location: Option, + metadata: Option, + status: Option, + all_day: Option, + start: Option, + end: Option, + timezone: Option, + duration_mode: Option, + duration_value: Option, + start_at: Option>, + end_at: Option>, + recurrence: Option, + attendees: Option>, + attendee_count: Option, + uid: Option, + sequence: Option, + source: Option, + organizer_email: Option, + origin_message_id: Option, + resource_revision: Option, + created_at: Option>, + updated_at: Option>, + etag: Option, +} + +impl CalendarEventBuilder { + pub fn event_id(mut self, value: CalendarEventId) -> Self { + self.event_id = Some(value); + self + } + + pub fn kind(mut self, value: CalendarEventKind) -> Self { + self.kind = Some(value); + self + } + + pub fn series_id(mut self, value: impl Into) -> Self { + self.series_id = Some(value.into()); + self + } + + pub fn original_start(mut self, value: WallTime) -> Self { + self.original_start = Some(value); + self + } + + pub fn original_start_at(mut self, value: DateTime) -> Self { + self.original_start_at = Some(value); + self + } + + pub fn is_exception(mut self, value: bool) -> Self { + self.is_exception = Some(value); + self + } + + pub fn title(mut self, value: impl Into) -> Self { + self.title = Some(value.into()); + self + } + + pub fn description(mut self, value: impl Into) -> Self { + self.description = Some(value.into()); + self + } + + pub fn location(mut self, value: impl Into) -> Self { + self.location = Some(value.into()); + self + } + + pub fn metadata(mut self, value: serde_json::Value) -> Self { + self.metadata = Some(value); + self + } + + pub fn status(mut self, value: CalendarEventStatus) -> Self { + self.status = Some(value); + self + } + + pub fn all_day(mut self, value: bool) -> Self { + self.all_day = Some(value); + self + } + + pub fn start(mut self, value: WallTime) -> Self { + self.start = Some(value); + self + } + + pub fn end(mut self, value: WallTime) -> Self { + self.end = Some(value); + self + } + + pub fn timezone(mut self, value: IanaTimezone) -> Self { + self.timezone = Some(value); + self + } + + pub fn duration_mode(mut self, value: DurationMode) -> Self { + self.duration_mode = Some(value); + self + } + + pub fn duration_value(mut self, value: i64) -> Self { + self.duration_value = Some(value); + self + } + + pub fn start_at(mut self, value: DateTime) -> Self { + self.start_at = Some(value); + self + } + + pub fn end_at(mut self, value: DateTime) -> Self { + self.end_at = Some(value); + self + } + + pub fn recurrence(mut self, value: Recurrence) -> Self { + self.recurrence = Some(value); + self + } + + pub fn attendees(mut self, value: Vec) -> Self { + self.attendees = Some(value); + self + } + + pub fn attendee_count(mut self, value: i64) -> Self { + self.attendee_count = Some(value); + self + } + + pub fn uid(mut self, value: impl Into) -> Self { + self.uid = Some(value.into()); + self + } + + pub fn sequence(mut self, value: i64) -> Self { + self.sequence = Some(value); + self + } + + pub fn source(mut self, value: CalendarEventSource) -> Self { + self.source = Some(value); + self + } + + pub fn organizer_email(mut self, value: impl Into) -> Self { + self.organizer_email = Some(value.into()); + self + } + + pub fn origin_message_id(mut self, value: impl Into) -> Self { + self.origin_message_id = Some(value.into()); + self + } + + pub fn resource_revision(mut self, value: ResourceRevision) -> Self { + self.resource_revision = 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 etag(mut self, value: impl Into) -> Self { + self.etag = Some(value.into()); + self + } + + /// Consumes the builder and constructs a [`CalendarEvent`]. + /// This method will fail if any of the following fields are not set: + /// - [`event_id`](CalendarEventBuilder::event_id) + /// - [`kind`](CalendarEventBuilder::kind) + /// - [`title`](CalendarEventBuilder::title) + /// - [`status`](CalendarEventBuilder::status) + /// - [`all_day`](CalendarEventBuilder::all_day) + /// - [`start`](CalendarEventBuilder::start) + /// - [`end`](CalendarEventBuilder::end) + /// - [`timezone`](CalendarEventBuilder::timezone) + /// - [`duration_mode`](CalendarEventBuilder::duration_mode) + /// - [`duration_value`](CalendarEventBuilder::duration_value) + /// - [`start_at`](CalendarEventBuilder::start_at) + /// - [`end_at`](CalendarEventBuilder::end_at) + /// - [`attendee_count`](CalendarEventBuilder::attendee_count) + /// - [`uid`](CalendarEventBuilder::uid) + /// - [`sequence`](CalendarEventBuilder::sequence) + /// - [`source`](CalendarEventBuilder::source) + /// - [`created_at`](CalendarEventBuilder::created_at) + /// - [`updated_at`](CalendarEventBuilder::updated_at) + pub fn build(self) -> Result { + Ok(CalendarEvent { + event_id: self.event_id.ok_or_else(|| BuildError::missing_field("event_id"))?, + kind: self.kind.ok_or_else(|| BuildError::missing_field("kind"))?, + series_id: self.series_id, + original_start: self.original_start, + original_start_at: self.original_start_at, + is_exception: self.is_exception, + title: self.title.ok_or_else(|| BuildError::missing_field("title"))?, + description: self.description, + location: self.location, + metadata: self.metadata, + status: self.status.ok_or_else(|| BuildError::missing_field("status"))?, + all_day: self.all_day.ok_or_else(|| BuildError::missing_field("all_day"))?, + start: self.start.ok_or_else(|| BuildError::missing_field("start"))?, + end: self.end.ok_or_else(|| BuildError::missing_field("end"))?, + timezone: self.timezone.ok_or_else(|| BuildError::missing_field("timezone"))?, + duration_mode: self.duration_mode.ok_or_else(|| BuildError::missing_field("duration_mode"))?, + duration_value: self.duration_value.ok_or_else(|| BuildError::missing_field("duration_value"))?, + start_at: self.start_at.ok_or_else(|| BuildError::missing_field("start_at"))?, + end_at: self.end_at.ok_or_else(|| BuildError::missing_field("end_at"))?, + recurrence: self.recurrence, + attendees: self.attendees, + attendee_count: self.attendee_count.ok_or_else(|| BuildError::missing_field("attendee_count"))?, + uid: self.uid.ok_or_else(|| BuildError::missing_field("uid"))?, + sequence: self.sequence.ok_or_else(|| BuildError::missing_field("sequence"))?, + source: self.source.ok_or_else(|| BuildError::missing_field("source"))?, + organizer_email: self.organizer_email, + origin_message_id: self.origin_message_id, + resource_revision: self.resource_revision, + 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"))?, + etag: self.etag, + }) + } +} diff --git a/agentmail-types/src/types/calendar_event_created_event.rs b/agentmail-types/src/types/calendar_event_created_event.rs new file mode 100644 index 0000000..65d5854 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_created_event.rs @@ -0,0 +1,77 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// An event was created, through the API or from an invitation the inbox received. Also sent when +/// one date of a recurring event is edited for the first time; `calendar_event` is then that date. +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct CalendarEventCreatedEvent { + pub r#type: CalendarEventCreatedEventType, + pub event_type: CalendarEventCreatedEventEventType, + /// Equals the `operation_id` returned by the request that made the change. + #[serde(default)] + pub event_id: EventId, + #[serde(default)] + pub inbox_id: InboxesInboxId, + pub calendar_event: CalendarEvent, +} + +impl CalendarEventCreatedEvent { + pub fn builder() -> CalendarEventCreatedEventBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct CalendarEventCreatedEventBuilder { + r#type: Option, + event_type: Option, + event_id: Option, + inbox_id: Option, + calendar_event: Option, +} + +impl CalendarEventCreatedEventBuilder { + pub fn r#type(mut self, value: CalendarEventCreatedEventType) -> Self { + self.r#type = Some(value); + self + } + + pub fn event_type(mut self, value: CalendarEventCreatedEventEventType) -> Self { + self.event_type = Some(value); + self + } + + pub fn event_id(mut self, value: EventId) -> Self { + self.event_id = Some(value); + self + } + + pub fn inbox_id(mut self, value: InboxesInboxId) -> Self { + self.inbox_id = Some(value); + self + } + + pub fn calendar_event(mut self, value: CalendarEvent) -> Self { + self.calendar_event = Some(value); + self + } + + /// Consumes the builder and constructs a [`CalendarEventCreatedEvent`]. + /// This method will fail if any of the following fields are not set: + /// - [`r#type`](CalendarEventCreatedEventBuilder::r#type) + /// - [`event_type`](CalendarEventCreatedEventBuilder::event_type) + /// - [`event_id`](CalendarEventCreatedEventBuilder::event_id) + /// - [`inbox_id`](CalendarEventCreatedEventBuilder::inbox_id) + /// - [`calendar_event`](CalendarEventCreatedEventBuilder::calendar_event) + pub fn build(self) -> Result { + Ok(CalendarEventCreatedEvent { + r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, + event_type: self.event_type.ok_or_else(|| BuildError::missing_field("event_type"))?, + event_id: self.event_id.ok_or_else(|| BuildError::missing_field("event_id"))?, + inbox_id: self.inbox_id.ok_or_else(|| BuildError::missing_field("inbox_id"))?, + calendar_event: self.calendar_event.ok_or_else(|| BuildError::missing_field("calendar_event"))?, + }) + } +} diff --git a/agentmail-types/src/types/calendar_event_created_event_event_type.rs b/agentmail-types/src/types/calendar_event_created_event_event_type.rs new file mode 100644 index 0000000..58afce2 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_created_event_event_type.rs @@ -0,0 +1,17 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub enum CalendarEventCreatedEventEventType { + #[serde(rename = "calendar.event.created")] + CalendarEventCreated, +} +impl fmt::Display for CalendarEventCreatedEventEventType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let s = match self { + Self::CalendarEventCreated => "calendar.event.created", + }; + write!(f, "{}", s) + } +} diff --git a/agentmail-types/src/types/calendar_event_created_event_type.rs b/agentmail-types/src/types/calendar_event_created_event_type.rs new file mode 100644 index 0000000..592419d --- /dev/null +++ b/agentmail-types/src/types/calendar_event_created_event_type.rs @@ -0,0 +1,17 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub enum CalendarEventCreatedEventType { + #[serde(rename = "event")] + Event, +} +impl fmt::Display for CalendarEventCreatedEventType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let s = match self { + Self::Event => "event", + }; + write!(f, "{}", s) + } +} diff --git a/agentmail-types/src/types/calendar_event_deleted_event.rs b/agentmail-types/src/types/calendar_event_deleted_event.rs new file mode 100644 index 0000000..82c5f37 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_deleted_event.rs @@ -0,0 +1,77 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// A one-off or recurring event was deleted. `calendar_event` is the event as it was. Cancelling +/// dates of a recurring event sends `calendar.event.updated` instead. +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct CalendarEventDeletedEvent { + pub r#type: CalendarEventDeletedEventType, + pub event_type: CalendarEventDeletedEventEventType, + /// Equals the `deletion_id` returned by the request that made the change. + #[serde(default)] + pub event_id: EventId, + #[serde(default)] + pub inbox_id: InboxesInboxId, + pub calendar_event: CalendarEvent, +} + +impl CalendarEventDeletedEvent { + pub fn builder() -> CalendarEventDeletedEventBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct CalendarEventDeletedEventBuilder { + r#type: Option, + event_type: Option, + event_id: Option, + inbox_id: Option, + calendar_event: Option, +} + +impl CalendarEventDeletedEventBuilder { + pub fn r#type(mut self, value: CalendarEventDeletedEventType) -> Self { + self.r#type = Some(value); + self + } + + pub fn event_type(mut self, value: CalendarEventDeletedEventEventType) -> Self { + self.event_type = Some(value); + self + } + + pub fn event_id(mut self, value: EventId) -> Self { + self.event_id = Some(value); + self + } + + pub fn inbox_id(mut self, value: InboxesInboxId) -> Self { + self.inbox_id = Some(value); + self + } + + pub fn calendar_event(mut self, value: CalendarEvent) -> Self { + self.calendar_event = Some(value); + self + } + + /// Consumes the builder and constructs a [`CalendarEventDeletedEvent`]. + /// This method will fail if any of the following fields are not set: + /// - [`r#type`](CalendarEventDeletedEventBuilder::r#type) + /// - [`event_type`](CalendarEventDeletedEventBuilder::event_type) + /// - [`event_id`](CalendarEventDeletedEventBuilder::event_id) + /// - [`inbox_id`](CalendarEventDeletedEventBuilder::inbox_id) + /// - [`calendar_event`](CalendarEventDeletedEventBuilder::calendar_event) + pub fn build(self) -> Result { + Ok(CalendarEventDeletedEvent { + r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, + event_type: self.event_type.ok_or_else(|| BuildError::missing_field("event_type"))?, + event_id: self.event_id.ok_or_else(|| BuildError::missing_field("event_id"))?, + inbox_id: self.inbox_id.ok_or_else(|| BuildError::missing_field("inbox_id"))?, + calendar_event: self.calendar_event.ok_or_else(|| BuildError::missing_field("calendar_event"))?, + }) + } +} diff --git a/agentmail-types/src/types/calendar_event_deleted_event_event_type.rs b/agentmail-types/src/types/calendar_event_deleted_event_event_type.rs new file mode 100644 index 0000000..ec0d413 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_deleted_event_event_type.rs @@ -0,0 +1,17 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub enum CalendarEventDeletedEventEventType { + #[serde(rename = "calendar.event.deleted")] + CalendarEventDeleted, +} +impl fmt::Display for CalendarEventDeletedEventEventType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let s = match self { + Self::CalendarEventDeleted => "calendar.event.deleted", + }; + write!(f, "{}", s) + } +} diff --git a/agentmail-types/src/types/calendar_event_deleted_event_type.rs b/agentmail-types/src/types/calendar_event_deleted_event_type.rs new file mode 100644 index 0000000..6e5a066 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_deleted_event_type.rs @@ -0,0 +1,17 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub enum CalendarEventDeletedEventType { + #[serde(rename = "event")] + Event, +} +impl fmt::Display for CalendarEventDeletedEventType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let s = match self { + Self::Event => "event", + }; + write!(f, "{}", s) + } +} diff --git a/agentmail-types/src/types/calendar_event_ending_event.rs b/agentmail-types/src/types/calendar_event_ending_event.rs new file mode 100644 index 0000000..d61dd3f --- /dev/null +++ b/agentmail-types/src/types/calendar_event_ending_event.rs @@ -0,0 +1,90 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// An event, or one date of a recurring event, has ended. Usually sent within a minute after +/// `scheduled_at`. Retries carry the same `event_id` and an identical body. +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct CalendarEventEndingEvent { + pub r#type: CalendarEventEndingEventType, + pub event_type: CalendarEventEndingEventEventType, + /// Stable for this date and boundary. Use it to deduplicate deliveries. + #[serde(default)] + pub event_id: EventId, + #[serde(default)] + pub inbox_id: InboxesInboxId, + /// The event or date as it stood when the boundary was first processed. + pub calendar_event: CalendarEvent, + /// The end this webhook is for (the event's `end_at`). + #[serde(default)] + #[serde(with = "crate::core::flexible_datetime::offset")] + pub scheduled_at: DateTime, +} + +impl CalendarEventEndingEvent { + pub fn builder() -> CalendarEventEndingEventBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct CalendarEventEndingEventBuilder { + r#type: Option, + event_type: Option, + event_id: Option, + inbox_id: Option, + calendar_event: Option, + scheduled_at: Option>, +} + +impl CalendarEventEndingEventBuilder { + pub fn r#type(mut self, value: CalendarEventEndingEventType) -> Self { + self.r#type = Some(value); + self + } + + pub fn event_type(mut self, value: CalendarEventEndingEventEventType) -> Self { + self.event_type = Some(value); + self + } + + pub fn event_id(mut self, value: EventId) -> Self { + self.event_id = Some(value); + self + } + + pub fn inbox_id(mut self, value: InboxesInboxId) -> Self { + self.inbox_id = Some(value); + self + } + + pub fn calendar_event(mut self, value: CalendarEvent) -> Self { + self.calendar_event = Some(value); + self + } + + pub fn scheduled_at(mut self, value: DateTime) -> Self { + self.scheduled_at = Some(value); + self + } + + /// Consumes the builder and constructs a [`CalendarEventEndingEvent`]. + /// This method will fail if any of the following fields are not set: + /// - [`r#type`](CalendarEventEndingEventBuilder::r#type) + /// - [`event_type`](CalendarEventEndingEventBuilder::event_type) + /// - [`event_id`](CalendarEventEndingEventBuilder::event_id) + /// - [`inbox_id`](CalendarEventEndingEventBuilder::inbox_id) + /// - [`calendar_event`](CalendarEventEndingEventBuilder::calendar_event) + /// - [`scheduled_at`](CalendarEventEndingEventBuilder::scheduled_at) + pub fn build(self) -> Result { + Ok(CalendarEventEndingEvent { + r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, + event_type: self.event_type.ok_or_else(|| BuildError::missing_field("event_type"))?, + event_id: self.event_id.ok_or_else(|| BuildError::missing_field("event_id"))?, + inbox_id: self.inbox_id.ok_or_else(|| BuildError::missing_field("inbox_id"))?, + calendar_event: self.calendar_event.ok_or_else(|| BuildError::missing_field("calendar_event"))?, + scheduled_at: self.scheduled_at.ok_or_else(|| BuildError::missing_field("scheduled_at"))?, + }) + } +} diff --git a/agentmail-types/src/types/calendar_event_ending_event_event_type.rs b/agentmail-types/src/types/calendar_event_ending_event_event_type.rs new file mode 100644 index 0000000..8b70766 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_ending_event_event_type.rs @@ -0,0 +1,17 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub enum CalendarEventEndingEventEventType { + #[serde(rename = "calendar.event.ending")] + CalendarEventEnding, +} +impl fmt::Display for CalendarEventEndingEventEventType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let s = match self { + Self::CalendarEventEnding => "calendar.event.ending", + }; + write!(f, "{}", s) + } +} diff --git a/agentmail-types/src/types/calendar_event_ending_event_type.rs b/agentmail-types/src/types/calendar_event_ending_event_type.rs new file mode 100644 index 0000000..f639422 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_ending_event_type.rs @@ -0,0 +1,17 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub enum CalendarEventEndingEventType { + #[serde(rename = "event")] + Event, +} +impl fmt::Display for CalendarEventEndingEventType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let s = match self { + Self::Event => "event", + }; + write!(f, "{}", s) + } +} diff --git a/agentmail-types/src/types/calendar_event_id.rs b/agentmail-types/src/types/calendar_event_id.rs new file mode 100644 index 0000000..7db0a6c --- /dev/null +++ b/agentmail-types/src/types/calendar_event_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 CalendarEventId(pub String); \ No newline at end of file diff --git a/agentmail-types/src/types/calendar_event_kind.rs b/agentmail-types/src/types/calendar_event_kind.rs new file mode 100644 index 0000000..8d4e40b --- /dev/null +++ b/agentmail-types/src/types/calendar_event_kind.rs @@ -0,0 +1,55 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// What the event object represents. +/// +/// - `single`: a one-off event, addressed by its UUID. +/// - `series`: the definition of a recurring event, addressed by its UUID. It carries +/// `recurrence`; `start` and `end` describe its first date. +/// - `instance`: one date of a recurring event, addressed by its dated ID. It carries `series_id`, +/// `original_start` and `is_exception`. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum CalendarEventKind { + Single, + Series, + Instance, + /// 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 CalendarEventKind { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::Single => serializer.serialize_str("single"), + Self::Series => serializer.serialize_str("series"), + Self::Instance => serializer.serialize_str("instance"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for CalendarEventKind { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "single" => Ok(Self::Single), + "series" => Ok(Self::Series), + "instance" => Ok(Self::Instance), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for CalendarEventKind { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Single => write!(f, "single"), + Self::Series => write!(f, "series"), + Self::Instance => write!(f, "instance"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/calendar_event_mutation_response.rs b/agentmail-types/src/types/calendar_event_mutation_response.rs new file mode 100644 index 0000000..7ac63b8 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_mutation_response.rs @@ -0,0 +1,46 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct CalendarEventMutationResponse { + pub event: CalendarEvent, + #[serde(default)] + pub operation_id: OperationId, +} + +impl CalendarEventMutationResponse { + pub fn builder() -> CalendarEventMutationResponseBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct CalendarEventMutationResponseBuilder { + event: Option, + operation_id: Option, +} + +impl CalendarEventMutationResponseBuilder { + pub fn event(mut self, value: CalendarEvent) -> Self { + self.event = Some(value); + self + } + + pub fn operation_id(mut self, value: OperationId) -> Self { + self.operation_id = Some(value); + self + } + + /// Consumes the builder and constructs a [`CalendarEventMutationResponse`]. + /// This method will fail if any of the following fields are not set: + /// - [`event`](CalendarEventMutationResponseBuilder::event) + /// - [`operation_id`](CalendarEventMutationResponseBuilder::operation_id) + pub fn build(self) -> Result { + Ok(CalendarEventMutationResponse { + event: self.event.ok_or_else(|| BuildError::missing_field("event"))?, + operation_id: self.operation_id.ok_or_else(|| BuildError::missing_field("operation_id"))?, + }) + } +} diff --git a/agentmail-types/src/types/calendar_event_previous.rs b/agentmail-types/src/types/calendar_event_previous.rs new file mode 100644 index 0000000..be7c378 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_previous.rs @@ -0,0 +1,136 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// The values that a `calendar.event.updated` change replaced, for the fields it changed. Only +/// changed fields appear; a field that had no value before the change is absent. +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] +pub struct CalendarEventPrevious { + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub all_day: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub start: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub end: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub timezone: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub duration_mode: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub recurrence: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub attendees: Option>, +} + +impl CalendarEventPrevious { + pub fn builder() -> CalendarEventPreviousBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct CalendarEventPreviousBuilder { + title: Option, + description: Option, + location: Option, + metadata: Option, + status: Option, + all_day: Option, + start: Option, + end: Option, + timezone: Option, + duration_mode: Option, + recurrence: Option, + attendees: Option>, +} + +impl CalendarEventPreviousBuilder { + pub fn title(mut self, value: impl Into) -> Self { + self.title = Some(value.into()); + self + } + + pub fn description(mut self, value: impl Into) -> Self { + self.description = Some(value.into()); + self + } + + pub fn location(mut self, value: impl Into) -> Self { + self.location = Some(value.into()); + self + } + + pub fn metadata(mut self, value: serde_json::Value) -> Self { + self.metadata = Some(value); + self + } + + pub fn status(mut self, value: CalendarEventStatus) -> Self { + self.status = Some(value); + self + } + + pub fn all_day(mut self, value: bool) -> Self { + self.all_day = Some(value); + self + } + + pub fn start(mut self, value: WallTime) -> Self { + self.start = Some(value); + self + } + + pub fn end(mut self, value: WallTime) -> Self { + self.end = Some(value); + self + } + + pub fn timezone(mut self, value: IanaTimezone) -> Self { + self.timezone = Some(value); + self + } + + pub fn duration_mode(mut self, value: DurationMode) -> Self { + self.duration_mode = Some(value); + self + } + + pub fn recurrence(mut self, value: Recurrence) -> Self { + self.recurrence = Some(value); + self + } + + pub fn attendees(mut self, value: Vec) -> Self { + self.attendees = Some(value); + self + } + + /// Consumes the builder and constructs a [`CalendarEventPrevious`]. + pub fn build(self) -> Result { + Ok(CalendarEventPrevious { + title: self.title, + description: self.description, + location: self.location, + metadata: self.metadata, + status: self.status, + all_day: self.all_day, + start: self.start, + end: self.end, + timezone: self.timezone, + duration_mode: self.duration_mode, + recurrence: self.recurrence, + attendees: self.attendees, + }) + } +} diff --git a/agentmail-types/src/types/calendar_event_responded_event.rs b/agentmail-types/src/types/calendar_event_responded_event.rs new file mode 100644 index 0000000..f58237b --- /dev/null +++ b/agentmail-types/src/types/calendar_event_responded_event.rs @@ -0,0 +1,77 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// An attendee's response changed: the inbox responded with the respond endpoint, or an attendee +/// replied by email to an invitation the inbox sent. `calendar_event.attendees` holds the new +/// statuses. +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct CalendarEventRespondedEvent { + pub r#type: CalendarEventRespondedEventType, + pub event_type: CalendarEventRespondedEventEventType, + #[serde(default)] + pub event_id: EventId, + #[serde(default)] + pub inbox_id: InboxesInboxId, + pub calendar_event: CalendarEvent, +} + +impl CalendarEventRespondedEvent { + pub fn builder() -> CalendarEventRespondedEventBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct CalendarEventRespondedEventBuilder { + r#type: Option, + event_type: Option, + event_id: Option, + inbox_id: Option, + calendar_event: Option, +} + +impl CalendarEventRespondedEventBuilder { + pub fn r#type(mut self, value: CalendarEventRespondedEventType) -> Self { + self.r#type = Some(value); + self + } + + pub fn event_type(mut self, value: CalendarEventRespondedEventEventType) -> Self { + self.event_type = Some(value); + self + } + + pub fn event_id(mut self, value: EventId) -> Self { + self.event_id = Some(value); + self + } + + pub fn inbox_id(mut self, value: InboxesInboxId) -> Self { + self.inbox_id = Some(value); + self + } + + pub fn calendar_event(mut self, value: CalendarEvent) -> Self { + self.calendar_event = Some(value); + self + } + + /// Consumes the builder and constructs a [`CalendarEventRespondedEvent`]. + /// This method will fail if any of the following fields are not set: + /// - [`r#type`](CalendarEventRespondedEventBuilder::r#type) + /// - [`event_type`](CalendarEventRespondedEventBuilder::event_type) + /// - [`event_id`](CalendarEventRespondedEventBuilder::event_id) + /// - [`inbox_id`](CalendarEventRespondedEventBuilder::inbox_id) + /// - [`calendar_event`](CalendarEventRespondedEventBuilder::calendar_event) + pub fn build(self) -> Result { + Ok(CalendarEventRespondedEvent { + r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, + event_type: self.event_type.ok_or_else(|| BuildError::missing_field("event_type"))?, + event_id: self.event_id.ok_or_else(|| BuildError::missing_field("event_id"))?, + inbox_id: self.inbox_id.ok_or_else(|| BuildError::missing_field("inbox_id"))?, + calendar_event: self.calendar_event.ok_or_else(|| BuildError::missing_field("calendar_event"))?, + }) + } +} diff --git a/agentmail-types/src/types/calendar_event_responded_event_event_type.rs b/agentmail-types/src/types/calendar_event_responded_event_event_type.rs new file mode 100644 index 0000000..9e1c96c --- /dev/null +++ b/agentmail-types/src/types/calendar_event_responded_event_event_type.rs @@ -0,0 +1,17 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub enum CalendarEventRespondedEventEventType { + #[serde(rename = "calendar.event.responded")] + CalendarEventResponded, +} +impl fmt::Display for CalendarEventRespondedEventEventType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let s = match self { + Self::CalendarEventResponded => "calendar.event.responded", + }; + write!(f, "{}", s) + } +} diff --git a/agentmail-types/src/types/calendar_event_responded_event_type.rs b/agentmail-types/src/types/calendar_event_responded_event_type.rs new file mode 100644 index 0000000..296a703 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_responded_event_type.rs @@ -0,0 +1,17 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub enum CalendarEventRespondedEventType { + #[serde(rename = "event")] + Event, +} +impl fmt::Display for CalendarEventRespondedEventType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let s = match self { + Self::Event => "event", + }; + write!(f, "{}", s) + } +} diff --git a/agentmail-types/src/types/calendar_event_source.rs b/agentmail-types/src/types/calendar_event_source.rs new file mode 100644 index 0000000..6cabda1 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_source.rs @@ -0,0 +1,47 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Where the event came from. `api` events were created through this API and the inbox is their +/// organizer. `email` events were created from a calendar invitation (iMIP) received by the inbox; +/// their organizer is the sender of the invitation. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum CalendarEventSource { + Api, + Email, + /// 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 CalendarEventSource { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::Api => serializer.serialize_str("api"), + Self::Email => serializer.serialize_str("email"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for CalendarEventSource { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "api" => Ok(Self::Api), + "email" => Ok(Self::Email), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for CalendarEventSource { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Api => write!(f, "api"), + Self::Email => write!(f, "email"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/calendar_event_starting_event.rs b/agentmail-types/src/types/calendar_event_starting_event.rs new file mode 100644 index 0000000..b095133 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_starting_event.rs @@ -0,0 +1,93 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// An event, or one date of a recurring event, has started. Usually sent within a minute after +/// `scheduled_at`. If a date is first picked up after it has already ended and more than 5 +/// minutes after its start (for example, an event created entirely in the past), neither its +/// `calendar.event.starting` nor its `calendar.event.ending` is sent. Retries carry the same +/// `event_id` and an identical body. +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct CalendarEventStartingEvent { + pub r#type: CalendarEventStartingEventType, + pub event_type: CalendarEventStartingEventEventType, + /// Stable for this date and boundary. Use it to deduplicate deliveries. + #[serde(default)] + pub event_id: EventId, + #[serde(default)] + pub inbox_id: InboxesInboxId, + /// The event or date as it stood when the boundary was first processed. + pub calendar_event: CalendarEvent, + /// The start this webhook is for (the event's `start_at`). + #[serde(default)] + #[serde(with = "crate::core::flexible_datetime::offset")] + pub scheduled_at: DateTime, +} + +impl CalendarEventStartingEvent { + pub fn builder() -> CalendarEventStartingEventBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct CalendarEventStartingEventBuilder { + r#type: Option, + event_type: Option, + event_id: Option, + inbox_id: Option, + calendar_event: Option, + scheduled_at: Option>, +} + +impl CalendarEventStartingEventBuilder { + pub fn r#type(mut self, value: CalendarEventStartingEventType) -> Self { + self.r#type = Some(value); + self + } + + pub fn event_type(mut self, value: CalendarEventStartingEventEventType) -> Self { + self.event_type = Some(value); + self + } + + pub fn event_id(mut self, value: EventId) -> Self { + self.event_id = Some(value); + self + } + + pub fn inbox_id(mut self, value: InboxesInboxId) -> Self { + self.inbox_id = Some(value); + self + } + + pub fn calendar_event(mut self, value: CalendarEvent) -> Self { + self.calendar_event = Some(value); + self + } + + pub fn scheduled_at(mut self, value: DateTime) -> Self { + self.scheduled_at = Some(value); + self + } + + /// Consumes the builder and constructs a [`CalendarEventStartingEvent`]. + /// This method will fail if any of the following fields are not set: + /// - [`r#type`](CalendarEventStartingEventBuilder::r#type) + /// - [`event_type`](CalendarEventStartingEventBuilder::event_type) + /// - [`event_id`](CalendarEventStartingEventBuilder::event_id) + /// - [`inbox_id`](CalendarEventStartingEventBuilder::inbox_id) + /// - [`calendar_event`](CalendarEventStartingEventBuilder::calendar_event) + /// - [`scheduled_at`](CalendarEventStartingEventBuilder::scheduled_at) + pub fn build(self) -> Result { + Ok(CalendarEventStartingEvent { + r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, + event_type: self.event_type.ok_or_else(|| BuildError::missing_field("event_type"))?, + event_id: self.event_id.ok_or_else(|| BuildError::missing_field("event_id"))?, + inbox_id: self.inbox_id.ok_or_else(|| BuildError::missing_field("inbox_id"))?, + calendar_event: self.calendar_event.ok_or_else(|| BuildError::missing_field("calendar_event"))?, + scheduled_at: self.scheduled_at.ok_or_else(|| BuildError::missing_field("scheduled_at"))?, + }) + } +} diff --git a/agentmail-types/src/types/calendar_event_starting_event_event_type.rs b/agentmail-types/src/types/calendar_event_starting_event_event_type.rs new file mode 100644 index 0000000..9ed3938 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_starting_event_event_type.rs @@ -0,0 +1,17 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub enum CalendarEventStartingEventEventType { + #[serde(rename = "calendar.event.starting")] + CalendarEventStarting, +} +impl fmt::Display for CalendarEventStartingEventEventType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let s = match self { + Self::CalendarEventStarting => "calendar.event.starting", + }; + write!(f, "{}", s) + } +} diff --git a/agentmail-types/src/types/calendar_event_starting_event_type.rs b/agentmail-types/src/types/calendar_event_starting_event_type.rs new file mode 100644 index 0000000..4d48d9f --- /dev/null +++ b/agentmail-types/src/types/calendar_event_starting_event_type.rs @@ -0,0 +1,17 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub enum CalendarEventStartingEventType { + #[serde(rename = "event")] + Event, +} +impl fmt::Display for CalendarEventStartingEventType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let s = match self { + Self::Event => "event", + }; + write!(f, "{}", s) + } +} diff --git a/agentmail-types/src/types/calendar_event_status.rs b/agentmail-types/src/types/calendar_event_status.rs new file mode 100644 index 0000000..c357678 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_status.rs @@ -0,0 +1,52 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Status of the event. A `cancelled` event or date stays readable but sends no +/// `calendar.event.starting` or `calendar.event.ending` webhooks (cancelling a date that is +/// already running still sends its `calendar.event.ending`). A date cancelled by deleting its +/// dated ID is removed from the series instead, so reading it can return `404` or `410`. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum CalendarEventStatus { + Confirmed, + Tentative, + Cancelled, + /// 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 CalendarEventStatus { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::Confirmed => serializer.serialize_str("confirmed"), + Self::Tentative => serializer.serialize_str("tentative"), + Self::Cancelled => serializer.serialize_str("cancelled"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for CalendarEventStatus { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "confirmed" => Ok(Self::Confirmed), + "tentative" => Ok(Self::Tentative), + "cancelled" => Ok(Self::Cancelled), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for CalendarEventStatus { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Confirmed => write!(f, "confirmed"), + Self::Tentative => write!(f, "tentative"), + Self::Cancelled => write!(f, "cancelled"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/calendar_event_updated_event.rs b/agentmail-types/src/types/calendar_event_updated_event.rs new file mode 100644 index 0000000..72380ce --- /dev/null +++ b/agentmail-types/src/types/calendar_event_updated_event.rs @@ -0,0 +1,88 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// An event, or one or more dates of a recurring event, changed. `calendar_event` is the event +/// (or the date) after the change. Cancelling dates with a delete on a dated ID also sends this +/// event, with the cancelled date as `calendar_event`. +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] +pub struct CalendarEventUpdatedEvent { + pub r#type: CalendarEventUpdatedEventType, + pub event_type: CalendarEventUpdatedEventEventType, + /// Equals the `operation_id` returned by the request that made the change. + #[serde(default)] + pub event_id: EventId, + #[serde(default)] + pub inbox_id: InboxesInboxId, + pub calendar_event: CalendarEvent, + /// For changes to a one-off or series event, the prior values of the fields that changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub previous: Option, +} + +impl CalendarEventUpdatedEvent { + pub fn builder() -> CalendarEventUpdatedEventBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct CalendarEventUpdatedEventBuilder { + r#type: Option, + event_type: Option, + event_id: Option, + inbox_id: Option, + calendar_event: Option, + previous: Option, +} + +impl CalendarEventUpdatedEventBuilder { + pub fn r#type(mut self, value: CalendarEventUpdatedEventType) -> Self { + self.r#type = Some(value); + self + } + + pub fn event_type(mut self, value: CalendarEventUpdatedEventEventType) -> Self { + self.event_type = Some(value); + self + } + + pub fn event_id(mut self, value: EventId) -> Self { + self.event_id = Some(value); + self + } + + pub fn inbox_id(mut self, value: InboxesInboxId) -> Self { + self.inbox_id = Some(value); + self + } + + pub fn calendar_event(mut self, value: CalendarEvent) -> Self { + self.calendar_event = Some(value); + self + } + + pub fn previous(mut self, value: CalendarEventPrevious) -> Self { + self.previous = Some(value); + self + } + + /// Consumes the builder and constructs a [`CalendarEventUpdatedEvent`]. + /// This method will fail if any of the following fields are not set: + /// - [`r#type`](CalendarEventUpdatedEventBuilder::r#type) + /// - [`event_type`](CalendarEventUpdatedEventBuilder::event_type) + /// - [`event_id`](CalendarEventUpdatedEventBuilder::event_id) + /// - [`inbox_id`](CalendarEventUpdatedEventBuilder::inbox_id) + /// - [`calendar_event`](CalendarEventUpdatedEventBuilder::calendar_event) + pub fn build(self) -> Result { + Ok(CalendarEventUpdatedEvent { + r#type: self.r#type.ok_or_else(|| BuildError::missing_field("r#type"))?, + event_type: self.event_type.ok_or_else(|| BuildError::missing_field("event_type"))?, + event_id: self.event_id.ok_or_else(|| BuildError::missing_field("event_id"))?, + inbox_id: self.inbox_id.ok_or_else(|| BuildError::missing_field("inbox_id"))?, + calendar_event: self.calendar_event.ok_or_else(|| BuildError::missing_field("calendar_event"))?, + previous: self.previous, + }) + } +} diff --git a/agentmail-types/src/types/calendar_event_updated_event_event_type.rs b/agentmail-types/src/types/calendar_event_updated_event_event_type.rs new file mode 100644 index 0000000..6af624a --- /dev/null +++ b/agentmail-types/src/types/calendar_event_updated_event_event_type.rs @@ -0,0 +1,17 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub enum CalendarEventUpdatedEventEventType { + #[serde(rename = "calendar.event.updated")] + CalendarEventUpdated, +} +impl fmt::Display for CalendarEventUpdatedEventEventType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let s = match self { + Self::CalendarEventUpdated => "calendar.event.updated", + }; + write!(f, "{}", s) + } +} diff --git a/agentmail-types/src/types/calendar_event_updated_event_type.rs b/agentmail-types/src/types/calendar_event_updated_event_type.rs new file mode 100644 index 0000000..5d0e3c9 --- /dev/null +++ b/agentmail-types/src/types/calendar_event_updated_event_type.rs @@ -0,0 +1,17 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub enum CalendarEventUpdatedEventType { + #[serde(rename = "event")] + Event, +} +impl fmt::Display for CalendarEventUpdatedEventType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let s = match self { + Self::Event => "event", + }; + write!(f, "{}", s) + } +} diff --git a/agentmail-types/src/types/calendar_limit.rs b/agentmail-types/src/types/calendar_limit.rs new file mode 100644 index 0000000..fcb2559 --- /dev/null +++ b/agentmail-types/src/types/calendar_limit.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 CalendarLimit(pub i64); \ No newline at end of file diff --git a/agentmail-types/src/types/create_calendar_event_request.rs b/agentmail-types/src/types/create_calendar_event_request.rs new file mode 100644 index 0000000..b91d343 --- /dev/null +++ b/agentmail-types/src/types/create_calendar_event_request.rs @@ -0,0 +1,178 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] +pub struct CreateCalendarEventRequest { + /// Your idempotency key for this create. Retrying with the same `client_id` and the same body + /// returns the original event with `200` instead of creating a second one, for as long as the + /// event exists (`404` once it has been deleted). Reusing it with a different body is a `409` + /// `idempotency_conflict`. + #[serde(skip_serializing_if = "Option::is_none")] + pub client_id: Option, + /// Title of the event. 1 to 1,000 characters. + #[serde(default)] + pub title: String, + /// Description of the event. At most 65,536 bytes. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Location of the event. At most 1,024 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option, + /// Your own JSON value (usually an object), returned on reads and in webhooks (except agenda and instance list items, and the webhook for a date cancelled with `DELETE`). Never sent to attendees. At most 16,384 bytes serialized. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option, + /// Defaults to `confirmed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Set to `true` for an all-day event. Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub all_day: Option, + /// Local start time in `timezone`: `YYYY-MM-DDTHH:mm:ss` for timed events, `YYYY-MM-DD` for + /// all-day events. For a recurring event, this is the first date. + #[serde(default)] + pub start: WallTime, + /// Local end time in `timezone`, in the same format as `start`. For timed events it must be + /// after `start`; for all-day events it is the last day (inclusive) and can equal `start`. + /// One-off events can last up to 366 days; each date of a recurring event up to 31 days. + #[serde(default)] + pub end: WallTime, + /// Time zone of `start` and `end`. Defaults to the calendar's `timezone`. + #[serde(skip_serializing_if = "Option::is_none")] + pub timezone: Option, + /// Timed events only. Defaults to `exact` for one-off events and `nominal` for recurring events. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration_mode: Option, + /// Makes this a recurring event. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurrence: Option, + /// Attendees of the event. At most 100. + #[serde(skip_serializing_if = "Option::is_none")] + pub attendees: Option>, + /// When `true`, the inbox emails an invitation (iCalendar `REQUEST`) to every attendee. Defaults + /// to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub send_invites: Option, +} + +impl CreateCalendarEventRequest { + pub fn builder() -> CreateCalendarEventRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct CreateCalendarEventRequestBuilder { + client_id: Option, + title: Option, + description: Option, + location: Option, + metadata: Option, + status: Option, + all_day: Option, + start: Option, + end: Option, + timezone: Option, + duration_mode: Option, + recurrence: Option, + attendees: Option>, + send_invites: Option, +} + +impl CreateCalendarEventRequestBuilder { + pub fn client_id(mut self, value: impl Into) -> Self { + self.client_id = Some(value.into()); + self + } + + pub fn title(mut self, value: impl Into) -> Self { + self.title = Some(value.into()); + self + } + + pub fn description(mut self, value: impl Into) -> Self { + self.description = Some(value.into()); + self + } + + pub fn location(mut self, value: impl Into) -> Self { + self.location = Some(value.into()); + self + } + + pub fn metadata(mut self, value: serde_json::Value) -> Self { + self.metadata = Some(value); + self + } + + pub fn status(mut self, value: CalendarEventStatus) -> Self { + self.status = Some(value); + self + } + + pub fn all_day(mut self, value: bool) -> Self { + self.all_day = Some(value); + self + } + + pub fn start(mut self, value: WallTime) -> Self { + self.start = Some(value); + self + } + + pub fn end(mut self, value: WallTime) -> Self { + self.end = Some(value); + self + } + + pub fn timezone(mut self, value: IanaTimezone) -> Self { + self.timezone = Some(value); + self + } + + pub fn duration_mode(mut self, value: DurationMode) -> Self { + self.duration_mode = Some(value); + self + } + + pub fn recurrence(mut self, value: RecurrenceInput) -> Self { + self.recurrence = Some(value); + self + } + + pub fn attendees(mut self, value: Vec) -> Self { + self.attendees = Some(value); + self + } + + pub fn send_invites(mut self, value: bool) -> Self { + self.send_invites = Some(value); + self + } + + /// Consumes the builder and constructs a [`CreateCalendarEventRequest`]. + /// This method will fail if any of the following fields are not set: + /// - [`title`](CreateCalendarEventRequestBuilder::title) + /// - [`start`](CreateCalendarEventRequestBuilder::start) + /// - [`end`](CreateCalendarEventRequestBuilder::end) + pub fn build(self) -> Result { + Ok(CreateCalendarEventRequest { + client_id: self.client_id, + title: self.title.ok_or_else(|| BuildError::missing_field("title"))?, + description: self.description, + location: self.location, + metadata: self.metadata, + status: self.status, + all_day: self.all_day, + start: self.start.ok_or_else(|| BuildError::missing_field("start"))?, + end: self.end.ok_or_else(|| BuildError::missing_field("end"))?, + timezone: self.timezone, + duration_mode: self.duration_mode, + recurrence: self.recurrence, + attendees: self.attendees, + send_invites: self.send_invites, + }) + } +} + diff --git a/agentmail-types/src/types/create_domain_request.rs b/agentmail-types/src/types/create_domain_request.rs index 76bd25b..4ed58bd 100644 --- a/agentmail-types/src/types/create_domain_request.rs +++ b/agentmail-types/src/types/create_domain_request.rs @@ -11,11 +11,14 @@ pub struct CreateDomainRequest { /// provider is detected. /// This flag does not configure DNS or inbound routing. For shared Google /// Workspace domains, follow the [Google Workspace guide](/google-workspace). + /// Only checked when `inbound_enabled` is true; a send-only domain skips the check. #[serde(skip_serializing_if = "Option::is_none")] pub allow_conflicting_provider: Option, #[serde(skip_serializing_if = "Option::is_none")] pub feedback_enabled: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_enabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub subdomains_enabled: Option, #[serde(skip_serializing_if = "Option::is_none")] pub tracking_enabled: Option, @@ -33,6 +36,7 @@ pub struct CreateDomainRequestBuilder { domain: Option, allow_conflicting_provider: Option, feedback_enabled: Option, + inbound_enabled: Option, subdomains_enabled: Option, tracking_enabled: Option, } @@ -53,6 +57,11 @@ impl CreateDomainRequestBuilder { self } + pub fn inbound_enabled(mut self, value: InboundEnabled) -> Self { + self.inbound_enabled = Some(value); + self + } + pub fn subdomains_enabled(mut self, value: SubdomainsEnabled) -> Self { self.subdomains_enabled = Some(value); self @@ -71,6 +80,7 @@ impl CreateDomainRequestBuilder { domain: self.domain.ok_or_else(|| BuildError::missing_field("domain"))?, allow_conflicting_provider: self.allow_conflicting_provider, feedback_enabled: self.feedback_enabled, + inbound_enabled: self.inbound_enabled, subdomains_enabled: self.subdomains_enabled, tracking_enabled: self.tracking_enabled, }) diff --git a/agentmail-types/src/types/delete_calendar_event_response.rs b/agentmail-types/src/types/delete_calendar_event_response.rs new file mode 100644 index 0000000..901705a --- /dev/null +++ b/agentmail-types/src/types/delete_calendar_event_response.rs @@ -0,0 +1,56 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Deleting a one-off or recurring event (or a `mode=future` delete that covers a whole series) +/// returns `deletion_id`. Deleting dates of a series returns the cancelled date as `event` with an +/// `operation_id`. +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] +pub struct DeleteCalendarEventResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub deletion_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub event: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub operation_id: Option, +} + +impl DeleteCalendarEventResponse { + pub fn builder() -> DeleteCalendarEventResponseBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct DeleteCalendarEventResponseBuilder { + deletion_id: Option, + event: Option, + operation_id: Option, +} + +impl DeleteCalendarEventResponseBuilder { + pub fn deletion_id(mut self, value: DeletionId) -> Self { + self.deletion_id = Some(value); + self + } + + pub fn event(mut self, value: CalendarEvent) -> Self { + self.event = Some(value); + self + } + + pub fn operation_id(mut self, value: OperationId) -> Self { + self.operation_id = Some(value); + self + } + + /// Consumes the builder and constructs a [`DeleteCalendarEventResponse`]. + pub fn build(self) -> Result { + Ok(DeleteCalendarEventResponse { + deletion_id: self.deletion_id, + event: self.event, + operation_id: self.operation_id, + }) + } +} diff --git a/agentmail-types/src/types/delete_event_query_request.rs b/agentmail-types/src/types/delete_event_query_request.rs new file mode 100644 index 0000000..f312e22 --- /dev/null +++ b/agentmail-types/src/types/delete_event_query_request.rs @@ -0,0 +1,47 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Query parameters for delete-event +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct DeleteEventQueryRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// When `true`, emails a cancellation (iCalendar `CANCEL`) to every attendee. Only the organizer can send. Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub send_invites: Option, +} + +impl DeleteEventQueryRequest { + pub fn builder() -> DeleteEventQueryRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct DeleteEventQueryRequestBuilder { + mode: Option, + send_invites: Option, +} + +impl DeleteEventQueryRequestBuilder { + pub fn mode(mut self, value: InstanceMutationMode) -> Self { + self.mode = Some(value); + self + } + + pub fn send_invites(mut self, value: bool) -> Self { + self.send_invites = Some(value); + self + } + + /// Consumes the builder and constructs a [`DeleteEventQueryRequest`]. + pub fn build(self) -> Result { + Ok(DeleteEventQueryRequest { + mode: self.mode, + send_invites: self.send_invites, + }) + } +} + diff --git a/agentmail-types/src/types/deletion_id.rs b/agentmail-types/src/types/deletion_id.rs new file mode 100644 index 0000000..75965e9 --- /dev/null +++ b/agentmail-types/src/types/deletion_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 DeletionId(pub String); \ No newline at end of file diff --git a/agentmail-types/src/types/domain.rs b/agentmail-types/src/types/domain.rs index 7124edd..a52b20a 100644 --- a/agentmail-types/src/types/domain.rs +++ b/agentmail-types/src/types/domain.rs @@ -16,12 +16,16 @@ pub struct Domain { pub reason: Option, #[serde(default)] pub feedback_enabled: FeedbackEnabled, + /// Absent on domains created before this field existed; those receive email. + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_enabled: Option, #[serde(default)] pub subdomains_enabled: SubdomainsEnabled, #[serde(default)] pub tracking_enabled: TrackingEnabled, - /// A list of DNS records required to verify the domain. Includes a - /// wildcard MX record (`*.`) when `subdomains_enabled` is true. + /// A list of DNS records required to verify the domain. Includes the apex + /// MX record unless `inbound_enabled` is false, and a wildcard MX record + /// (`*.`) when `subdomains_enabled` is true. #[serde(default)] pub records: Vec, #[serde(skip_serializing_if = "Option::is_none")] @@ -51,6 +55,7 @@ pub struct DomainBuilder { status: Option, reason: Option, feedback_enabled: Option, + inbound_enabled: Option, subdomains_enabled: Option, tracking_enabled: Option, records: Option>, @@ -90,6 +95,11 @@ impl DomainBuilder { self } + pub fn inbound_enabled(mut self, value: InboundEnabled) -> Self { + self.inbound_enabled = Some(value); + self + } + pub fn subdomains_enabled(mut self, value: SubdomainsEnabled) -> Self { self.subdomains_enabled = Some(value); self @@ -139,6 +149,7 @@ impl DomainBuilder { status: self.status.ok_or_else(|| BuildError::missing_field("status"))?, reason: self.reason, feedback_enabled: self.feedback_enabled.ok_or_else(|| BuildError::missing_field("feedback_enabled"))?, + inbound_enabled: self.inbound_enabled, subdomains_enabled: self.subdomains_enabled.ok_or_else(|| BuildError::missing_field("subdomains_enabled"))?, tracking_enabled: self.tracking_enabled.ok_or_else(|| BuildError::missing_field("tracking_enabled"))?, records: self.records.ok_or_else(|| BuildError::missing_field("records"))?, diff --git a/agentmail-types/src/types/domain_item.rs b/agentmail-types/src/types/domain_item.rs index a27b284..7a03505 100644 --- a/agentmail-types/src/types/domain_item.rs +++ b/agentmail-types/src/types/domain_item.rs @@ -12,6 +12,9 @@ pub struct DomainItem { pub domain: DomainName, #[serde(default)] pub feedback_enabled: FeedbackEnabled, + /// Absent on domains created before this field existed; those receive email. + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_enabled: Option, #[serde(default)] pub subdomains_enabled: SubdomainsEnabled, #[serde(default)] @@ -41,6 +44,7 @@ pub struct DomainItemBuilder { domain_id: Option, domain: Option, feedback_enabled: Option, + inbound_enabled: Option, subdomains_enabled: Option, tracking_enabled: Option, client_id: Option, @@ -69,6 +73,11 @@ impl DomainItemBuilder { self } + pub fn inbound_enabled(mut self, value: InboundEnabled) -> Self { + self.inbound_enabled = Some(value); + self + } + pub fn subdomains_enabled(mut self, value: SubdomainsEnabled) -> Self { self.subdomains_enabled = Some(value); self @@ -109,6 +118,7 @@ impl DomainItemBuilder { domain_id: self.domain_id.ok_or_else(|| BuildError::missing_field("domain_id"))?, domain: self.domain.ok_or_else(|| BuildError::missing_field("domain"))?, feedback_enabled: self.feedback_enabled.ok_or_else(|| BuildError::missing_field("feedback_enabled"))?, + inbound_enabled: self.inbound_enabled, subdomains_enabled: self.subdomains_enabled.ok_or_else(|| BuildError::missing_field("subdomains_enabled"))?, tracking_enabled: self.tracking_enabled.ok_or_else(|| BuildError::missing_field("tracking_enabled"))?, client_id: self.client_id, diff --git a/agentmail-types/src/types/duration_mode.rs b/agentmail-types/src/types/duration_mode.rs new file mode 100644 index 0000000..e44359a --- /dev/null +++ b/agentmail-types/src/types/duration_mode.rs @@ -0,0 +1,51 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// How the event's length is kept when a date crosses a daylight-saving change. +/// +/// - `exact`: the event lasts the same elapsed time. Default for one-off timed events. +/// - `nominal`: the event keeps its wall-clock end time (a 09:00 to 10:00 meeting stays 09:00 to +/// 10:00 local time). Default for recurring timed events. +/// +/// All-day events are always `nominal`. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum DurationMode { + Nominal, + Exact, + /// 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 DurationMode { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::Nominal => serializer.serialize_str("nominal"), + Self::Exact => serializer.serialize_str("exact"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for DurationMode { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "nominal" => Ok(Self::Nominal), + "exact" => Ok(Self::Exact), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for DurationMode { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Nominal => write!(f, "nominal"), + Self::Exact => write!(f, "exact"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/event_type.rs b/agentmail-types/src/types/event_type.rs index f084b44..86d3c56 100644 --- a/agentmail-types/src/types/event_type.rs +++ b/agentmail-types/src/types/event_type.rs @@ -16,6 +16,12 @@ pub enum EventType { MessageRejected, MessageOpened, DomainVerified, + CalendarEventCreated, + CalendarEventUpdated, + CalendarEventDeleted, + CalendarEventResponded, + CalendarEventStarting, + CalendarEventEnding, /// 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. @@ -35,6 +41,12 @@ impl Serialize for EventType { Self::MessageRejected => serializer.serialize_str("message.rejected"), Self::MessageOpened => serializer.serialize_str("message.opened"), Self::DomainVerified => serializer.serialize_str("domain.verified"), + Self::CalendarEventCreated => serializer.serialize_str("calendar.event.created"), + Self::CalendarEventUpdated => serializer.serialize_str("calendar.event.updated"), + Self::CalendarEventDeleted => serializer.serialize_str("calendar.event.deleted"), + Self::CalendarEventResponded => serializer.serialize_str("calendar.event.responded"), + Self::CalendarEventStarting => serializer.serialize_str("calendar.event.starting"), + Self::CalendarEventEnding => serializer.serialize_str("calendar.event.ending"), Self::__Unknown(val) => serializer.serialize_str(val), } } @@ -55,6 +67,12 @@ impl<'de> Deserialize<'de> for EventType { "message.rejected" => Ok(Self::MessageRejected), "message.opened" => Ok(Self::MessageOpened), "domain.verified" => Ok(Self::DomainVerified), + "calendar.event.created" => Ok(Self::CalendarEventCreated), + "calendar.event.updated" => Ok(Self::CalendarEventUpdated), + "calendar.event.deleted" => Ok(Self::CalendarEventDeleted), + "calendar.event.responded" => Ok(Self::CalendarEventResponded), + "calendar.event.starting" => Ok(Self::CalendarEventStarting), + "calendar.event.ending" => Ok(Self::CalendarEventEnding), _ => Ok(Self::__Unknown(value)), } } @@ -74,6 +92,12 @@ impl fmt::Display for EventType { Self::MessageRejected => write!(f, "message.rejected"), Self::MessageOpened => write!(f, "message.opened"), Self::DomainVerified => write!(f, "domain.verified"), + Self::CalendarEventCreated => write!(f, "calendar.event.created"), + Self::CalendarEventUpdated => write!(f, "calendar.event.updated"), + Self::CalendarEventDeleted => write!(f, "calendar.event.deleted"), + Self::CalendarEventResponded => write!(f, "calendar.event.responded"), + Self::CalendarEventStarting => write!(f, "calendar.event.starting"), + Self::CalendarEventEnding => write!(f, "calendar.event.ending"), Self::__Unknown(val) => write!(f, "{}", val), } } diff --git a/agentmail-types/src/types/get_agenda_query_request.rs b/agentmail-types/src/types/get_agenda_query_request.rs new file mode 100644 index 0000000..9fefde1 --- /dev/null +++ b/agentmail-types/src/types/get_agenda_query_request.rs @@ -0,0 +1,82 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Query parameters for get-agenda +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct GetAgendaQueryRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub consistency: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub after: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub before: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub include_overlapping: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub page_token: Option, +} + +impl GetAgendaQueryRequest { + pub fn builder() -> GetAgendaQueryRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct GetAgendaQueryRequestBuilder { + consistency: Option, + after: Option, + before: Option, + include_overlapping: Option, + limit: Option, + page_token: Option, +} + +impl GetAgendaQueryRequestBuilder { + pub fn consistency(mut self, value: CalendarConsistency) -> Self { + self.consistency = Some(value); + self + } + + pub fn after(mut self, value: WindowAfter) -> Self { + self.after = Some(value); + self + } + + pub fn before(mut self, value: WindowBefore) -> Self { + self.before = Some(value); + self + } + + pub fn include_overlapping(mut self, value: IncludeOverlapping) -> Self { + self.include_overlapping = Some(value); + self + } + + pub fn limit(mut self, value: CalendarLimit) -> 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 [`GetAgendaQueryRequest`]. + pub fn build(self) -> Result { + Ok(GetAgendaQueryRequest { + consistency: self.consistency, + after: self.after, + before: self.before, + include_overlapping: self.include_overlapping, + limit: self.limit, + page_token: self.page_token, + }) + } +} + diff --git a/agentmail-types/src/types/get_event_query_request.rs b/agentmail-types/src/types/get_event_query_request.rs new file mode 100644 index 0000000..aa2379f --- /dev/null +++ b/agentmail-types/src/types/get_event_query_request.rs @@ -0,0 +1,37 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Query parameters for get-event +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct GetEventQueryRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub consistency: Option, +} + +impl GetEventQueryRequest { + pub fn builder() -> GetEventQueryRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct GetEventQueryRequestBuilder { + consistency: Option, +} + +impl GetEventQueryRequestBuilder { + pub fn consistency(mut self, value: CalendarConsistency) -> Self { + self.consistency = Some(value); + self + } + + /// Consumes the builder and constructs a [`GetEventQueryRequest`]. + pub fn build(self) -> Result { + Ok(GetEventQueryRequest { + consistency: self.consistency, + }) + } +} + diff --git a/agentmail-types/src/types/iana_timezone.rs b/agentmail-types/src/types/iana_timezone.rs new file mode 100644 index 0000000..3a8c1e7 --- /dev/null +++ b/agentmail-types/src/types/iana_timezone.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 IanaTimezone(pub String); \ No newline at end of file diff --git a/agentmail-types/src/types/inbound_enabled.rs b/agentmail-types/src/types/inbound_enabled.rs new file mode 100644 index 0000000..cb180b7 --- /dev/null +++ b/agentmail-types/src/types/inbound_enabled.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 InboundEnabled(pub bool); \ No newline at end of file diff --git a/agentmail-types/src/types/inboxes_calendar_get_query_request.rs b/agentmail-types/src/types/inboxes_calendar_get_query_request.rs new file mode 100644 index 0000000..5bf7c99 --- /dev/null +++ b/agentmail-types/src/types/inboxes_calendar_get_query_request.rs @@ -0,0 +1,37 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Query parameters for get +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct InboxesCalendarGetQueryRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub consistency: Option, +} + +impl InboxesCalendarGetQueryRequest { + pub fn builder() -> InboxesCalendarGetQueryRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct InboxesCalendarGetQueryRequestBuilder { + consistency: Option, +} + +impl InboxesCalendarGetQueryRequestBuilder { + pub fn consistency(mut self, value: CalendarConsistency) -> Self { + self.consistency = Some(value); + self + } + + /// Consumes the builder and constructs a [`InboxesCalendarGetQueryRequest`]. + pub fn build(self) -> Result { + Ok(InboxesCalendarGetQueryRequest { + consistency: self.consistency, + }) + } +} + diff --git a/agentmail-types/src/types/inboxes_create_inbox_request.rs b/agentmail-types/src/types/inboxes_create_inbox_request.rs index 69559ea..ed8174b 100644 --- a/agentmail-types/src/types/inboxes_create_inbox_request.rs +++ b/agentmail-types/src/types/inboxes_create_inbox_request.rs @@ -16,6 +16,9 @@ pub struct InboxesCreateInboxRequest { pub display_name: Option, #[serde(skip_serializing_if = "Option::is_none")] pub client_id: Option, + /// Set `paused` to create the inbox paused. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, /// Custom metadata to attach to the inbox. #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option, @@ -34,6 +37,7 @@ pub struct InboxesCreateInboxRequestBuilder { domain: Option, display_name: Option, client_id: Option, + status: Option, metadata: Option, } @@ -58,6 +62,11 @@ impl InboxesCreateInboxRequestBuilder { self } + pub fn status(mut self, value: InboxesInboxStatus) -> Self { + self.status = Some(value); + self + } + pub fn metadata(mut self, value: InboxesMetadata) -> Self { self.metadata = Some(value); self @@ -70,6 +79,7 @@ impl InboxesCreateInboxRequestBuilder { domain: self.domain, display_name: self.display_name, client_id: self.client_id, + status: self.status, metadata: self.metadata, }) } diff --git a/agentmail-types/src/types/inboxes_inbox.rs b/agentmail-types/src/types/inboxes_inbox.rs index 52b7287..cdb3bad 100644 --- a/agentmail-types/src/types/inboxes_inbox.rs +++ b/agentmail-types/src/types/inboxes_inbox.rs @@ -14,6 +14,11 @@ pub struct InboxesInbox { pub display_name: Option, #[serde(skip_serializing_if = "Option::is_none")] pub client_id: Option, + /// `paused` when the inbox is paused. Omitted when the inbox is active. + /// Treat any value other than `paused` as an inbox that sends and + /// receives normally. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, /// Custom metadata attached to the inbox. #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option, @@ -41,6 +46,7 @@ pub struct InboxesInboxBuilder { email: Option, display_name: Option, client_id: Option, + status: Option, metadata: Option, updated_at: Option>, created_at: Option>, @@ -72,6 +78,11 @@ impl InboxesInboxBuilder { self } + pub fn status(mut self, value: InboxesInboxStatus) -> Self { + self.status = Some(value); + self + } + pub fn metadata(mut self, value: InboxesMetadata) -> Self { self.metadata = Some(value); self @@ -101,6 +112,7 @@ impl InboxesInboxBuilder { email: self.email.ok_or_else(|| BuildError::missing_field("email"))?, display_name: self.display_name, client_id: self.client_id, + status: self.status, metadata: self.metadata, 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"))?, diff --git a/agentmail-types/src/types/inboxes_inbox_status.rs b/agentmail-types/src/types/inboxes_inbox_status.rs new file mode 100644 index 0000000..88e5445 --- /dev/null +++ b/agentmail-types/src/types/inboxes_inbox_status.rs @@ -0,0 +1,48 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Whether the inbox sends and receives mail. `paused` stops both: sends +/// return `403` with code `inbox_paused`, and incoming mail is not +/// delivered and not bounced, then or on resume. Mail already in the inbox, +/// its drafts, and its API keys are kept. Set `active` to resume. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum InboxesInboxStatus { + Active, + Paused, + /// 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 InboxesInboxStatus { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::Active => serializer.serialize_str("active"), + Self::Paused => serializer.serialize_str("paused"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for InboxesInboxStatus { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "active" => Ok(Self::Active), + "paused" => Ok(Self::Paused), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for InboxesInboxStatus { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Active => write!(f, "active"), + Self::Paused => write!(f, "paused"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/inboxes_update_inbox_request.rs b/agentmail-types/src/types/inboxes_update_inbox_request.rs index c76ec61..a9311cf 100644 --- a/agentmail-types/src/types/inboxes_update_inbox_request.rs +++ b/agentmail-types/src/types/inboxes_update_inbox_request.rs @@ -6,12 +6,17 @@ use super::*; pub struct InboxesUpdateInboxRequest { #[serde(skip_serializing_if = "Option::is_none")] pub display_name: Option, + /// `paused` stops the inbox sending and receiving mail; `active` resumes + /// it. Mail that arrived while the inbox was paused is not delivered on + /// resume. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, /// Metadata to merge into the inbox's existing metadata. Keys you include /// are added or overwritten; keys you omit are left unchanged. To remove a /// single key, send it with a null value. To clear all metadata, send /// `metadata` as null. Sending an empty object is rejected; use null to - /// clear. Each update must include at least one of `display_name` or - /// `metadata`. + /// clear. Each update must include at least one of `display_name`, + /// `status`, or `metadata`. #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option, } @@ -26,6 +31,7 @@ impl InboxesUpdateInboxRequest { #[non_exhaustive] pub struct InboxesUpdateInboxRequestBuilder { display_name: Option, + status: Option, metadata: Option, } @@ -35,6 +41,11 @@ impl InboxesUpdateInboxRequestBuilder { self } + pub fn status(mut self, value: InboxesInboxStatus) -> Self { + self.status = Some(value); + self + } + pub fn metadata(mut self, value: InboxesUpdateMetadata) -> Self { self.metadata = Some(value); self @@ -44,6 +55,7 @@ impl InboxesUpdateInboxRequestBuilder { pub fn build(self) -> Result { Ok(InboxesUpdateInboxRequest { display_name: self.display_name, + status: self.status, metadata: self.metadata, }) } diff --git a/agentmail-types/src/types/include_overlapping.rs b/agentmail-types/src/types/include_overlapping.rs new file mode 100644 index 0000000..6f8c485 --- /dev/null +++ b/agentmail-types/src/types/include_overlapping.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 IncludeOverlapping(pub bool); \ No newline at end of file diff --git a/agentmail-types/src/types/instance_mutation_mode.rs b/agentmail-types/src/types/instance_mutation_mode.rs new file mode 100644 index 0000000..7e94a6b --- /dev/null +++ b/agentmail-types/src/types/instance_mutation_mode.rs @@ -0,0 +1,47 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Which dates a change to a dated event applies to. `single` (default) changes only this date. +/// `future` changes this date and every later date of the series. Applies only to dated event IDs; +/// sending `mode` with a one-off or series UUID is a `400`. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum InstanceMutationMode { + Single, + Future, + /// 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 InstanceMutationMode { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::Single => serializer.serialize_str("single"), + Self::Future => serializer.serialize_str("future"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for InstanceMutationMode { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "single" => Ok(Self::Single), + "future" => Ok(Self::Future), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for InstanceMutationMode { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Single => write!(f, "single"), + Self::Future => write!(f, "future"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/list_calendar_events_response.rs b/agentmail-types/src/types/list_calendar_events_response.rs new file mode 100644 index 0000000..b97c71a --- /dev/null +++ b/agentmail-types/src/types/list_calendar_events_response.rs @@ -0,0 +1,68 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] +pub struct ListCalendarEventsResponse { + #[serde(default)] + pub count: Count, + #[serde(default)] + pub limit: Limit, + #[serde(skip_serializing_if = "Option::is_none")] + pub next_page_token: Option, + /// On List Events, ordered by `updated_at` descending. On Get Agenda and List Event Instances, + /// ordered by `start_at` ascending. + #[serde(default)] + pub events: Vec, +} + +impl ListCalendarEventsResponse { + pub fn builder() -> ListCalendarEventsResponseBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct ListCalendarEventsResponseBuilder { + count: Option, + limit: Option, + next_page_token: Option, + events: Option>, +} + +impl ListCalendarEventsResponseBuilder { + 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 events(mut self, value: Vec) -> Self { + self.events = Some(value); + self + } + + /// Consumes the builder and constructs a [`ListCalendarEventsResponse`]. + /// This method will fail if any of the following fields are not set: + /// - [`count`](ListCalendarEventsResponseBuilder::count) + /// - [`limit`](ListCalendarEventsResponseBuilder::limit) + /// - [`events`](ListCalendarEventsResponseBuilder::events) + pub fn build(self) -> Result { + Ok(ListCalendarEventsResponse { + 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_event_instances_query_request.rs b/agentmail-types/src/types/list_event_instances_query_request.rs new file mode 100644 index 0000000..b19b407 --- /dev/null +++ b/agentmail-types/src/types/list_event_instances_query_request.rs @@ -0,0 +1,82 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Query parameters for list-event-instances +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct ListEventInstancesQueryRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub consistency: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub after: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub before: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub include_overlapping: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub page_token: Option, +} + +impl ListEventInstancesQueryRequest { + pub fn builder() -> ListEventInstancesQueryRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct ListEventInstancesQueryRequestBuilder { + consistency: Option, + after: Option, + before: Option, + include_overlapping: Option, + limit: Option, + page_token: Option, +} + +impl ListEventInstancesQueryRequestBuilder { + pub fn consistency(mut self, value: CalendarConsistency) -> Self { + self.consistency = Some(value); + self + } + + pub fn after(mut self, value: WindowAfter) -> Self { + self.after = Some(value); + self + } + + pub fn before(mut self, value: WindowBefore) -> Self { + self.before = Some(value); + self + } + + pub fn include_overlapping(mut self, value: IncludeOverlapping) -> Self { + self.include_overlapping = Some(value); + self + } + + pub fn limit(mut self, value: CalendarLimit) -> 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 [`ListEventInstancesQueryRequest`]. + pub fn build(self) -> Result { + Ok(ListEventInstancesQueryRequest { + consistency: self.consistency, + after: self.after, + before: self.before, + include_overlapping: self.include_overlapping, + limit: self.limit, + page_token: self.page_token, + }) + } +} + diff --git a/agentmail-types/src/types/list_events_query_request.rs b/agentmail-types/src/types/list_events_query_request.rs new file mode 100644 index 0000000..b31c0ce --- /dev/null +++ b/agentmail-types/src/types/list_events_query_request.rs @@ -0,0 +1,46 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Query parameters for list-events +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct ListEventsQueryRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub page_token: Option, +} + +impl ListEventsQueryRequest { + pub fn builder() -> ListEventsQueryRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct ListEventsQueryRequestBuilder { + limit: Option, + page_token: Option, +} + +impl ListEventsQueryRequestBuilder { + pub fn limit(mut self, value: CalendarLimit) -> 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 [`ListEventsQueryRequest`]. + pub fn build(self) -> Result { + Ok(ListEventsQueryRequest { + limit: self.limit, + page_token: self.page_token, + }) + } +} + diff --git a/agentmail-types/src/types/mod.rs b/agentmail-types/src/types/mod.rs index fa06877..715898d 100644 --- a/agentmail-types/src/types/mod.rs +++ b/agentmail-types/src/types/mod.rs @@ -5,8 +5,8 @@ //! //! ## Type Categories //! -//! - **Request/Response Types**: 117 types for API operations -//! - **Model Types**: 240 types for data representation +//! - **Request/Response Types**: 131 types for API operations +//! - **Model Types**: 288 types for data representation pub mod limit; pub mod count; @@ -35,6 +35,7 @@ pub mod inboxes_client_id; pub mod inboxes_metadata_value; pub mod inboxes_metadata; pub mod inboxes_update_metadata; +pub mod inboxes_inbox_status; pub mod inboxes_inbox; pub mod inboxes_list_inboxes_response; pub mod inboxes_search_inboxes_response; @@ -102,6 +103,7 @@ pub mod create_api_key_request; pub mod create_api_key_result; pub mod update_api_key_request; pub mod app_id; +pub mod app_category; pub mod app; pub mod list_apps_response; pub mod search_apps_response; @@ -120,6 +122,36 @@ pub mod attachment_response; pub mod send_attachment; pub mod scope_type; pub mod identity; +pub mod calendar_event_id; +pub mod calendar_event_kind; +pub mod calendar_event_status; +pub mod calendar_event_source; +pub mod duration_mode; +pub mod wall_time; +pub mod iana_timezone; +pub mod resource_revision; +pub mod operation_id; +pub mod deletion_id; +pub mod calendar_consistency; +pub mod calendar_limit; +pub mod window_after; +pub mod window_before; +pub mod include_overlapping; +pub mod instance_mutation_mode; +pub mod calendar; +pub mod attendee_status; +pub mod attendee_role; +pub mod attendee; +pub mod recurrence_period; +pub mod recurrence_date; +pub mod recurrence_input; +pub mod recurrence; +pub mod calendar_event; +pub mod calendar_event_mutation_response; +pub mod delete_calendar_event_response; +pub mod list_calendar_events_response; +pub mod respond_status; +pub mod precondition_failed_error_response; pub mod domain_id; pub mod domain_name; pub mod record_type; @@ -128,6 +160,7 @@ pub mod record_status; pub mod verification_record; pub mod status; pub mod feedback_enabled; +pub mod inbound_enabled; pub mod subdomains_enabled; pub mod tracking_enabled; pub mod client_id; @@ -194,6 +227,25 @@ pub mod message_opened_event; pub mod domain_verified_event_type; pub mod domain_verified_event_event_type; pub mod domain_verified_event; +pub mod calendar_event_previous; +pub mod calendar_event_created_event_type; +pub mod calendar_event_created_event_event_type; +pub mod calendar_event_created_event; +pub mod calendar_event_updated_event_type; +pub mod calendar_event_updated_event_event_type; +pub mod calendar_event_updated_event; +pub mod calendar_event_deleted_event_type; +pub mod calendar_event_deleted_event_event_type; +pub mod calendar_event_deleted_event; +pub mod calendar_event_responded_event_type; +pub mod calendar_event_responded_event_event_type; +pub mod calendar_event_responded_event; +pub mod calendar_event_starting_event_type; +pub mod calendar_event_starting_event_event_type; +pub mod calendar_event_starting_event; +pub mod calendar_event_ending_event_type; +pub mod calendar_event_ending_event_event_type; +pub mod calendar_event_ending_event; pub mod inbox_event_id; pub mod inbox_event_type; pub mod inbox_event; @@ -313,6 +365,10 @@ pub mod agent_signup_request; pub mod agent_attach_human_request; pub mod agent_verify_request; pub mod connect_app_body; +pub mod update_calendar_request; +pub mod create_calendar_event_request; +pub mod update_calendar_event_request; +pub mod respond_calendar_event_request; pub mod create_draft_request; pub mod update_draft_request; pub mod batch_get_messages_request; @@ -339,6 +395,12 @@ pub mod threads_search_query_request; pub mod threads_get_query_request; pub mod inboxes_accounts_list_query_request; pub mod inboxes_api_keys_list_query_request; +pub mod inboxes_calendar_get_query_request; +pub mod list_events_query_request; +pub mod get_agenda_query_request; +pub mod get_event_query_request; +pub mod delete_event_query_request; +pub mod list_event_instances_query_request; pub mod inboxes_drafts_list_query_request; pub mod inboxes_events_list_query_request; pub mod inboxes_lists_list_query_request; @@ -393,6 +455,7 @@ pub use inboxes_client_id::InboxesClientId; pub use inboxes_metadata_value::InboxesMetadataValue; pub use inboxes_metadata::InboxesMetadata; pub use inboxes_update_metadata::InboxesUpdateMetadata; +pub use inboxes_inbox_status::InboxesInboxStatus; pub use inboxes_inbox::InboxesInbox; pub use inboxes_list_inboxes_response::InboxesListInboxesResponse; pub use inboxes_search_inboxes_response::InboxesSearchInboxesResponse; @@ -460,6 +523,7 @@ pub use create_api_key_request::CreateApiKeyRequest; pub use create_api_key_result::CreateApiKeyResult; pub use update_api_key_request::UpdateApiKeyRequest; pub use app_id::AppId; +pub use app_category::AppCategory; pub use app::App; pub use list_apps_response::ListAppsResponse; pub use search_apps_response::SearchAppsResponse; @@ -478,6 +542,36 @@ pub use attachment_response::AttachmentResponse; pub use send_attachment::SendAttachment; pub use scope_type::ScopeType; pub use identity::Identity; +pub use calendar_event_id::CalendarEventId; +pub use calendar_event_kind::CalendarEventKind; +pub use calendar_event_status::CalendarEventStatus; +pub use calendar_event_source::CalendarEventSource; +pub use duration_mode::DurationMode; +pub use wall_time::WallTime; +pub use iana_timezone::IanaTimezone; +pub use resource_revision::ResourceRevision; +pub use operation_id::OperationId; +pub use deletion_id::DeletionId; +pub use calendar_consistency::CalendarConsistency; +pub use calendar_limit::CalendarLimit; +pub use window_after::WindowAfter; +pub use window_before::WindowBefore; +pub use include_overlapping::IncludeOverlapping; +pub use instance_mutation_mode::InstanceMutationMode; +pub use calendar::Calendar; +pub use attendee_status::AttendeeStatus; +pub use attendee_role::AttendeeRole; +pub use attendee::Attendee; +pub use recurrence_period::RecurrencePeriod; +pub use recurrence_date::RecurrenceDate; +pub use recurrence_input::RecurrenceInput; +pub use recurrence::Recurrence; +pub use calendar_event::CalendarEvent; +pub use calendar_event_mutation_response::CalendarEventMutationResponse; +pub use delete_calendar_event_response::DeleteCalendarEventResponse; +pub use list_calendar_events_response::ListCalendarEventsResponse; +pub use respond_status::RespondStatus; +pub use precondition_failed_error_response::PreconditionFailedErrorResponse; pub use domain_id::DomainId; pub use domain_name::DomainName; pub use record_type::RecordType; @@ -486,6 +580,7 @@ pub use record_status::RecordStatus; pub use verification_record::VerificationRecord; pub use status::Status; pub use feedback_enabled::FeedbackEnabled; +pub use inbound_enabled::InboundEnabled; pub use subdomains_enabled::SubdomainsEnabled; pub use tracking_enabled::TrackingEnabled; pub use client_id::ClientId; @@ -552,6 +647,25 @@ pub use message_opened_event::MessageOpenedEvent; pub use domain_verified_event_type::DomainVerifiedEventType; pub use domain_verified_event_event_type::DomainVerifiedEventEventType; pub use domain_verified_event::DomainVerifiedEvent; +pub use calendar_event_previous::CalendarEventPrevious; +pub use calendar_event_created_event_type::CalendarEventCreatedEventType; +pub use calendar_event_created_event_event_type::CalendarEventCreatedEventEventType; +pub use calendar_event_created_event::CalendarEventCreatedEvent; +pub use calendar_event_updated_event_type::CalendarEventUpdatedEventType; +pub use calendar_event_updated_event_event_type::CalendarEventUpdatedEventEventType; +pub use calendar_event_updated_event::CalendarEventUpdatedEvent; +pub use calendar_event_deleted_event_type::CalendarEventDeletedEventType; +pub use calendar_event_deleted_event_event_type::CalendarEventDeletedEventEventType; +pub use calendar_event_deleted_event::CalendarEventDeletedEvent; +pub use calendar_event_responded_event_type::CalendarEventRespondedEventType; +pub use calendar_event_responded_event_event_type::CalendarEventRespondedEventEventType; +pub use calendar_event_responded_event::CalendarEventRespondedEvent; +pub use calendar_event_starting_event_type::CalendarEventStartingEventType; +pub use calendar_event_starting_event_event_type::CalendarEventStartingEventEventType; +pub use calendar_event_starting_event::CalendarEventStartingEvent; +pub use calendar_event_ending_event_type::CalendarEventEndingEventType; +pub use calendar_event_ending_event_event_type::CalendarEventEndingEventEventType; +pub use calendar_event_ending_event::CalendarEventEndingEvent; pub use inbox_event_id::InboxEventId; pub use inbox_event_type::InboxEventType; pub use inbox_event::InboxEvent; @@ -671,6 +785,10 @@ pub use agent_signup_request::AgentSignupRequest; pub use agent_attach_human_request::AgentAttachHumanRequest; pub use agent_verify_request::AgentVerifyRequest; pub use connect_app_body::ConnectAppBody; +pub use update_calendar_request::UpdateCalendarRequest; +pub use create_calendar_event_request::CreateCalendarEventRequest; +pub use update_calendar_event_request::UpdateCalendarEventRequest; +pub use respond_calendar_event_request::RespondCalendarEventRequest; pub use create_draft_request::CreateDraftRequest; pub use update_draft_request::UpdateDraftRequest; pub use batch_get_messages_request::BatchGetMessagesRequest; @@ -697,6 +815,12 @@ pub use threads_search_query_request::ThreadsSearchQueryRequest; pub use threads_get_query_request::ThreadsGetQueryRequest; pub use inboxes_accounts_list_query_request::InboxesAccountsListQueryRequest; pub use inboxes_api_keys_list_query_request::InboxesApiKeysListQueryRequest; +pub use inboxes_calendar_get_query_request::InboxesCalendarGetQueryRequest; +pub use list_events_query_request::ListEventsQueryRequest; +pub use get_agenda_query_request::GetAgendaQueryRequest; +pub use get_event_query_request::GetEventQueryRequest; +pub use delete_event_query_request::DeleteEventQueryRequest; +pub use list_event_instances_query_request::ListEventInstancesQueryRequest; pub use inboxes_drafts_list_query_request::InboxesDraftsListQueryRequest; pub use inboxes_events_list_query_request::InboxesEventsListQueryRequest; pub use inboxes_lists_list_query_request::InboxesListsListQueryRequest; diff --git a/agentmail-types/src/types/operation_id.rs b/agentmail-types/src/types/operation_id.rs new file mode 100644 index 0000000..107ea3e --- /dev/null +++ b/agentmail-types/src/types/operation_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 OperationId(pub String); \ No newline at end of file diff --git a/agentmail-types/src/types/precondition_failed_error_response.rs b/agentmail-types/src/types/precondition_failed_error_response.rs new file mode 100644 index 0000000..03d22d4 --- /dev/null +++ b/agentmail-types/src/types/precondition_failed_error_response.rs @@ -0,0 +1,84 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct PreconditionFailedErrorResponse { + #[serde(default)] + pub name: ErrorName, + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option, + #[serde(default)] + pub message: ErrorMessage, + /// The resource's current revision. + #[serde(skip_serializing_if = "Option::is_none")] + pub current_revision: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub docs: Option, +} + +impl PreconditionFailedErrorResponse { + pub fn builder() -> PreconditionFailedErrorResponseBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct PreconditionFailedErrorResponseBuilder { + name: Option, + code: Option, + message: Option, + current_revision: Option, + fix: Option, + docs: Option, +} + +impl PreconditionFailedErrorResponseBuilder { + pub fn name(mut self, value: ErrorName) -> Self { + self.name = Some(value); + self + } + + pub fn code(mut self, value: ErrorCode) -> Self { + self.code = Some(value); + self + } + + pub fn message(mut self, value: ErrorMessage) -> Self { + self.message = Some(value); + self + } + + pub fn current_revision(mut self, value: i64) -> Self { + self.current_revision = Some(value); + self + } + + pub fn fix(mut self, value: ErrorFix) -> Self { + self.fix = Some(value); + self + } + + pub fn docs(mut self, value: ErrorDocs) -> Self { + self.docs = Some(value); + self + } + + /// Consumes the builder and constructs a [`PreconditionFailedErrorResponse`]. + /// This method will fail if any of the following fields are not set: + /// - [`name`](PreconditionFailedErrorResponseBuilder::name) + /// - [`message`](PreconditionFailedErrorResponseBuilder::message) + pub fn build(self) -> Result { + Ok(PreconditionFailedErrorResponse { + name: self.name.ok_or_else(|| BuildError::missing_field("name"))?, + code: self.code, + message: self.message.ok_or_else(|| BuildError::missing_field("message"))?, + current_revision: self.current_revision, + fix: self.fix, + docs: self.docs, + }) + } +} diff --git a/agentmail-types/src/types/recurrence.rs b/agentmail-types/src/types/recurrence.rs new file mode 100644 index 0000000..f825948 --- /dev/null +++ b/agentmail-types/src/types/recurrence.rs @@ -0,0 +1,68 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// The recurrence of a series, as stored. +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct Recurrence { + /// Normalized RRULE body, without the `RRULE:` prefix. + #[serde(default)] + pub rule: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub exdates: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub rdates: Option>, + /// Set when the series was ended with a `mode=future` delete: no date starting at or after + /// this wall-clock time occurs. + #[serde(skip_serializing_if = "Option::is_none")] + pub truncate_before: Option, +} + +impl Recurrence { + pub fn builder() -> RecurrenceBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct RecurrenceBuilder { + rule: Option, + exdates: Option>, + rdates: Option>, + truncate_before: Option, +} + +impl RecurrenceBuilder { + pub fn rule(mut self, value: impl Into) -> Self { + self.rule = Some(value.into()); + self + } + + pub fn exdates(mut self, value: Vec) -> Self { + self.exdates = Some(value); + self + } + + pub fn rdates(mut self, value: Vec) -> Self { + self.rdates = Some(value); + self + } + + pub fn truncate_before(mut self, value: WallTime) -> Self { + self.truncate_before = Some(value); + self + } + + /// Consumes the builder and constructs a [`Recurrence`]. + /// This method will fail if any of the following fields are not set: + /// - [`rule`](RecurrenceBuilder::rule) + pub fn build(self) -> Result { + Ok(Recurrence { + rule: self.rule.ok_or_else(|| BuildError::missing_field("rule"))?, + exdates: self.exdates, + rdates: self.rdates, + truncate_before: self.truncate_before, + }) + } +} diff --git a/agentmail-types/src/types/recurrence_date.rs b/agentmail-types/src/types/recurrence_date.rs new file mode 100644 index 0000000..4275388 --- /dev/null +++ b/agentmail-types/src/types/recurrence_date.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 RecurrenceDate { + WallTime(WallTime), + + RecurrencePeriod(RecurrencePeriod), +} + +impl RecurrenceDate { + pub fn is_wall_time(&self) -> bool { + matches!(self, Self::WallTime(_)) + } + + pub fn is_recurrence_period(&self) -> bool { + matches!(self, Self::RecurrencePeriod(_)) + } + + + pub fn as_wall_time(&self) -> Option<&WallTime> { + match self { + Self::WallTime(value) => Some(value), + _ => None, + } + } + + pub fn into_wall_time(self) -> Option { + match self { + Self::WallTime(value) => Some(value), + _ => None, + } + } + + pub fn as_recurrence_period(&self) -> Option<&RecurrencePeriod> { + match self { + Self::RecurrencePeriod(value) => Some(value), + _ => None, + } + } + + pub fn into_recurrence_period(self) -> Option { + match self { + Self::RecurrencePeriod(value) => Some(value), + _ => None, + } + } +} + +impl fmt::Display for RecurrenceDate { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::WallTime(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), + Self::RecurrencePeriod(value) => write!(f, "{}", serde_json::to_string(value).unwrap_or_else(|_| format!("{:?}", value))), + } + } +} diff --git a/agentmail-types/src/types/recurrence_input.rs b/agentmail-types/src/types/recurrence_input.rs new file mode 100644 index 0000000..777492a --- /dev/null +++ b/agentmail-types/src/types/recurrence_input.rs @@ -0,0 +1,68 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Repeats the event. `rule` is an RFC 5545 RRULE, evaluated in the event's `timezone` from the +/// event's `start`. Each date keeps its wall-clock time across daylight-saving changes. +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct RecurrenceInput { + /// RFC 5545 RRULE body, with or without the `RRULE:` prefix, for example + /// `FREQ=WEEKLY;BYDAY=MO,WE,FR` or `FREQ=MONTHLY;BYDAY=-1FR;COUNT=12`. Supported parts: `FREQ`, + /// `INTERVAL` (1 to 366), `COUNT` (1 to 10,000), `UNTIL` (`YYYYMMDD` or `YYYYMMDDTHHMMSSZ`), + /// `WKST`, `BYMONTH`, `BYWEEKNO`, `BYYEARDAY`, `BYMONTHDAY`, `BYDAY`, `BYHOUR`, `BYMINUTE`, + /// `BYSECOND` and `BYSETPOS`. `COUNT` and `UNTIL` are mutually exclusive. The rule is stored in + /// a normalized form, so a response can differ textually from what you sent. At most 512 + /// characters after normalization. + #[serde(default)] + pub rule: String, + /// Dates to skip, matching the original start of a date: `YYYY-MM-DDTHH:mm:ss` for timed events, + /// `YYYY-MM-DD` for all-day events. At most 366. + #[serde(skip_serializing_if = "Option::is_none")] + pub exdates: Option>, + /// Extra dates to add. Timed events take date-times or periods; all-day events take dates. At + /// most 100. + #[serde(skip_serializing_if = "Option::is_none")] + pub rdates: Option>, +} + +impl RecurrenceInput { + pub fn builder() -> RecurrenceInputBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct RecurrenceInputBuilder { + rule: Option, + exdates: Option>, + rdates: Option>, +} + +impl RecurrenceInputBuilder { + pub fn rule(mut self, value: impl Into) -> Self { + self.rule = Some(value.into()); + self + } + + pub fn exdates(mut self, value: Vec) -> Self { + self.exdates = Some(value); + self + } + + pub fn rdates(mut self, value: Vec) -> Self { + self.rdates = Some(value); + self + } + + /// Consumes the builder and constructs a [`RecurrenceInput`]. + /// This method will fail if any of the following fields are not set: + /// - [`rule`](RecurrenceInputBuilder::rule) + pub fn build(self) -> Result { + Ok(RecurrenceInput { + rule: self.rule.ok_or_else(|| BuildError::missing_field("rule"))?, + exdates: self.exdates, + rdates: self.rdates, + }) + } +} diff --git a/agentmail-types/src/types/recurrence_period.rs b/agentmail-types/src/types/recurrence_period.rs new file mode 100644 index 0000000..5bcb7ee --- /dev/null +++ b/agentmail-types/src/types/recurrence_period.rs @@ -0,0 +1,57 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// An extra date (RDATE) given as a period. Specify exactly one of `end` or `duration`. +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct RecurrencePeriod { + #[serde(default)] + pub start: WallTime, + #[serde(skip_serializing_if = "Option::is_none")] + pub end: Option, + /// ISO 8601 duration, for example `PT30M`. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, +} + +impl RecurrencePeriod { + pub fn builder() -> RecurrencePeriodBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct RecurrencePeriodBuilder { + start: Option, + end: Option, + duration: Option, +} + +impl RecurrencePeriodBuilder { + pub fn start(mut self, value: WallTime) -> Self { + self.start = Some(value); + self + } + + pub fn end(mut self, value: WallTime) -> Self { + self.end = Some(value); + self + } + + pub fn duration(mut self, value: impl Into) -> Self { + self.duration = Some(value.into()); + self + } + + /// Consumes the builder and constructs a [`RecurrencePeriod`]. + /// This method will fail if any of the following fields are not set: + /// - [`start`](RecurrencePeriodBuilder::start) + pub fn build(self) -> Result { + Ok(RecurrencePeriod { + start: self.start.ok_or_else(|| BuildError::missing_field("start"))?, + end: self.end, + duration: self.duration, + }) + } +} diff --git a/agentmail-types/src/types/resource_revision.rs b/agentmail-types/src/types/resource_revision.rs new file mode 100644 index 0000000..1af5f24 --- /dev/null +++ b/agentmail-types/src/types/resource_revision.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 ResourceRevision(pub i64); \ No newline at end of file diff --git a/agentmail-types/src/types/respond_calendar_event_request.rs b/agentmail-types/src/types/respond_calendar_event_request.rs new file mode 100644 index 0000000..87d14ae --- /dev/null +++ b/agentmail-types/src/types/respond_calendar_event_request.rs @@ -0,0 +1,59 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] +pub struct RespondCalendarEventRequest { + pub status: RespondStatus, + /// Comment to include with the response. At most 4,096 UTF-8 bytes, with no control characters + /// other than tab, line feed and carriage return; a longer comment returns `400`. It is stored + /// as the inbox's attendee `comment`. + #[serde(skip_serializing_if = "Option::is_none")] + pub comment: Option, + /// When `true` (default), emails the response (iCalendar `REPLY`) to the organizer. + #[serde(skip_serializing_if = "Option::is_none")] + pub send_reply: Option, +} + +impl RespondCalendarEventRequest { + pub fn builder() -> RespondCalendarEventRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct RespondCalendarEventRequestBuilder { + status: Option, + comment: Option, + send_reply: Option, +} + +impl RespondCalendarEventRequestBuilder { + pub fn status(mut self, value: RespondStatus) -> Self { + self.status = Some(value); + self + } + + pub fn comment(mut self, value: impl Into) -> Self { + self.comment = Some(value.into()); + self + } + + pub fn send_reply(mut self, value: bool) -> Self { + self.send_reply = Some(value); + self + } + + /// Consumes the builder and constructs a [`RespondCalendarEventRequest`]. + /// This method will fail if any of the following fields are not set: + /// - [`status`](RespondCalendarEventRequestBuilder::status) + pub fn build(self) -> Result { + Ok(RespondCalendarEventRequest { + status: self.status.ok_or_else(|| BuildError::missing_field("status"))?, + comment: self.comment, + send_reply: self.send_reply, + }) + } +} + diff --git a/agentmail-types/src/types/respond_status.rs b/agentmail-types/src/types/respond_status.rs new file mode 100644 index 0000000..e4224c0 --- /dev/null +++ b/agentmail-types/src/types/respond_status.rs @@ -0,0 +1,49 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +/// Your response to the invitation. +#[non_exhaustive] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum RespondStatus { + Accepted, + Declined, + Tentative, + /// 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 RespondStatus { + fn serialize(&self, serializer: S) -> Result { + match self { + Self::Accepted => serializer.serialize_str("accepted"), + Self::Declined => serializer.serialize_str("declined"), + Self::Tentative => serializer.serialize_str("tentative"), + Self::__Unknown(val) => serializer.serialize_str(val), + } + } +} + +impl<'de> Deserialize<'de> for RespondStatus { + fn deserialize>(deserializer: D) -> Result { + let value = String::deserialize(deserializer)?; + match value.as_str() { + "accepted" => Ok(Self::Accepted), + "declined" => Ok(Self::Declined), + "tentative" => Ok(Self::Tentative), + _ => Ok(Self::__Unknown(value)), + } + } +} + +impl fmt::Display for RespondStatus { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Accepted => write!(f, "accepted"), + Self::Declined => write!(f, "declined"), + Self::Tentative => write!(f, "tentative"), + Self::__Unknown(val) => write!(f, "{}", val), + } + } +} diff --git a/agentmail-types/src/types/update_calendar_event_request.rs b/agentmail-types/src/types/update_calendar_event_request.rs new file mode 100644 index 0000000..a19fb81 --- /dev/null +++ b/agentmail-types/src/types/update_calendar_event_request.rs @@ -0,0 +1,165 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] +pub struct UpdateCalendarEventRequest { + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option, + /// Set to `null` to clear. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Set to `null` to clear. + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option, + /// Replaces the metadata (any JSON value, usually an object). Set to `null` to clear. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Changing `all_day` requires `start`, `end` and `timezone` in the same request. Not accepted for dated event IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub all_day: Option, + /// New start. For a one-off or series UUID, send it together with `end`. Not accepted with `mode=future`. + #[serde(skip_serializing_if = "Option::is_none")] + pub start: Option, + /// New end. For a one-off or series UUID, send it together with `start`. A dated ID accepts `end` alone. + #[serde(skip_serializing_if = "Option::is_none")] + pub end: Option, + /// New time zone. Not accepted for dated event IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub timezone: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub duration_mode: Option, + /// Replaces the recurrence. Set to `null` to turn a series into a one-off event (only when no + /// date of it has been edited). Not accepted for dated event IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurrence: Option, + /// Replaces the attendee list. + #[serde(skip_serializing_if = "Option::is_none")] + pub attendees: Option>, + /// When `true`, emails the updated invitation to every attendee. Only the organizer (an `api` + /// event) can send. Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub send_invites: Option, + #[serde(skip)] + pub mode: Option, +} + +impl UpdateCalendarEventRequest { + pub fn builder() -> UpdateCalendarEventRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct UpdateCalendarEventRequestBuilder { + title: Option, + description: Option, + location: Option, + metadata: Option, + status: Option, + all_day: Option, + start: Option, + end: Option, + timezone: Option, + duration_mode: Option, + recurrence: Option, + attendees: Option>, + send_invites: Option, + mode: Option, +} + +impl UpdateCalendarEventRequestBuilder { + pub fn title(mut self, value: impl Into) -> Self { + self.title = Some(value.into()); + self + } + + pub fn description(mut self, value: impl Into) -> Self { + self.description = Some(value.into()); + self + } + + pub fn location(mut self, value: impl Into) -> Self { + self.location = Some(value.into()); + self + } + + pub fn metadata(mut self, value: serde_json::Value) -> Self { + self.metadata = Some(value); + self + } + + pub fn status(mut self, value: CalendarEventStatus) -> Self { + self.status = Some(value); + self + } + + pub fn all_day(mut self, value: bool) -> Self { + self.all_day = Some(value); + self + } + + pub fn start(mut self, value: WallTime) -> Self { + self.start = Some(value); + self + } + + pub fn end(mut self, value: WallTime) -> Self { + self.end = Some(value); + self + } + + pub fn timezone(mut self, value: IanaTimezone) -> Self { + self.timezone = Some(value); + self + } + + pub fn duration_mode(mut self, value: DurationMode) -> Self { + self.duration_mode = Some(value); + self + } + + pub fn recurrence(mut self, value: RecurrenceInput) -> Self { + self.recurrence = Some(value); + self + } + + pub fn attendees(mut self, value: Vec) -> Self { + self.attendees = Some(value); + self + } + + pub fn send_invites(mut self, value: bool) -> Self { + self.send_invites = Some(value); + self + } + + pub fn mode(mut self, value: InstanceMutationMode) -> Self { + self.mode = Some(value); + self + } + + /// Consumes the builder and constructs a [`UpdateCalendarEventRequest`]. + pub fn build(self) -> Result { + Ok(UpdateCalendarEventRequest { + title: self.title, + description: self.description, + location: self.location, + metadata: self.metadata, + status: self.status, + all_day: self.all_day, + start: self.start, + end: self.end, + timezone: self.timezone, + duration_mode: self.duration_mode, + recurrence: self.recurrence, + attendees: self.attendees, + send_invites: self.send_invites, + mode: self.mode, + }) + } +} + diff --git a/agentmail-types/src/types/update_calendar_request.rs b/agentmail-types/src/types/update_calendar_request.rs new file mode 100644 index 0000000..13c9aa0 --- /dev/null +++ b/agentmail-types/src/types/update_calendar_request.rs @@ -0,0 +1,39 @@ +pub use crate::prelude::*; +#[allow(unused_imports)] +use super::*; + +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] +pub struct UpdateCalendarRequest { + /// New default time zone for events created without a `timezone`. + #[serde(default)] + pub timezone: IanaTimezone, +} + +impl UpdateCalendarRequest { + pub fn builder() -> UpdateCalendarRequestBuilder { + ::default() + } +} + +#[derive(Clone, PartialEq, Default, Debug)] +#[non_exhaustive] +pub struct UpdateCalendarRequestBuilder { + timezone: Option, +} + +impl UpdateCalendarRequestBuilder { + pub fn timezone(mut self, value: IanaTimezone) -> Self { + self.timezone = Some(value); + self + } + + /// Consumes the builder and constructs a [`UpdateCalendarRequest`]. + /// This method will fail if any of the following fields are not set: + /// - [`timezone`](UpdateCalendarRequestBuilder::timezone) + pub fn build(self) -> Result { + Ok(UpdateCalendarRequest { + timezone: self.timezone.ok_or_else(|| BuildError::missing_field("timezone"))?, + }) + } +} + diff --git a/agentmail-types/src/types/update_domain_request.rs b/agentmail-types/src/types/update_domain_request.rs index a591642..acd1406 100644 --- a/agentmail-types/src/types/update_domain_request.rs +++ b/agentmail-types/src/types/update_domain_request.rs @@ -2,16 +2,19 @@ pub use crate::prelude::*; #[allow(unused_imports)] use super::*; -/// Provide at least one of `feedback_enabled`, `subdomains_enabled`, or -/// `tracking_enabled`. Omitted -/// fields are left unchanged; an empty body is rejected. Enabling +/// Provide at least one of `feedback_enabled`, `inbound_enabled`, +/// `subdomains_enabled`, or `tracking_enabled`. Omitted fields are left +/// unchanged; an empty body is rejected. Enabling `inbound_enabled` or /// `subdomains_enabled` on a verified domain returns it to `PENDING` until the -/// newly-required wildcard MX record (`*.`) is published and verified. +/// newly required MX record (the apex MX, or the wildcard `*.`) is +/// published and verified. #[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, Hash)] pub struct UpdateDomainRequest { #[serde(skip_serializing_if = "Option::is_none")] pub feedback_enabled: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_enabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub subdomains_enabled: Option, #[serde(skip_serializing_if = "Option::is_none")] pub tracking_enabled: Option, @@ -27,6 +30,7 @@ impl UpdateDomainRequest { #[non_exhaustive] pub struct UpdateDomainRequestBuilder { feedback_enabled: Option, + inbound_enabled: Option, subdomains_enabled: Option, tracking_enabled: Option, } @@ -37,6 +41,11 @@ impl UpdateDomainRequestBuilder { self } + pub fn inbound_enabled(mut self, value: InboundEnabled) -> Self { + self.inbound_enabled = Some(value); + self + } + pub fn subdomains_enabled(mut self, value: SubdomainsEnabled) -> Self { self.subdomains_enabled = Some(value); self @@ -51,6 +60,7 @@ impl UpdateDomainRequestBuilder { pub fn build(self) -> Result { Ok(UpdateDomainRequest { feedback_enabled: self.feedback_enabled, + inbound_enabled: self.inbound_enabled, subdomains_enabled: self.subdomains_enabled, tracking_enabled: self.tracking_enabled, }) diff --git a/agentmail-types/src/types/wall_time.rs b/agentmail-types/src/types/wall_time.rs new file mode 100644 index 0000000..d526629 --- /dev/null +++ b/agentmail-types/src/types/wall_time.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 WallTime(pub String); \ No newline at end of file diff --git a/agentmail-types/src/types/window_after.rs b/agentmail-types/src/types/window_after.rs new file mode 100644 index 0000000..1416a10 --- /dev/null +++ b/agentmail-types/src/types/window_after.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 WindowAfter( + #[serde(deserialize_with = "crate::core::flexible_datetime::offset::deserialize")] + pub DateTime +); \ No newline at end of file diff --git a/agentmail-types/src/types/window_before.rs b/agentmail-types/src/types/window_before.rs new file mode 100644 index 0000000..85c0877 --- /dev/null +++ b/agentmail-types/src/types/window_before.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 WindowBefore( + #[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 b837c44..6d9d507 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/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 ID of the pending public key it will\nactivate. Read the key with Get API Key. A repeat for the same token,\ninbox, and bearer returns the same key ID. A `403` `AppSignupLimitError`\nmeans the app accepts no more sign-ups from your organization.","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/inboxesAuthorizeInboxResponse"}}}},"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"}}}}},"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 apps, scoped to the API key: an\norganization key sees every account, a pod key its pod's, an inbox key\nits inbox's. Requires `inbox_read`.","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":{"description":"Returns one account by ID. An account outside the key's scope is a 404.\nRequires `inbox_read`.","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/accounts/{account_id}/update":{"patch":{"description":"Updates one account. Set `status` to `disabled` to stop the inbox from\nsigning in at the app again, or to `enabled` to re-enable it.\nIdempotent: disabling an already disabled account keeps its original\n`disabled_at`, and enabling an enabled account is a no-op.\n\nFind the `account_id` with List Accounts. An account exists only after an\ninbox's first sign-in at an app, so it cannot be disabled in advance.\nA disable applies to that inbox at that app whichever sign-in key is\nused: the app's next authorization ends in `access_denied`, and a code\nissued earlier is refused with `invalid_grant`. Access tokens already\nissued stay valid until they expire, and the app's own session is\nunaffected.\n\nRequires `account_update`, which sign-in keys (`type: public_key`) cannot\nhold, so call this with a bearer API key. An account outside the key's\nscope is a 404. A 409 means the account changed during the write; read it\nagain and retry.","operationId":"accounts_update","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"}}}},"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 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":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountRequest"}}}},"x-fern-sdk-group-name":["accounts"],"x-fern-sdk-method-name":"update"}},"/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\n`human_email` is optional. Without it, the inbox can receive email but cannot send to anyone until a human is attached with the attach human endpoint. There is also no way to recover the API key, so store it durably. Calling sign-up again without `human_email` creates a new organization, which needs a different `username`: the original username stays with the lost organization's inbox.\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/human":{"post":{"description":"Attach a human to an unverified agent organization. A 6-digit OTP is sent to the human's email, which you then submit to the verify endpoint.\n\nUse it after signing up without a `human_email`. Once the human is attached, the organization can send email to that human only, and verification lifts the remaining restrictions. For up to 5 minutes after attaching, sends to the human can still be rejected with a `429` daily send limit error while the API key's cached limits catch up. Wait and retry.\n\nCalling it again with the same `human_email` does not rotate the API key. It resends the OTP if it was never delivered, or issues a new one if it expired. While the current OTP is still valid, calling it again keeps that OTP and its attempt count. If all 10 attempts are used up, wait until the OTP expires, 24 hours after it was issued, then call it again for a new one.\n\nCalling it with a different `human_email` replaces the attached human and sends the new human an OTP. An organization can replace its human at most 2 times.\n\nOnly available until the organization is verified.\n\n**CLI:**\n```bash\nagentmail agent attach-human --human-email user@example.com\n```","operationId":"agent_attachHuman","tags":["Agent"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAttachHumanResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Attach Human","servers":[{"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/AgentAttachHumanRequest"}}}},"x-fern-sdk-group-name":["agent"],"x-fern-sdk-method-name":"attach-human"}},"/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 the OTP expired, call the attach human endpoint with the same `human_email` to get a new one without rotating the API key. Once all 10 attempts are used, even the correct OTP is rejected, and attach human keeps returning the same OTP until it expires, so wait for it to expire before asking for a new one. An organization that signed up without a `human_email` has no OTP until a human is attached. 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/CliCreateApiKeyRequest"}}}},"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 `app_connect` and\n`app_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/apps":{"get":{"description":"Lists apps, most popular first.","operationId":"apps_list","tags":["Apps"],"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/ListAppsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"List Apps","servers":[{"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":["apps"],"x-fern-sdk-method-name":"list"}},"/v0/apps/search":{"get":{"description":"Searches apps by name prefix.","operationId":"apps_search","tags":["Apps"],"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/SearchAppsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Search Apps","servers":[{"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":["apps"],"x-fern-sdk-method-name":"search"}},"/v0/apps/{app_id}":{"get":{"description":"Gets one app by ID. An app in the catalog returns its full entry.\nA registered app that the catalog does not list returns its ID and\nname only, without `updated_at`, so anyone holding its ID can still look\nit up. List Apps and Search Apps show catalog entries only.","operationId":"apps_get","tags":["Apps"],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AppId"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/App"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get App","servers":[{"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":["apps"],"x-fern-sdk-method-name":"get"}},"/v0/apps/{app_id}/accounts":{"get":{"description":"Lists accounts at one app, most recent sign-in first.","operationId":"apps_listAccounts","tags":["Apps"],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AppId"}},{"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/ListAppAccountsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"List App 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":["apps"],"x-fern-sdk-method-name":"list-accounts"}},"/v0/apps/{app_id}/connect":{"post":{"description":"Starts signing an inbox in to an app. 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 app.\nA `404` names the missing resource: `App` or `Inbox`.\nA `403` `AppSignupLimitError` means the app accepts no more sign-ups from\nyour organization; sign in with an inbox that already has an account there.","operationId":"apps_connect","tags":["Apps"],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/AppId"}},{"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"}}}},"403":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Connect App","servers":[{"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/ConnectAppBody","nullable":true}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["apps"],"x-fern-sdk-method-name":"connect"}},"/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"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"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}/accounts":{"get":{"description":"Lists accounts held by the inbox, across all apps. Requires `inbox_read`.","operationId":"inboxes_accounts_list","tags":["InboxesAccounts"],"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/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":["inboxes","accounts"],"x-fern-sdk-method-name":"list"}},"/v0/inboxes/{inbox_id}/accounts/{account_id}":{"get":{"description":"Returns one account held by the inbox. An account elsewhere is a 404. Requires\n`inbox_read`.","operationId":"inboxes_accounts_get","tags":["InboxesAccounts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"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":["inboxes","accounts"],"x-fern-sdk-method-name":"get"}},"/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/CliCreateApiKeyRequest"}}}},"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}/metrics/rates":{"get":{"description":"Rolling bounce and complaint rates for the inbox. At each `period`\ngrid point, the bounced (or complained) messages over the preceding\n`window` divided by the messages sent over the same window, with the\nsend count alongside. Account moderation evaluates the organization-wide\nrate, so use the organization endpoint to see the number it acts on;\nthe inbox view shows which inboxes contribute. Defaults to the rolling\n24-hour rate sampled hourly over the last day; `start` must be within\nthe last 90 days, `window` must be a whole multiple of `period`, and\nthe range plus window divided by `period` must not exceed 1000\nbuckets.\n\n**CLI:**\n```bash\nagentmail inboxes metrics query-rates --inbox-id \n```","operationId":"inboxes_metrics_queryRates","tags":["InboxesMetrics"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"rate_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/RateTypes","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/RatePeriod","nullable":true}},{"name":"window","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Window","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/QueryRatesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Rates","servers":[{"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-rates"}},"/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/metrics/rates":{"get":{"description":"Rolling bounce and complaint rates for the organization. At each\n`period` grid point, the bounced (or complained) messages over the\npreceding `window` divided by the messages sent over the same window,\nwith the send count alongside so you can see the volume behind\nit. This is the number AgentMail's account moderation acts on: a\nwarning at a 5% bounce rate and suspension at 10%, evaluated over a\nrolling 24 hours once at least 1,000 messages were sent in that\nwindow. Defaults to the rolling 24-hour rate sampled hourly over the\nlast day; `start` must be within the last 90 days, `window` must be a\nwhole multiple of `period`, and the range plus window divided by\n`period` must not exceed 1000 buckets.\n\n**CLI:**\n```bash\nagentmail metrics query-rates\n```","operationId":"metrics_queryRates","tags":["Metrics"],"parameters":[{"name":"rate_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/RateTypes","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/RatePeriod","nullable":true}},{"name":"window","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Window","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/QueryRatesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Rates","servers":[{"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-rates"}},"/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}/accounts":{"get":{"description":"Lists accounts held by inboxes in the pod, across all apps. Requires `inbox_read`.","operationId":"pods_accounts_list","tags":["PodsAccounts"],"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/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":["pods","accounts"],"x-fern-sdk-method-name":"list"}},"/v0/pods/{pod_id}/accounts/{account_id}":{"get":{"description":"Returns one account held by inboxes in the pod. An account elsewhere is a 404. Requires\n`inbox_read`.","operationId":"pods_accounts_get","tags":["PodsAccounts"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"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":["pods","accounts"],"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/CliCreateApiKeyRequest"}}}},"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"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"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}/metrics/rates":{"get":{"description":"Rolling bounce and complaint rates for the pod. At each `period` grid\npoint, the bounced (or complained) messages over the preceding\n`window` divided by the messages sent over the same window, with the\nsend count alongside. Account moderation evaluates the organization-wide\nrate, so use the organization endpoint to see the number it acts on;\nthe pod view shows which pods contribute. Defaults to the rolling\n24-hour rate sampled hourly over the last day; `start` must be within\nthe last 90 days, `window` must be a whole multiple of `period`, and\nthe range plus window divided by `period` must not exceed 1000\nbuckets.\n\n**CLI:**\n```bash\nagentmail pods metrics query-rates --pod-id \n```","operationId":"pods_metrics_queryRates","tags":["PodsMetrics"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"rate_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/RateTypes","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/RatePeriod","nullable":true}},{"name":"window","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Window","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/QueryRatesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Rates","servers":[{"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-rates"}},"/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/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"]},"inboxesAuthorizeInboxResponse":{"title":"inboxesAuthorizeInboxResponse","type":"object","description":"The authorized sign-in's key ID plus the agent's next step. The key itself\nis read with Get API Key.","properties":{"api_key_id":{"$ref":"#/components/schemas/ApiKeyId","description":"ID of the public key the client will activate."},"instructions":{"type":"string","const":"Authorization complete. Return to browser.","description":"The agent's next step. Nothing further is required from the agent."}},"required":["api_key_id","instructions"]},"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},"pod_id":{"type":"string","nullable":true,"description":"ID of the pod the webhook belongs to: the pod it was created in, or the pod of the inbox it\nbelongs to. Absent for an organization webhook and on some inbox webhooks. This is not the\nlist of pods it receives events for; see `pod_ids`."},"inbox_id":{"type":"string","nullable":true,"description":"ID of the inbox the webhook belongs to, if it was created for an inbox. This is not the list\nof inboxes it receives events for; see `inbox_ids`."},"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,"description":"Pods for which to send events. Maximum 10 per webhook. The webhook receives an event that matches\nany listed pod or inbox, so a listed pod already covers every inbox in it."}},"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` and `enabled` can\nchange.","properties":{"event_types":{"$ref":"#/components/schemas/webhooksUpdateWebhookEventTypes","nullable":true},"enabled":{"type":"boolean","nullable":true,"description":"Set to true to re-enable a webhook that was disabled after repeated failed deliveries, or false\nto disable it. Events that occurred while the webhook was disabled are not redelivered.\nRe-enabling a webhook subscribed to `message.received.spam`, `message.received.blocked`, or\n`message.received.unauthenticated` (or to every event type, with no filter) requires the\nmatching label permissions on the API key."}}},"webhooksUpdatePodWebhookRequest":{"title":"webhooksUpdatePodWebhookRequest","type":"object","description":"Update a pod-scoped webhook. You can adjust which inboxes within the pod it listens to, replace\nits `event_types`, and set `enabled`, but not change the pod scope itself.","properties":{"add_inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true,"description":"Inbox IDs to subscribe to the webhook. This only adds to what the webhook receives: on a webhook\nthat covers its whole pod, it changes nothing. To receive only specific inboxes, create a webhook\nwith `inbox_ids` instead."},"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."},"AccountStatus":{"title":"AccountStatus","type":"string","enum":["disabled"],"description":"`disabled` refuses every new sign-in for the account until it is\nre-enabled. Access tokens already issued are not revoked."},"UpdateAccountStatus":{"title":"UpdateAccountStatus","type":"string","enum":["enabled","disabled"],"description":"Status to set. `disabled` stops the inbox from signing in at the\napp; `enabled` re-enables it. An enabled account reads back with no\n`status`."},"Account":{"title":"Account","type":"object","description":"One inbox signed in at one app.","properties":{"account_id":{"$ref":"#/components/schemas/AccountId"},"app_id":{"$ref":"#/components/schemas/AppId"},"app_name":{"type":"string","nullable":true,"description":"Display name of app."},"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 app."},"last_signed_in_at":{"type":"string","format":"date-time","description":"Time of most recent sign-in at app."},"sign_in_count":{"type":"integer","description":"Number of sign-ins at app."},"status":{"$ref":"#/components/schemas/AccountStatus","nullable":true,"description":"Present only while the account is disabled. Absent means the inbox may sign in."},"disabled_at":{"type":"string","format":"date-time","nullable":true,"description":"Time at which the account was disabled. Present only while `status` is `disabled`."}},"required":["account_id","app_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"]},"UpdateAccountRequest":{"title":"UpdateAccountRequest","type":"object","description":"Fields to change on the account. Fields you omit are left unchanged and\nunknown fields are rejected. Expects at least one field; today that is\n`status`.","properties":{"status":{"$ref":"#/components/schemas/UpdateAccountStatus","nullable":true}}},"AgentSignupRequest":{"title":"AgentSignupRequest","type":"object","description":"Request body to sign up an agent.","properties":{"human_email":{"type":"string","nullable":true,"description":"Email address of the human who owns the agent. A 6-digit OTP will be sent to this address.\nOmit it to get a receive-only inbox: it can receive email but cannot send until a human is attached with the attach human endpoint."},"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":["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"]},"AgentAttachHumanRequest":{"title":"AgentAttachHumanRequest","type":"object","description":"Request body to attach a human to an agent organization.","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."}},"required":["human_email"]},"AgentAttachHumanResponse":{"title":"AgentAttachHumanResponse","type":"object","description":"Response after attaching a human to an agent organization.","properties":{"human_email":{"type":"string","description":"Email address of the attached human."},"instructions":{"type":"string","description":"Next steps for the agent, in plain text."}},"required":["human_email","instructions"]},"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 app's disclosure on the agent's behalf, skipping the\nfirst-use disclosure page. Requires `app_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 `app_connect` and\n`app_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_reply":{"type":"boolean","nullable":true,"description":"Reply and reply-all when the request is signed with a registered public key. Bearer keys reply with `message_send`."},"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."},"app_connect":{"type":"boolean","nullable":true,"description":"Sign in to apps as an inbox: connect an app, authorize an inbox, and mint the\nsign-in keys. Omitted on a new bearer key means false, whatever else the key holds."},"app_share_owner":{"type":"boolean","nullable":true,"description":"Share the organization owner's name and email with apps at sign-in. One permission\nfor both values."},"account_update":{"type":"boolean","nullable":true,"description":"Update accounts: disable or re-enable an inbox's sign-in at an app. Reading accounts\nneeds only `inbox_read`."},"pod_read":{"type":"boolean","nullable":true,"description":"Read pods."},"pod_create":{"type":"boolean","nullable":true,"description":"Create pods."},"pod_update":{"type":"boolean","nullable":true,"description":"Update 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"},"expires_at":{"$ref":"#/components/schemas/ExpiresAt","nullable":true}},"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","description":"`expires_at` must be in the future and is immutable once the key exists.\nOmitted, the new key inherits the authenticating key's expiry, and never\nexpires only when that key never does. A key cannot create one that\noutlives it: an `expires_at` later than the authenticating key's own\nreturns `403`.","properties":{"expires_at":{"$ref":"#/components/schemas/ExpiresAt","nullable":true}},"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"}]},"AppId":{"title":"AppId","type":"string","format":"uuid","description":"ID of app."},"App":{"title":"App","type":"object","description":"An app an inbox can sign in to.","properties":{"app_id":{"$ref":"#/components/schemas/AppId"},"name":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Time at which app 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},"owner_signup_limit":{"type":"integer","nullable":true,"description":"Maximum number of accounts your organization may sign up at this app. Omitted when the app sets no limit. 0 means the app has paused new sign-ups; existing accounts keep signing in."}},"required":["app_id"]},"ListAppsResponse":{"title":"ListAppsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}}},"required":["count","limit","apps"]},"SearchAppsResponse":{"title":"SearchAppsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}}},"required":["count","limit","apps"]},"ListAppAccountsResponse":{"title":"ListAppAccountsResponse","type":"object","properties":{"app":{"$ref":"#/components/schemas/App","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."},"ConnectAppBody":{"title":"ConnectAppBody","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"]},"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":"Signed HTTPS CDN URL to download the attachment bytes. Retrieve a fresh URL when needed rather than storing it permanently."},"text_url":{"type":"string","nullable":true,"description":"Signed HTTPS CDN URL to download extracted plain text, when available. Omitted when no extracted text is available. Expires at the same time as download_url."},"expires_at":{"type":"string","format":"date-time","description":"Time at which download_url and text_url (when present) expire. Retrieve the attachment again to obtain fresh URLs."}},"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"},"allow_conflicting_provider":{"type":"boolean","nullable":true,"description":"Allow registration when the domain already has Google Workspace MX records.\nDefaults to false; registration otherwise returns 422 when a conflicting\nprovider is detected.\nThis flag does not configure DNS or inbound routing. For shared Google\nWorkspace domains, follow the [Google Workspace guide](/google-workspace)."},"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":"CloudFront signed 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":"CloudFront signed 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."},"RateType":{"title":"RateType","type":"string","enum":["bounce","complaint"],"description":"Type of rate. `bounce` is bounced messages divided by messages sent,\ncounting permanent and transient bounces; `complaint` is spam complaints\ndivided by messages sent."},"RateTypes":{"title":"RateTypes","type":"array","items":{"$ref":"#/components/schemas/RateType"},"description":"List of rate types to query. Omit to query both."},"RatePeriod":{"title":"RatePeriod","type":"integer","description":"How often a point is sampled, as a whole number of seconds between 60\nand 86400. Defaults to 3600 (one point per hour)."},"Window":{"title":"Window","type":"integer","description":"How far back each point looks, as a whole number of seconds. Must be a\nwhole multiple of `period`, at most 30 days (2592000). Defaults to 86400\n(a rolling 24-hour rate)."},"RatePoint":{"title":"RatePoint","type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"End of the window the point covers; the window is the `window` seconds before it."},"rate":{"type":"number","format":"double","nullable":true,"description":"Bounced or complained messages divided by messages sent over the\nwindow, as a fraction (0.05 is 5%). Null when nothing was sent in\nthe window."},"sent":{"type":"integer","description":"Messages sent in the window, counted per recipient."}},"required":["timestamp","sent"]},"QueryRatesResponse":{"title":"QueryRatesResponse","type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/RatePoint"}},"description":"Rate series grouped by rate 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"]},"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"]},"CliCreateApiKeyRequest":{"type":"object","description":"Omit `public_key` to mint a bearer key; include it to register a\npublic key. `client_id` and `expires_at` apply only with `public_key`.","properties":{"name":{"$ref":"#/components/schemas/Name"},"permissions":{"$ref":"#/components/schemas/ApiKeyPermissions"},"public_key":{"type":"object","additionalProperties":true,"description":"Public P-256 JWK with exactly `kty` (\"EC\"), `crv` (\"P-256\"), `x`,\nand `y`, as JSON. Registers a public key instead of minting a\nbearer key."},"client_id":{"$ref":"#/components/schemas/PublicKeyClientId"},"expires_at":{"$ref":"#/components/schemas/ExpiresAt"}}}},"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```\n\nTo pause an inbox, set `status` to `paused`; set it back to `active` to\nresume. See [Pausing an inbox](/inboxes#pausing-an-inbox).","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"}}}},"409":{"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`, `status`, 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 ID of the pending public key it will\nactivate. Read the key with Get API Key. A repeat for the same token,\ninbox, and bearer returns the same key ID. A `403` `AppSignupLimitError`\nmeans the app accepts no more sign-ups from your organization.","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/inboxesAuthorizeInboxResponse"}}}},"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"}}}}},"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 apps, scoped to the API key: an\norganization key sees every account, a pod key its pod's, an inbox key\nits inbox's. Requires `inbox_read`.","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":{"description":"Returns one account by ID. An account outside the key's scope is a 404.\nRequires `inbox_read`.","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/accounts/{account_id}/update":{"patch":{"description":"Updates one account. Set `status` to `disabled` to stop the inbox from\nsigning in at the app again, or to `enabled` to re-enable it.\nIdempotent: disabling an already disabled account keeps its original\n`disabled_at`, and enabling an enabled account is a no-op.\n\nFind the `account_id` with List Accounts. An account exists only after an\ninbox's first sign-in at an app, so it cannot be disabled in advance.\nA disable applies to that inbox at that app whichever sign-in key is\nused: the app's next authorization ends in `access_denied`, and a code\nissued earlier is refused with `invalid_grant`. Access tokens already\nissued stay valid until they expire, and the app's own session is\nunaffected.\n\nRequires `account_update`, which sign-in keys (`type: public_key`) cannot\nhold, so call this with a bearer API key. An account outside the key's\nscope is a 404. A 409 means the account changed during the write; read it\nagain and retry.","operationId":"accounts_update","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"}}}},"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 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":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountRequest"}}}},"x-fern-sdk-group-name":["accounts"],"x-fern-sdk-method-name":"update"}},"/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\n`human_email` is optional. Without it, the inbox can receive email but cannot send to anyone until a human is attached with the attach human endpoint or, for a US-region inbox, claims it in the AgentMail Console with the API key (see [How do I claim my agent's inbox?](https://docs.agentmail.to/knowledge-base/claiming-agent-inbox)). There is also no way to recover the API key, so store it durably. Calling sign-up again without `human_email` creates a new organization, which needs a different `username`: the original username stays with the lost organization's inbox.\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/human":{"post":{"description":"Attach a human to an unverified agent organization. A 6-digit OTP is sent to the human's email, which you then submit to the verify endpoint.\n\nUse it after signing up without a `human_email`. Once the human is attached, the organization can send email to that human only, and verification lifts the remaining restrictions. For up to 5 minutes after attaching, sends to the human can still be rejected with a `429` daily send limit error while the API key's cached limits catch up. Wait and retry.\n\nCalling it again with the same `human_email` does not rotate the API key. It resends the OTP if it was never delivered, or issues a new one if it expired. While the current OTP is still valid, calling it again keeps that OTP and its attempt count. If all 10 attempts are used up, wait until the OTP expires, 24 hours after it was issued, then call it again for a new one.\n\nCalling it with a different `human_email` replaces the attached human and sends the new human an OTP. An organization can replace its human at most 2 times.\n\nOnly available until the organization is verified.\n\n**CLI:**\n```bash\nagentmail agent attach-human --human-email user@example.com\n```","operationId":"agent_attachHuman","tags":["Agent"],"parameters":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAttachHumanResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"409":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Attach Human","servers":[{"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/AgentAttachHumanRequest"}}}},"x-fern-sdk-group-name":["agent"],"x-fern-sdk-method-name":"attach-human"}},"/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 the OTP expired, call the attach human endpoint with the same `human_email` to get a new one without rotating the API key. Once all 10 attempts are used, even the correct OTP is rejected, and attach human keeps returning the same OTP until it expires, so wait for it to expire before asking for a new one. An organization that signed up without a `human_email` has no OTP until a human is attached. 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/CliCreateApiKeyRequest"}}}},"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 `app_connect` and\n`app_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/apps":{"get":{"description":"Lists apps, most popular first.","operationId":"apps_list","tags":["Apps"],"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":"category","in":"query","description":"Only apps in this category. A filtered page can hold fewer than `limit` apps while more remain, so page until `next_page_token` is absent. A `page_token` works only with the `category` it was returned for.","required":false,"schema":{"$ref":"#/components/schemas/AppCategory","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAppsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"List Apps","servers":[{"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":["apps"],"x-fern-sdk-method-name":"list"}},"/v0/apps/search":{"get":{"description":"Searches apps by name prefix.","operationId":"apps_search","tags":["Apps"],"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/SearchAppsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Search Apps","servers":[{"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":["apps"],"x-fern-sdk-method-name":"search"}},"/v0/apps/{app_id}":{"get":{"description":"Gets one app by ID or slug. A catalog app returns its full entry.\nA registered app that the catalog does not list returns its ID and\nname only, without `updated_at`, so anyone holding its ID can still look\nit up; a slug finds catalog apps only. List Apps and Search Apps show\ncatalog entries only.","operationId":"apps_get","tags":["Apps"],"parameters":[{"name":"app_id","in":"path","description":"ID of app, or the `slug` of an app in the catalog. A slug ignores case, spaces and punctuation.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/App"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get App","servers":[{"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":["apps"],"x-fern-sdk-method-name":"get"}},"/v0/apps/{app_id}/accounts":{"get":{"description":"Lists accounts at one app, most recent sign-in first.","operationId":"apps_listAccounts","tags":["Apps"],"parameters":[{"name":"app_id","in":"path","description":"ID of app, or the `slug` of an app in the catalog. A slug ignores case, spaces and punctuation.","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/ListAppAccountsResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"List App 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":["apps"],"x-fern-sdk-method-name":"list-accounts"}},"/v0/apps/{app_id}/connect":{"post":{"description":"Starts signing an inbox in to an app. 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 app.\nAn app in the catalog can be named by its `slug`, as in\n`POST /v0/apps/firecrawl/connect`.\nA `404` names the missing resource: `App` or `Inbox`.\nA `403` `AppSignupLimitError` means the app accepts no more sign-ups from\nyour organization; sign in with an inbox that already has an account there.","operationId":"apps_connect","tags":["Apps"],"parameters":[{"name":"app_id","in":"path","description":"ID of app, or the `slug` of an app in the catalog. A slug ignores case, spaces and punctuation.","required":true,"schema":{"type":"string"}},{"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"}}}},"403":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Connect App","servers":[{"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/ConnectAppBody","nullable":true}}}},"x-fern-idempotent":true,"x-fern-sdk-group-name":["apps"],"x-fern-sdk-method-name":"connect"}},"/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"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"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}/accounts":{"get":{"description":"Lists accounts held by the inbox, across all apps. Requires `inbox_read`.","operationId":"inboxes_accounts_list","tags":["InboxesAccounts"],"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/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":["inboxes","accounts"],"x-fern-sdk-method-name":"list"}},"/v0/inboxes/{inbox_id}/accounts/{account_id}":{"get":{"description":"Returns one account held by the inbox. An account elsewhere is a 404. Requires\n`inbox_read`.","operationId":"inboxes_accounts_get","tags":["InboxesAccounts"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"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":["inboxes","accounts"],"x-fern-sdk-method-name":"get"}},"/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/CliCreateApiKeyRequest"}}}},"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}/calendar":{"get":{"description":"Gets the inbox's calendar. Every inbox has one calendar, so this works before any event is\ncreated. Its `etag` (also the `ETag` response header) is the value to send in `If-Match` to\nmake an update conditional.\n\nRequires the `calendar_read` permission. Calendar is in private beta: organizations without\naccess receive a `403`.","operationId":"inboxes_calendar_get","tags":["InboxesCalendar"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"},"example":"scheduler@agentmail.to","examples":{"Example1":{"value":"scheduler@agentmail.to"}}},{"name":"consistency","in":"query","required":false,"schema":{"$ref":"#/components/schemas/CalendarConsistency","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Calendar"},"examples":{"Example1":{"value":{"inbox_id":"scheduler@agentmail.to","timezone":"America/New_York","event_count":2,"created_at":"2026-10-01T16:20:00Z","updated_at":"2026-10-01T16:25:00Z","etag":"\"rv-1\""}}}}}},"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"}}}}},"summary":"Get Calendar","x-fern-availability":"pre-release","servers":[{"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","calendar"],"x-fern-sdk-method-name":"get"},"patch":{"description":"Updates the calendar's default time zone. Existing events keep their own `timezone`; only\nevents created later without a `timezone` use the new default.\n\nRequires the `calendar_update` permission. To make the update conditional, send the\ncalendar's current `etag` in `If-Match`: a stale value returns `412`. Without `If-Match` the\nupdate applies to the calendar as it is.\n\nCalendar is in private beta: organizations without access receive a `403`.","operationId":"inboxes_calendar_update","tags":["InboxesCalendar"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"},"example":"scheduler@agentmail.to","examples":{"Example1":{"value":"scheduler@agentmail.to"}}},{"name":"If-Match","in":"header","description":"The calendar's current `etag`, for example `\"rv-0\"`. Optional; makes the update conditional; `*` matches any current version.","required":false,"schema":{"type":"string","nullable":true},"example":"\"rv-0\"","examples":{"Example1":{"value":"\"rv-0\""}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Calendar"},"examples":{"Example1":{"value":{"inbox_id":"scheduler@agentmail.to","timezone":"America/New_York","event_count":2,"created_at":"2026-10-01T16:20:00Z","updated_at":"2026-10-01T16:25:00Z","etag":"\"rv-1\""}}}}}},"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"}}}},"412":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreconditionFailedErrorResponse"}}}},"413":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Calendar","x-fern-availability":"pre-release","servers":[{"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":{"type":"object","properties":{},"allOf":[{"$ref":"#/components/schemas/UpdateCalendarRequest"}]},"examples":{"Example1":{"value":{"timezone":"America/New_York"}}}}}},"x-fern-sdk-group-name":["inboxes","calendar"],"x-fern-sdk-method-name":"update"}},"/v0/inboxes/{inbox_id}/calendar/events":{"get":{"description":"Lists the events stored on the calendar: one item per one-off or recurring event, plus one\nitem for each edited date of a recurring event (as that dated event, with\n`is_exception: true`). Ordered by most recently updated, and cancelled events are included.\nUse it to sync or manage what you created. To see what is on the calendar in a time window,\nuse Get Agenda.\n\nThe list is always read in the region that serves the request, so it can trail a change made\nmoments earlier by a few seconds. Requires the `calendar_event_read` permission.\n\nCalendar is in private beta: organizations without access receive a `403`.","operationId":"inboxes_calendar_listEvents","tags":["InboxesCalendar"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"},"example":"scheduler@agentmail.to","examples":{"Example1":{"value":"scheduler@agentmail.to"}}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/CalendarLimit","nullable":true},"example":50,"examples":{"Example1":{"value":50}}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCalendarEventsResponse"},"examples":{"Example1":{"value":{"count":2,"limit":50,"events":[{"event_id":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36","kind":"single","title":"Intro call with Acme","description":"Walk Jane through the onboarding plan.","location":"https://meet.example.com/acme-intro","metadata":{"crm_deal_id":"D-1042"},"status":"confirmed","all_day":false,"start":"2026-10-15T14:00:00","end":"2026-10-15T14:30:00","timezone":"America/New_York","duration_mode":"exact","duration_value":1800000,"start_at":"2026-10-15T18:00:00Z","end_at":"2026-10-15T18:30:00Z","attendees":[{"email":"jane@acme.com","name":"Jane Doe","status":"needs_action","role":"required"}],"attendee_count":1,"uid":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","resource_revision":0,"created_at":"2026-10-01T16:30:00Z","updated_at":"2026-10-01T16:30:00Z"},{"event_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47","kind":"series","title":"Team standup","location":"https://meet.example.com/standup","status":"confirmed","all_day":false,"start":"2026-10-05T09:00:00","end":"2026-10-05T09:15:00","timezone":"America/New_York","duration_mode":"nominal","duration_value":900000,"start_at":"2026-10-05T13:00:00Z","end_at":"2026-10-05T13:15:00Z","recurrence":{"rule":"FREQ=WEEKLY;BYDAY=MO,WE,FR"},"attendees":[],"attendee_count":0,"uid":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","resource_revision":0,"created_at":"2026-10-01T16:25:00Z","updated_at":"2026-10-01T16:25:00Z"}]}}}}}},"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"}}}}},"summary":"List Events","x-fern-availability":"pre-release","servers":[{"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","calendar"],"x-fern-sdk-method-name":"list-events"},"post":{"description":"Creates a one-off or recurring event on the inbox's calendar. Times are wall-clock values in\n`timezone` (the calendar's default time zone if omitted); the response also gives each\nboundary as a UTC instant in `start_at` and `end_at`.\n\n`calendar.event.created` is sent once the event is stored, then `calendar.event.starting`\nand `calendar.event.ending` as each date begins and ends. With `send_invites: true` the\ninbox also emails an invitation to every attendee.\n\nPass `client_id` to make retries safe: repeating the request with the same `client_id` and\nbody returns the original event with status `200` instead of `201`, for as long as the event\nexists.\n\nWith `send_invites: true`, each attendee counts as one send against the organization, pod\nand inbox send limits, charged before the event is stored. An over-limit request returns\n`429` `rate_limit_exceeded` and creates nothing. A replay of an earlier create is not\ncharged again.\n\nThe event's `etag` is the value to send in `If-Match` to make a later update or delete\nconditional. Requires the `calendar_event_create` permission.\n\nCalendar is in private beta: organizations without access receive a `403`.","operationId":"inboxes_calendar_createEvent","tags":["InboxesCalendar"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"},"example":"scheduler@agentmail.to","examples":{"One-off event with an invitation":{"value":"scheduler@agentmail.to"},"Recurring event":{"value":"scheduler@agentmail.to"}}}],"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventMutationResponse"},"examples":{"One-off event with an invitation":{"value":{"event":{"event_id":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36","kind":"single","title":"Intro call with Acme","description":"Walk Jane through the onboarding plan.","location":"https://meet.example.com/acme-intro","metadata":{"crm_deal_id":"D-1042"},"status":"confirmed","all_day":false,"start":"2026-10-15T14:00:00","end":"2026-10-15T14:30:00","timezone":"America/New_York","duration_mode":"exact","duration_value":1800000,"start_at":"2026-10-15T18:00:00Z","end_at":"2026-10-15T18:30:00Z","attendees":[{"email":"jane@acme.com","name":"Jane Doe","status":"needs_action","role":"required"}],"attendee_count":1,"uid":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","resource_revision":0,"created_at":"2026-10-01T16:30:00Z","updated_at":"2026-10-01T16:30:00Z","etag":"\"rv-0\""},"operation_id":"0d6f1e2a-9c3b-4d5e-8f7a-6b1c2d3e4f50"}},"Recurring event":{"value":{"event":{"event_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47","kind":"series","title":"Team standup","location":"https://meet.example.com/standup","status":"confirmed","all_day":false,"start":"2026-10-05T09:00:00","end":"2026-10-05T09:15:00","timezone":"America/New_York","duration_mode":"nominal","duration_value":900000,"start_at":"2026-10-05T13:00:00Z","end_at":"2026-10-05T13:15:00Z","recurrence":{"rule":"FREQ=WEEKLY;BYDAY=MO,WE,FR"},"attendees":[],"attendee_count":0,"uid":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","resource_revision":0,"created_at":"2026-10-01T16:25:00Z","updated_at":"2026-10-01T16:25:00Z","etag":"\"rv-0\""},"operation_id":"0d6f1e2a-9c3b-4d5e-8f7a-6b1c2d3e4f50"}}}}}},"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"}}}},"413":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Create Event","x-fern-availability":"pre-release","servers":[{"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/CreateCalendarEventRequest"},"examples":{"One-off event with an invitation":{"value":{"client_id":"intro-acme-2026-10-15","title":"Intro call with Acme","description":"Walk Jane through the onboarding plan.","location":"https://meet.example.com/acme-intro","metadata":{"crm_deal_id":"D-1042"},"start":"2026-10-15T14:00:00","end":"2026-10-15T14:30:00","timezone":"America/New_York","attendees":[{"email":"jane@acme.com","name":"Jane Doe"}],"send_invites":true}},"Recurring event":{"value":{"title":"Team standup","location":"https://meet.example.com/standup","start":"2026-10-05T09:00:00","end":"2026-10-05T09:15:00","timezone":"America/New_York","recurrence":{"rule":"FREQ=WEEKLY;BYDAY=MO,WE,FR"}}}}}}},"x-fern-sdk-group-name":["inboxes","calendar"],"x-fern-sdk-method-name":"create-event"}},"/v0/inboxes/{inbox_id}/calendar/agenda":{"get":{"description":"Lists every date on the calendar in a time window, ordered by start time: one-off events,\nand recurring events expanded into their individual dates, with cancelled dates left out.\nUse it to answer \"what is on the calendar\".\n\nThe window defaults to now through 90 days from now and can be at most 366 days. Items omit\n`description`, `metadata` and `attendees`; get an event by ID for the full object. Dates of\nrecurring events appear only up to about 90 days from now; use List Event Instances for a\nrecurring event's later dates. While a recurring event's dates are being regenerated after a\nschedule change, which takes a few seconds, the agenda can briefly leave out some of them;\ndates that have already started or ended stay as they ran.\n\nThe agenda is read in the region that serves the request, so it can trail a change made\nmoments earlier by a few seconds. Pass `consistency=primary` to read your own change right\naway. Requires the `calendar_event_read` permission.\n\nCalendar is in private beta: organizations without access receive a `403`.","operationId":"inboxes_calendar_getAgenda","tags":["InboxesCalendar"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"},"example":"scheduler@agentmail.to","examples":{"Example1":{"value":"scheduler@agentmail.to"}}},{"name":"consistency","in":"query","required":false,"schema":{"$ref":"#/components/schemas/CalendarConsistency","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/WindowAfter","nullable":true},"example":"2026-10-07T00:00:00Z","examples":{"Example1":{"value":"2026-10-07T00:00:00Z"}}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/WindowBefore","nullable":true},"example":"2026-10-16T00:00:00Z","examples":{"Example1":{"value":"2026-10-16T00:00:00Z"}}},{"name":"include_overlapping","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeOverlapping","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/CalendarLimit","nullable":true},"example":3,"examples":{"Example1":{"value":3}}},{"name":"page_token","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PageToken","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCalendarEventsResponse"},"examples":{"Example1":{"value":{"count":3,"limit":3,"events":[{"event_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261007T090000","kind":"instance","series_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47","original_start":"2026-10-07T09:00:00","original_start_at":"2026-10-07T13:00:00Z","is_exception":false,"title":"Team standup","location":"https://meet.example.com/standup","status":"confirmed","all_day":false,"start":"2026-10-07T09:00:00","end":"2026-10-07T09:15:00","timezone":"America/New_York","duration_mode":"nominal","duration_value":900000,"start_at":"2026-10-07T13:00:00Z","end_at":"2026-10-07T13:15:00Z","attendee_count":0,"uid":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","created_at":"2026-10-01T16:25:00Z","updated_at":"2026-10-01T16:25:00Z"},{"event_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261009T090000","kind":"instance","series_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47","original_start":"2026-10-09T09:00:00","original_start_at":"2026-10-09T13:00:00Z","is_exception":false,"title":"Team standup","location":"https://meet.example.com/standup","status":"confirmed","all_day":false,"start":"2026-10-09T09:00:00","end":"2026-10-09T09:15:00","timezone":"America/New_York","duration_mode":"nominal","duration_value":900000,"start_at":"2026-10-09T13:00:00Z","end_at":"2026-10-09T13:15:00Z","attendee_count":0,"uid":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","created_at":"2026-10-01T16:25:00Z","updated_at":"2026-10-01T16:25:00Z"},{"event_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261012T090000","kind":"instance","series_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47","original_start":"2026-10-12T09:00:00","original_start_at":"2026-10-12T13:00:00Z","is_exception":false,"title":"Team standup","location":"https://meet.example.com/standup","status":"confirmed","all_day":false,"start":"2026-10-12T09:00:00","end":"2026-10-12T09:15:00","timezone":"America/New_York","duration_mode":"nominal","duration_value":900000,"start_at":"2026-10-12T13:00:00Z","end_at":"2026-10-12T13:15:00Z","attendee_count":0,"uid":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","created_at":"2026-10-01T16:25:00Z","updated_at":"2026-10-01T16:25:00Z"}],"next_page_token":"eyJzIjoiMjAyNi0xMC0xMlQxMzowMDowMFoifQ"}}}}}},"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"}}}}},"summary":"Get Agenda","x-fern-availability":"pre-release","servers":[{"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","calendar"],"x-fern-sdk-method-name":"get-agenda"}},"/v0/inboxes/{inbox_id}/calendar/events/{event_id}":{"get":{"description":"Gets an event by its UUID, or one date of a recurring event by its dated ID\n(`_`). A dated ID returns the date as it currently stands, including any edit\nto it, with `kind: instance`.\n\nThe response's `etag` (also the `ETag` header) is the value to send in `If-Match` to make an\nupdate, delete or response to this event or date conditional. Treat it as opaque.\n\nReads can trail a change made moments earlier by a few seconds; pass `consistency=primary`\nto read the latest state of an event or a date. A date that has already started or ended\nreads back as it ran, even if a later change to the series no longer produces it. Requires\nthe `calendar_event_read` permission.\n\nCalendar is in private beta: organizations without access receive a `403`.","operationId":"inboxes_calendar_getEvent","tags":["InboxesCalendar"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"},"example":"scheduler@agentmail.to","examples":{"One-off event":{"value":"scheduler@agentmail.to"},"One date of a series":{"value":"scheduler@agentmail.to"}}},{"name":"event_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/CalendarEventId"},"example":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36","examples":{"One-off event":{"value":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36"},"One date of a series":{"value":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261007T090000"}}},{"name":"consistency","in":"query","required":false,"schema":{"$ref":"#/components/schemas/CalendarConsistency","nullable":true}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEvent"},"examples":{"One-off event":{"value":{"event_id":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36","kind":"single","title":"Intro call with Acme","description":"Walk Jane through the onboarding plan.","location":"https://meet.example.com/acme-intro","metadata":{"crm_deal_id":"D-1042"},"status":"confirmed","all_day":false,"start":"2026-10-15T14:00:00","end":"2026-10-15T14:30:00","timezone":"America/New_York","duration_mode":"exact","duration_value":1800000,"start_at":"2026-10-15T18:00:00Z","end_at":"2026-10-15T18:30:00Z","attendees":[{"email":"jane@acme.com","name":"Jane Doe","status":"needs_action","role":"required"}],"attendee_count":1,"uid":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","resource_revision":0,"created_at":"2026-10-01T16:30:00Z","updated_at":"2026-10-01T16:30:00Z","etag":"\"rv-0\""}},"One date of a series":{"value":{"event_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261007T090000","kind":"instance","series_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47","original_start":"2026-10-07T09:00:00","original_start_at":"2026-10-07T13:00:00Z","is_exception":false,"title":"Team standup","location":"https://meet.example.com/standup","status":"confirmed","all_day":false,"start":"2026-10-07T09:00:00","end":"2026-10-07T09:15:00","timezone":"America/New_York","duration_mode":"nominal","duration_value":900000,"start_at":"2026-10-07T13:00:00Z","end_at":"2026-10-07T13:15:00Z","attendee_count":0,"uid":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","created_at":"2026-10-01T16:25:00Z","updated_at":"2026-10-01T16:25:00Z","attendees":[],"etag":"\"occ-0-0-0-none-none\""}}}}}},"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"}}}},"410":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Get Event","x-fern-availability":"pre-release","servers":[{"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","calendar"],"x-fern-sdk-method-name":"get-event"},"patch":{"description":"Updates an event. Send only the fields to change. To make the update conditional, send the\nevent's current `etag` in `If-Match`: a stale value returns `412`. Without `If-Match` the\nupdate applies to the event as it is; a change that lands while it runs returns `409`\n`race_condition`, so retry. Send `If-Match` when replacing `attendees`, so you don't\noverwrite a response that arrived in the meantime.\n\n- **One-off or series UUID:** changes the event itself. For a series, the change applies to\n every date that has not been edited individually.\n- **Dated ID (`_`):** changes one date (`mode=single`, the default) or that date\n and every later date (`mode=future`). `all_day`, `timezone` and `recurrence` cannot be sent\n for a dated ID.\n\nOnce a date has started, its start can no longer change (409 `event_already_started`), but\nits end and status can; for a one-off or series UUID, send the unchanged `start` with the new\n`end`. Once it has ended, only `title`, `description`, `location`,\n`metadata` and `attendees` can change. During the few seconds a date is starting, schedule\nchanges return 409 `event_starting`; retry shortly.\n\nSends `calendar.event.updated`. With `send_invites: true` the organizer inbox also emails the\nupdated invitation to every attendee. Requires the `calendar_event_update` permission.\n\nEmailing attendees counts one send per attendee against the organization, pod and inbox\nsend limits, charged before the change is saved; an over-limit request returns `429`\n`rate_limit_exceeded` and changes nothing.\n\nCalendar is in private beta: organizations without access receive a `403`.","operationId":"inboxes_calendar_updateEvent","tags":["InboxesCalendar"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"},"example":"scheduler@agentmail.to","examples":{"Reschedule a one-off event":{"value":"scheduler@agentmail.to"},"Move one date of a series":{"value":"scheduler@agentmail.to"}}},{"name":"event_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/CalendarEventId"},"example":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36","examples":{"Reschedule a one-off event":{"value":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36"},"Move one date of a series":{"value":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261007T090000"}}},{"name":"mode","in":"query","required":false,"schema":{"$ref":"#/components/schemas/InstanceMutationMode","nullable":true},"example":"single","examples":{"Move one date of a series":{"value":"single"}}},{"name":"If-Match","in":"header","description":"The event's or date's current `etag`, from the latest read or write response. Optional; makes the update conditional; `*` matches any current version.","required":false,"schema":{"type":"string","nullable":true},"example":"\"rv-0\"","examples":{"Reschedule a one-off event":{"value":"\"rv-0\""},"Move one date of a series":{"value":"\"occ-0-0-0-none-none\""}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventMutationResponse"},"examples":{"Reschedule a one-off event":{"value":{"event":{"event_id":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36","kind":"single","title":"Intro call with Acme","description":"Walk Jane through the onboarding plan.","location":"https://meet.example.com/acme-intro","metadata":{"crm_deal_id":"D-1042"},"status":"confirmed","all_day":false,"start":"2026-10-15T15:00:00","end":"2026-10-15T15:30:00","timezone":"America/New_York","duration_mode":"exact","duration_value":1800000,"start_at":"2026-10-15T19:00:00Z","end_at":"2026-10-15T19:30:00Z","attendees":[{"email":"jane@acme.com","name":"Jane Doe","status":"needs_action","role":"required"}],"attendee_count":1,"uid":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36@agentmail.to","sequence":1,"source":"api","organizer_email":"scheduler@agentmail.to","resource_revision":1,"created_at":"2026-10-01T16:30:00Z","updated_at":"2026-10-02T09:12:00Z","etag":"\"rv-1\""},"operation_id":"0d6f1e2a-9c3b-4d5e-8f7a-6b1c2d3e4f50"}},"Move one date of a series":{"value":{"event":{"event_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261007T090000","kind":"instance","series_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47","original_start":"2026-10-07T09:00:00","original_start_at":"2026-10-07T13:00:00Z","is_exception":true,"title":"Team standup","location":"https://meet.example.com/standup","status":"confirmed","all_day":false,"start":"2026-10-07T10:00:00","end":"2026-10-07T10:15:00","timezone":"America/New_York","duration_mode":"nominal","duration_value":900000,"start_at":"2026-10-07T14:00:00Z","end_at":"2026-10-07T14:15:00Z","attendee_count":0,"uid":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","created_at":"2026-10-02T09:20:00Z","updated_at":"2026-10-02T09:20:00Z","attendees":[],"etag":"\"occ-0-0-1-none-0\""},"operation_id":"0d6f1e2a-9c3b-4d5e-8f7a-6b1c2d3e4f50"}}}}}},"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"}}}},"410":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"412":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreconditionFailedErrorResponse"}}}},"413":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Update Event","x-fern-availability":"pre-release","servers":[{"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":{"type":"object","properties":{},"allOf":[{"$ref":"#/components/schemas/UpdateCalendarEventRequest"}]},"examples":{"Reschedule a one-off event":{"value":{"start":"2026-10-15T15:00:00","end":"2026-10-15T15:30:00","send_invites":true}},"Move one date of a series":{"value":{"start":"2026-10-07T10:00:00","end":"2026-10-07T10:15:00"}}}}}},"x-fern-sdk-group-name":["inboxes","calendar"],"x-fern-sdk-method-name":"update-event"},"delete":{"description":"Deletes an event, or cancels dates of a recurring event.\n\n- **One-off or series UUID:** deletes the event and every date of it. The event disappears\n from reads immediately and is removed in the background; the response is `202` with a\n `deletion_id`. A retry returns the same `deletion_id` while removal runs (send the same\n `Idempotency-Key`, or none and the same `send_invites`); once it has finished, the event\n no longer exists and a retry returns `404`. No `calendar.event.starting` or\n `calendar.event.ending` webhook is sent for the event after the delete is accepted.\n- **Dated ID (`_`):** cancels that date (`mode=single`, the default) or that date\n and every later date (`mode=future`). Returns `202` with the cancelled date. A `mode=future`\n delete from the first date deletes the whole series and returns a `deletion_id` instead.\n A date that is already running still gets its `calendar.event.ending`.\n\nDeleting a one-off or series event sends `calendar.event.deleted`. Cancelling dates sends\n`calendar.event.updated` with the cancelled date. With `send_invites=true` the organizer\ninbox also emails a cancellation to every attendee. Requires the `calendar_event_delete`\npermission. To make the delete conditional, send the current `etag` in `If-Match`.\n\nEmailing cancellations counts one send per attendee against the organization, pod and inbox\nsend limits, charged before the delete; an over-limit request returns `429`\n`rate_limit_exceeded` and deletes nothing.\n\nCalendar is in private beta: organizations without access receive a `403`.","operationId":"inboxes_calendar_deleteEvent","tags":["InboxesCalendar"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"},"example":"scheduler@agentmail.to","examples":{"Delete an event":{"value":"scheduler@agentmail.to"},"Cancel one date of a series":{"value":"scheduler@agentmail.to"}}},{"name":"event_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/CalendarEventId"},"example":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36","examples":{"Delete an event":{"value":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36"},"Cancel one date of a series":{"value":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261007T090000"}}},{"name":"mode","in":"query","required":false,"schema":{"$ref":"#/components/schemas/InstanceMutationMode","nullable":true},"example":"single","examples":{"Cancel one date of a series":{"value":"single"}}},{"name":"send_invites","in":"query","description":"When `true`, emails a cancellation (iCalendar `CANCEL`) to every attendee. Only the organizer can send. Defaults to `false`.","required":false,"schema":{"type":"boolean","nullable":true},"example":true,"examples":{"Delete an event":{"value":true}}},{"name":"If-Match","in":"header","description":"The event's or date's current `etag`. Optional; makes the delete conditional; `*` matches any current version.","required":false,"schema":{"type":"string","nullable":true},"example":"\"rv-1\"","examples":{"Delete an event":{"value":"\"rv-1\""},"Cancel one date of a series":{"value":"\"occ-0-0-0-none-none\""}}},{"name":"Idempotency-Key","in":"header","description":"1 to 128 visible ASCII characters. Optional. Retrying a delete with the same key\nreturns the original result; without a key, retries of the same delete share one\nderived from the event and `send_invites`, so a keyless retry that changes\n`send_invites` is a different delete and returns `404` while removal runs. Keys are\nunique across your organization: reusing one to delete a different event returns\n`409` `idempotency_conflict`.","required":false,"schema":{"type":"string","nullable":true},"example":"delete-intro-acme","examples":{"Delete an event":{"value":"delete-intro-acme"}}}],"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteCalendarEventResponse"},"examples":{"Delete an event":{"value":{"deletion_id":"5e2b7d9f-4a1c-4e8b-b3d6-8c0a2f4e6b19"}},"Cancel one date of a series":{"value":{"event":{"event_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261007T090000","kind":"instance","series_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47","original_start":"2026-10-07T09:00:00","original_start_at":"2026-10-07T13:00:00Z","is_exception":false,"title":"Team standup","location":"https://meet.example.com/standup","status":"cancelled","all_day":false,"start":"2026-10-07T09:00:00","end":"2026-10-07T09:15:00","timezone":"America/New_York","duration_mode":"nominal","duration_value":900000,"start_at":"2026-10-07T13:00:00Z","end_at":"2026-10-07T13:15:00Z","attendee_count":0,"uid":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","created_at":"2026-10-01T16:25:00Z","updated_at":"2026-10-02T09:30:00Z","attendees":[],"etag":"\"occ-1-0-0-none-none\""},"operation_id":"0d6f1e2a-9c3b-4d5e-8f7a-6b1c2d3e4f50"}}}}}},"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"}}}},"410":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"412":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreconditionFailedErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Delete Event","x-fern-availability":"pre-release","servers":[{"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","calendar"],"x-fern-sdk-method-name":"delete-event"}},"/v0/inboxes/{inbox_id}/calendar/events/{event_id}/instances":{"get":{"description":"Lists the dates of one recurring event in a time window, in start order, with each date's\nedits applied. Dates are computed from the rule, so this works for any window up to 366\ndays, including dates far in the future. Cancelled dates are left out.\n\nThe window defaults to now through 90 days from now. Items omit `description`, `metadata`\nand `attendees`; get a date by its ID for the full object. Like other reads, the list can\ntrail a change made moments earlier by a few seconds; pass `consistency=primary` to read\nyour own change right away. Requires the `calendar_event_read` permission.\n\nCalendar is in private beta: organizations without access receive a `403`.","operationId":"inboxes_calendar_listEventInstances","tags":["InboxesCalendar"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"},"example":"scheduler@agentmail.to","examples":{"Example1":{"value":"scheduler@agentmail.to"}}},{"name":"event_id","in":"path","description":"UUID of the recurring event.","required":true,"schema":{"type":"string"},"example":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47","examples":{"Example1":{"value":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47"}}},{"name":"consistency","in":"query","required":false,"schema":{"$ref":"#/components/schemas/CalendarConsistency","nullable":true}},{"name":"after","in":"query","required":false,"schema":{"$ref":"#/components/schemas/WindowAfter","nullable":true},"example":"2026-10-05T00:00:00Z","examples":{"Example1":{"value":"2026-10-05T00:00:00Z"}}},{"name":"before","in":"query","required":false,"schema":{"$ref":"#/components/schemas/WindowBefore","nullable":true},"example":"2026-10-10T00:00:00Z","examples":{"Example1":{"value":"2026-10-10T00:00:00Z"}}},{"name":"include_overlapping","in":"query","required":false,"schema":{"$ref":"#/components/schemas/IncludeOverlapping","nullable":true}},{"name":"limit","in":"query","required":false,"schema":{"$ref":"#/components/schemas/CalendarLimit","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/ListCalendarEventsResponse"},"examples":{"Example1":{"value":{"count":3,"limit":50,"events":[{"event_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261005T090000","kind":"instance","series_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47","original_start":"2026-10-05T09:00:00","original_start_at":"2026-10-05T13:00:00Z","is_exception":false,"title":"Team standup","location":"https://meet.example.com/standup","status":"confirmed","all_day":false,"start":"2026-10-05T09:00:00","end":"2026-10-05T09:15:00","timezone":"America/New_York","duration_mode":"nominal","duration_value":900000,"start_at":"2026-10-05T13:00:00Z","end_at":"2026-10-05T13:15:00Z","attendee_count":0,"uid":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","created_at":"2026-10-01T16:25:00Z","updated_at":"2026-10-01T16:25:00Z"},{"event_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261007T090000","kind":"instance","series_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47","original_start":"2026-10-07T09:00:00","original_start_at":"2026-10-07T13:00:00Z","is_exception":false,"title":"Team standup","location":"https://meet.example.com/standup","status":"confirmed","all_day":false,"start":"2026-10-07T09:00:00","end":"2026-10-07T09:15:00","timezone":"America/New_York","duration_mode":"nominal","duration_value":900000,"start_at":"2026-10-07T13:00:00Z","end_at":"2026-10-07T13:15:00Z","attendee_count":0,"uid":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","created_at":"2026-10-01T16:25:00Z","updated_at":"2026-10-01T16:25:00Z"},{"event_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47_t20261009T090000","kind":"instance","series_id":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47","original_start":"2026-10-09T09:00:00","original_start_at":"2026-10-09T13:00:00Z","is_exception":false,"title":"Team standup","location":"https://meet.example.com/standup","status":"confirmed","all_day":false,"start":"2026-10-09T09:00:00","end":"2026-10-09T09:15:00","timezone":"America/New_York","duration_mode":"nominal","duration_value":900000,"start_at":"2026-10-09T13:00:00Z","end_at":"2026-10-09T13:15:00Z","attendee_count":0,"uid":"7c4e9b2a-1f3d-4a8e-b6c5-2e9d0f1a8b47@agentmail.to","sequence":0,"source":"api","organizer_email":"scheduler@agentmail.to","created_at":"2026-10-01T16:25:00Z","updated_at":"2026-10-01T16:25:00Z"}]}}}}}},"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":"List Event Instances","x-fern-availability":"pre-release","servers":[{"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","calendar"],"x-fern-sdk-method-name":"list-event-instances"}},"/v0/inboxes/{inbox_id}/calendar/events/{event_id}/respond":{"post":{"description":"Accepts, declines or tentatively accepts an invitation the inbox received by email. Pass the\nevent's UUID to respond for every date, or a dated ID to respond for one date only.\n\nOnly works on `email` events where the inbox is an attendee; anything else returns 409\n`calendar_response_invalid`. Updates the inbox's attendee entry and sends\n`calendar.event.responded`. With `send_reply` (default `true`) the inbox emails the response\nto the organizer.\n\nRequires the `calendar_event_update` permission. To make the response conditional, send the\ncurrent `etag` in `If-Match`.\n\nA reply email counts as one send against the organization, pod and inbox send limits,\ncharged before the response is saved; an over-limit request returns `429`\n`rate_limit_exceeded` and changes nothing.\n\nCalendar is in private beta: organizations without access receive a `403`.","operationId":"inboxes_calendar_respondToEvent","tags":["InboxesCalendar"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"},"example":"scheduler@agentmail.to","examples":{"Example1":{"value":"scheduler@agentmail.to"}}},{"name":"event_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/CalendarEventId"},"example":"a1d5c7e9-2b4f-4c6a-9e8d-3f7b1c5a9d20","examples":{"Example1":{"value":"a1d5c7e9-2b4f-4c6a-9e8d-3f7b1c5a9d20"}}},{"name":"If-Match","in":"header","description":"The event's or date's current `etag`. Optional; makes the response conditional; `*` matches any current version.","required":false,"schema":{"type":"string","nullable":true},"example":"\"rv-0\"","examples":{"Example1":{"value":"\"rv-0\""}}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalendarEventMutationResponse"},"examples":{"Example1":{"value":{"event":{"event_id":"a1d5c7e9-2b4f-4c6a-9e8d-3f7b1c5a9d20","kind":"single","title":"Quarterly review","description":"Agenda attached.","status":"confirmed","all_day":false,"start":"2026-10-20T11:00:00","end":"2026-10-20T12:00:00","timezone":"Europe/London","duration_mode":"exact","duration_value":3600000,"start_at":"2026-10-20T10:00:00Z","end_at":"2026-10-20T11:00:00Z","attendees":[{"email":"jane@acme.com","name":"Jane Doe","status":"accepted","role":"required"},{"email":"scheduler@agentmail.to","status":"accepted","role":"required","comment":"See you there.","responded_at":"2026-10-02T08:05:00Z"}],"attendee_count":2,"uid":"4q2m9x8k1v7c@google.com","sequence":0,"source":"email","organizer_email":"jane@acme.com","origin_message_id":"","resource_revision":1,"created_at":"2026-10-02T07:58:00Z","updated_at":"2026-10-02T08:05:00Z","etag":"\"rv-1\""},"operation_id":"0d6f1e2a-9c3b-4d5e-8f7a-6b1c2d3e4f50"}}}}}},"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"}}}},"410":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"412":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreconditionFailedErrorResponse"}}}},"413":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"Respond to Event","x-fern-availability":"pre-release","servers":[{"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":{"type":"object","properties":{},"allOf":[{"$ref":"#/components/schemas/RespondCalendarEventRequest"}]},"examples":{"Example1":{"value":{"status":"accepted","comment":"See you there."}}}}}},"x-fern-sdk-group-name":["inboxes","calendar"],"x-fern-sdk-method-name":"respond-to-event"}},"/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}/metrics/rates":{"get":{"description":"Rolling bounce and complaint rates for the inbox. At each `period`\ngrid point, the bounced (or complained) messages over the preceding\n`window` divided by the messages sent over the same window, with the\nsend count alongside. Account moderation evaluates the organization-wide\nrate, so use the organization endpoint to see the number it acts on;\nthe inbox view shows which inboxes contribute. Defaults to the rolling\n24-hour rate sampled hourly over the last day; `start` must be within\nthe last 90 days, `window` must be a whole multiple of `period`, and\nthe range plus window divided by `period` must not exceed 1000\nbuckets.\n\n**CLI:**\n```bash\nagentmail inboxes metrics query-rates --inbox-id \n```","operationId":"inboxes_metrics_queryRates","tags":["InboxesMetrics"],"parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/inboxesInboxId"}},{"name":"rate_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/RateTypes","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/RatePeriod","nullable":true}},{"name":"window","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Window","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/QueryRatesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Rates","servers":[{"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-rates"}},"/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/metrics/rates":{"get":{"description":"Rolling bounce and complaint rates for the organization. At each\n`period` grid point, the bounced (or complained) messages over the\npreceding `window` divided by the messages sent over the same window,\nwith the send count alongside so you can see the volume behind\nit. This is the number AgentMail's account moderation acts on: a\nwarning at a 5% bounce rate and suspension at 10%, evaluated over a\nrolling 24 hours once at least 1,000 messages were sent in that\nwindow. Defaults to the rolling 24-hour rate sampled hourly over the\nlast day; `start` must be within the last 90 days, `window` must be a\nwhole multiple of `period`, and the range plus window divided by\n`period` must not exceed 1000 buckets.\n\n**CLI:**\n```bash\nagentmail metrics query-rates\n```","operationId":"metrics_queryRates","tags":["Metrics"],"parameters":[{"name":"rate_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/RateTypes","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/RatePeriod","nullable":true}},{"name":"window","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Window","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/QueryRatesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Rates","servers":[{"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-rates"}},"/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}/accounts":{"get":{"description":"Lists accounts held by inboxes in the pod, across all apps. Requires `inbox_read`.","operationId":"pods_accounts_list","tags":["PodsAccounts"],"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/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":["pods","accounts"],"x-fern-sdk-method-name":"list"}},"/v0/pods/{pod_id}/accounts/{account_id}":{"get":{"description":"Returns one account held by inboxes in the pod. An account elsewhere is a 404. Requires\n`inbox_read`.","operationId":"pods_accounts_get","tags":["PodsAccounts"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"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":["pods","accounts"],"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/CliCreateApiKeyRequest"}}}},"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"}}}},"422":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"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"}}}},"409":{"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}/metrics/rates":{"get":{"description":"Rolling bounce and complaint rates for the pod. At each `period` grid\npoint, the bounced (or complained) messages over the preceding\n`window` divided by the messages sent over the same window, with the\nsend count alongside. Account moderation evaluates the organization-wide\nrate, so use the organization endpoint to see the number it acts on;\nthe pod view shows which pods contribute. Defaults to the rolling\n24-hour rate sampled hourly over the last day; `start` must be within\nthe last 90 days, `window` must be a whole multiple of `period`, and\nthe range plus window divided by `period` must not exceed 1000\nbuckets.\n\n**CLI:**\n```bash\nagentmail pods metrics query-rates --pod-id \n```","operationId":"pods_metrics_queryRates","tags":["PodsMetrics"],"parameters":[{"name":"pod_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/podsPodId"}},{"name":"rate_types","in":"query","required":false,"schema":{"$ref":"#/components/schemas/RateTypes","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/RatePeriod","nullable":true}},{"name":"window","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Window","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/QueryRatesResponse"}}}},"400":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}},"summary":"Query Rates","servers":[{"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-rates"}},"/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/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."},"inboxesInboxStatus":{"title":"inboxesInboxStatus","type":"string","enum":["active","paused"],"description":"Whether the inbox sends and receives mail. `paused` stops both: sends\nreturn `403` with code `inbox_paused`, and incoming mail is not\ndelivered and not bounced, then or on resume. Mail already in the inbox,\nits drafts, and its API keys are kept. Set `active` to resume."},"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},"status":{"$ref":"#/components/schemas/inboxesInboxStatus","nullable":true,"description":"`paused` when the inbox is paused. Omitted when the inbox is active.\nTreat any value other than `paused` as an inbox that sends and\nreceives normally."},"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},"status":{"$ref":"#/components/schemas/inboxesInboxStatus","nullable":true,"description":"Set `paused` to create the inbox paused."},"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},"status":{"$ref":"#/components/schemas/inboxesInboxStatus","nullable":true,"description":"`paused` stops the inbox sending and receiving mail; `active` resumes\nit. Mail that arrived while the inbox was paused is not delivered on\nresume."},"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`,\n`status`, or `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"]},"inboxesAuthorizeInboxResponse":{"title":"inboxesAuthorizeInboxResponse","type":"object","description":"The authorized sign-in's key ID plus the agent's next step. The key itself\nis read with Get API Key.","properties":{"api_key_id":{"$ref":"#/components/schemas/ApiKeyId","description":"ID of the public key the client will activate."},"instructions":{"type":"string","const":"Authorization complete. Return to browser.","description":"The agent's next step. Nothing further is required from the agent."}},"required":["api_key_id","instructions"]},"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},"pod_id":{"type":"string","nullable":true,"description":"ID of the pod the webhook belongs to: the pod it was created in, or the pod of the inbox it\nbelongs to. Absent for an organization webhook and on some inbox webhooks. This is not the\nlist of pods it receives events for; see `pod_ids`."},"inbox_id":{"type":"string","nullable":true,"description":"ID of the inbox the webhook belongs to, if it was created for an inbox. This is not the list\nof inboxes it receives events for; see `inbox_ids`."},"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,"description":"Pods for which to send events. Maximum 10 per webhook. The webhook receives an event that matches\nany listed pod or inbox, so a listed pod already covers every inbox in it."}},"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` and `enabled` can\nchange.","properties":{"event_types":{"$ref":"#/components/schemas/webhooksUpdateWebhookEventTypes","nullable":true},"enabled":{"type":"boolean","nullable":true,"description":"Set to true to re-enable a webhook that was disabled after repeated failed deliveries, or false\nto disable it. Events that occurred while the webhook was disabled are not redelivered.\nRe-enabling a webhook subscribed to `message.received.spam`, `message.received.blocked`, or\n`message.received.unauthenticated` (or to every event type, with no filter) requires the\nmatching label permissions on the API key."}}},"webhooksUpdatePodWebhookRequest":{"title":"webhooksUpdatePodWebhookRequest","type":"object","description":"Update a pod-scoped webhook. You can adjust which inboxes within the pod it listens to, replace\nits `event_types`, and set `enabled`, but not change the pod scope itself.","properties":{"add_inbox_ids":{"$ref":"#/components/schemas/InboxIds","nullable":true,"description":"Inbox IDs to subscribe to the webhook. This only adds to what the webhook receives: on a webhook\nthat covers its whole pod, it changes nothing. To receive only specific inboxes, create a webhook\nwith `inbox_ids` instead."},"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."},"AccountStatus":{"title":"AccountStatus","type":"string","enum":["disabled"],"description":"`disabled` refuses every new sign-in for the account until it is\nre-enabled. Access tokens already issued are not revoked."},"UpdateAccountStatus":{"title":"UpdateAccountStatus","type":"string","enum":["enabled","disabled"],"description":"Status to set. `disabled` stops the inbox from signing in at the\napp; `enabled` re-enables it. An enabled account reads back with no\n`status`."},"Account":{"title":"Account","type":"object","description":"One inbox signed in at one app.","properties":{"account_id":{"$ref":"#/components/schemas/AccountId"},"app_id":{"$ref":"#/components/schemas/AppId"},"app_name":{"type":"string","nullable":true,"description":"Display name of app."},"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 app."},"last_signed_in_at":{"type":"string","format":"date-time","description":"Time of most recent sign-in at app."},"sign_in_count":{"type":"integer","description":"Number of sign-ins at app."},"status":{"$ref":"#/components/schemas/AccountStatus","nullable":true,"description":"Present only while the account is disabled. Absent means the inbox may sign in."},"disabled_at":{"type":"string","format":"date-time","nullable":true,"description":"Time at which the account was disabled. Present only while `status` is `disabled`."}},"required":["account_id","app_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"]},"UpdateAccountRequest":{"title":"UpdateAccountRequest","type":"object","description":"Fields to change on the account. Fields you omit are left unchanged and\nunknown fields are rejected. Expects at least one field; today that is\n`status`.","properties":{"status":{"$ref":"#/components/schemas/UpdateAccountStatus","nullable":true}}},"AgentSignupRequest":{"title":"AgentSignupRequest","type":"object","description":"Request body to sign up an agent.","properties":{"human_email":{"type":"string","nullable":true,"description":"Email address of the human who owns the agent. A 6-digit OTP will be sent to this address.\nOmit it to get a receive-only inbox: it can receive email but cannot send until a human is attached with the attach human endpoint."},"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":["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"]},"AgentAttachHumanRequest":{"title":"AgentAttachHumanRequest","type":"object","description":"Request body to attach a human to an agent organization.","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."}},"required":["human_email"]},"AgentAttachHumanResponse":{"title":"AgentAttachHumanResponse","type":"object","description":"Response after attaching a human to an agent organization.","properties":{"human_email":{"type":"string","description":"Email address of the attached human."},"instructions":{"type":"string","description":"Next steps for the agent, in plain text."}},"required":["human_email","instructions"]},"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 app's disclosure on the agent's behalf, skipping the\nfirst-use disclosure page. Requires `app_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 `app_connect` and\n`app_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_reply":{"type":"boolean","nullable":true,"description":"Reply and reply-all when the request is signed with a registered public key. Bearer keys reply with `message_send`."},"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."},"app_connect":{"type":"boolean","nullable":true,"description":"Sign in to apps as an inbox: connect an app, authorize an inbox, and mint the\nsign-in keys. Omitted on a new bearer key means false, whatever else the key holds."},"app_share_owner":{"type":"boolean","nullable":true,"description":"Share the organization owner's name and email with apps at sign-in. One permission\nfor both values."},"account_update":{"type":"boolean","nullable":true,"description":"Update accounts: disable or re-enable an inbox's sign-in at an app. Reading accounts\nneeds only `inbox_read`."},"pod_read":{"type":"boolean","nullable":true,"description":"Read pods."},"pod_create":{"type":"boolean","nullable":true,"description":"Create pods."},"pod_update":{"type":"boolean","nullable":true,"description":"Update pods."},"pod_delete":{"type":"boolean","nullable":true,"description":"Delete pods."},"calendar_read":{"type":"boolean","nullable":true,"description":"Read inbox calendar settings."},"calendar_update":{"type":"boolean","nullable":true,"description":"Update inbox calendar settings."},"calendar_event_read":{"type":"boolean","nullable":true,"description":"Read calendar events, and receive `calendar.event.*` webhook and WebSocket events."},"calendar_event_create":{"type":"boolean","nullable":true,"description":"Create calendar events."},"calendar_event_update":{"type":"boolean","nullable":true,"description":"Update calendar events and respond to invitations."},"calendar_event_delete":{"type":"boolean","nullable":true,"description":"Delete calendar events."}}},"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"},"expires_at":{"$ref":"#/components/schemas/ExpiresAt","nullable":true}},"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","description":"`expires_at` must be in the future and is immutable once the key exists.\nOmitted, the new key inherits the authenticating key's expiry, and never\nexpires only when that key never does. A key cannot create one that\noutlives it: an `expires_at` later than the authenticating key's own\nreturns `403`.","properties":{"expires_at":{"$ref":"#/components/schemas/ExpiresAt","nullable":true}},"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"}]},"AppId":{"title":"AppId","type":"string","format":"uuid","description":"ID of app."},"AppCategory":{"title":"AppCategory","type":"string","enum":["ai","search","scraping","browser","data","developer-tools","communication","productivity","payments","finance","commerce","marketing","analytics","security","infrastructure","other"],"description":"Kind of app."},"App":{"title":"App","type":"object","description":"An app an inbox can sign in to.","properties":{"app_id":{"$ref":"#/components/schemas/AppId"},"slug":{"type":"string","nullable":true,"description":"Short name accepted in place of `app_id` by Get App, List App Accounts and Connect App. Set by AgentMail on apps in the catalog; renaming the app does not change it. Store `app_id`, the app's permanent ID."},"name":{"type":"string","nullable":true},"updated_at":{"type":"string","format":"date-time","nullable":true,"description":"Time at which app 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},"categories":{"type":"array","items":{"$ref":"#/components/schemas/AppCategory"},"nullable":true,"description":"Kinds of app, up to 3. Omitted when the app sets none."},"owner_signup_limit":{"type":"integer","nullable":true,"description":"Maximum number of accounts your organization may sign up at this app. Omitted when the app sets no limit. 0 means the app has paused new sign-ups; existing accounts keep signing in."}},"required":["app_id"]},"ListAppsResponse":{"title":"ListAppsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}}},"required":["count","limit","apps"]},"SearchAppsResponse":{"title":"SearchAppsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"apps":{"type":"array","items":{"$ref":"#/components/schemas/App"}}},"required":["count","limit","apps"]},"ListAppAccountsResponse":{"title":"ListAppAccountsResponse","type":"object","properties":{"app":{"$ref":"#/components/schemas/App","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."},"ConnectAppBody":{"title":"ConnectAppBody","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"]},"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":"Signed HTTPS CDN URL to download the attachment bytes. Retrieve a fresh URL when needed rather than storing it permanently."},"text_url":{"type":"string","nullable":true,"description":"Signed HTTPS CDN URL to download extracted plain text, when available. Omitted when no extracted text is available. Expires at the same time as download_url."},"expires_at":{"type":"string","format":"date-time","description":"Time at which download_url and text_url (when present) expire. Retrieve the attachment again to obtain fresh URLs."}},"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"]},"CalendarEventId":{"title":"CalendarEventId","type":"string","description":"ID of a calendar event. A one-off or recurring event is addressed by its UUID. One date of a\nrecurring event is addressed by a dated ID, `_`: `_t20261015T090000` for a\ntimed date (the original wall-clock start in the event's time zone) or `_d20261015` for an\nall-day date. Dated IDs are stable: moving a date keeps its original ID."},"CalendarEventKind":{"title":"CalendarEventKind","type":"string","enum":["single","series","instance"],"description":"What the event object represents.\n\n- `single`: a one-off event, addressed by its UUID.\n- `series`: the definition of a recurring event, addressed by its UUID. It carries\n `recurrence`; `start` and `end` describe its first date.\n- `instance`: one date of a recurring event, addressed by its dated ID. It carries `series_id`,\n `original_start` and `is_exception`."},"CalendarEventStatus":{"title":"CalendarEventStatus","type":"string","enum":["confirmed","tentative","cancelled"],"description":"Status of the event. A `cancelled` event or date stays readable but sends no\n`calendar.event.starting` or `calendar.event.ending` webhooks (cancelling a date that is\nalready running still sends its `calendar.event.ending`). A date cancelled by deleting its\ndated ID is removed from the series instead, so reading it can return `404` or `410`."},"CalendarEventSource":{"title":"CalendarEventSource","type":"string","enum":["api","email"],"description":"Where the event came from. `api` events were created through this API and the inbox is their\norganizer. `email` events were created from a calendar invitation (iMIP) received by the inbox;\ntheir organizer is the sender of the invitation."},"DurationMode":{"title":"DurationMode","type":"string","enum":["nominal","exact"],"description":"How the event's length is kept when a date crosses a daylight-saving change.\n\n- `exact`: the event lasts the same elapsed time. Default for one-off timed events.\n- `nominal`: the event keeps its wall-clock end time (a 09:00 to 10:00 meeting stays 09:00 to\n 10:00 local time). Default for recurring timed events.\n\nAll-day events are always `nominal`."},"WallTime":{"title":"WallTime","type":"string","description":"A local wall-clock time without an offset, interpreted in the event's `timezone`.\nTimed events use `YYYY-MM-DDTHH:mm:ss` (for example `2026-10-15T09:00:00`). All-day events use\n`YYYY-MM-DD`. Years must be between 1900 and 9999."},"IanaTimezone":{"title":"IanaTimezone","type":"string","description":"Canonical IANA time zone name, for example `America/New_York`, `Europe/London` or `UTC`.\nAbbreviations such as `PST`, Windows names such as `Pacific Standard Time`, and spellings that\ndiffer from the canonical name are rejected."},"ResourceRevision":{"title":"ResourceRevision","type":"integer","description":"Revision of the resource. It increases on every change. The resource's `etag` is\n`\"rv-\"`."},"OperationId":{"title":"OperationId","type":"string","description":"ID of the change this request made. The `calendar.event.created`, `calendar.event.updated`,\n`calendar.event.deleted` or `calendar.event.responded` webhook for the change carries the same\nvalue as its `event_id`, so you can match webhooks to your own requests."},"DeletionId":{"title":"DeletionId","type":"string","description":"ID of an accepted deletion. While the event is being removed, retrying the same delete (with the\nsame `Idempotency-Key`, or none and the same `send_invites`) returns it again. Once removal has\nfinished, a retry returns `404`."},"CalendarConsistency":{"title":"CalendarConsistency","type":"string","enum":["eventual","primary"],"description":"Read consistency. `eventual` (default) reads from the region that serves your request and may\nlag a write made moments earlier by up to a few seconds. `primary` reads from the primary region\nand always reflects every completed write."},"CalendarLimit":{"title":"CalendarLimit","type":"integer","description":"Maximum number of events to return, from 1 to 100. Defaults to 50."},"WindowAfter":{"title":"WindowAfter","type":"string","format":"date-time","description":"Start of the window, as a UTC timestamp ending in `Z` (an offset such as `-04:00` is\nrejected). Defaults to now. The window between `after` and `before` can be at most 366 days."},"WindowBefore":{"title":"WindowBefore","type":"string","format":"date-time","description":"End of the window, as a UTC timestamp ending in `Z` (an offset such as `-04:00` is rejected).\nDefaults to 90 days after `after`. The window between `after` and `before` can be at most 366\ndays."},"IncludeOverlapping":{"title":"IncludeOverlapping","type":"boolean","description":"When `true` (default), include events that started before `after` but are still running at\n`after`. When `false`, include only events that start inside the window."},"InstanceMutationMode":{"title":"InstanceMutationMode","type":"string","enum":["single","future"],"description":"Which dates a change to a dated event applies to. `single` (default) changes only this date.\n`future` changes this date and every later date of the series. Applies only to dated event IDs;\nsending `mode` with a one-off or series UUID is a `400`."},"Calendar":{"title":"Calendar","type":"object","description":"An inbox's calendar. Every inbox has exactly one calendar; it exists from the moment the inbox\ndoes and is deleted with it.","properties":{"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"timezone":{"$ref":"#/components/schemas/IanaTimezone","description":"Default time zone for events created without a `timezone`. Defaults to `UTC`. Changing it\ndoes not move existing events."},"event_count":{"type":"integer","description":"Number of one-off and recurring events on the calendar. Each recurring event counts once.","example":2},"created_at":{"type":"string","format":"date-time","description":"Time at which the calendar was created. The calendar exists from the moment the inbox does, so this is the inbox's creation time.","example":"2026-10-01T16:20:00Z"},"updated_at":{"type":"string","format":"date-time","description":"Time at which the calendar was last updated.","example":"2026-10-01T16:25:00Z"},"etag":{"type":"string","description":"The calendar's current version, also sent as the `ETag` response header. Send it in\n`If-Match` to make an update conditional.","example":"\"rv-1\""}},"required":["inbox_id","timezone","event_count","created_at","updated_at","etag"]},"UpdateCalendarRequest":{"title":"UpdateCalendarRequest","type":"object","properties":{"timezone":{"$ref":"#/components/schemas/IanaTimezone","description":"New default time zone for events created without a `timezone`."}},"required":["timezone"]},"AttendeeStatus":{"title":"AttendeeStatus","type":"string","enum":["needs_action","accepted","declined","tentative"],"description":"The attendee's response to the invitation."},"AttendeeRole":{"title":"AttendeeRole","type":"string","enum":["required","optional"],"description":"Whether the attendee's presence is required."},"Attendee":{"title":"Attendee","type":"object","properties":{"email":{"type":"string","description":"Email address of the attendee. Stored in lowercase. Must be unique within the event."},"name":{"type":"string","nullable":true,"description":"Display name of the attendee. At most 256 characters."},"status":{"$ref":"#/components/schemas/AttendeeStatus","nullable":true,"description":"Response status. Defaults to `needs_action`."},"role":{"$ref":"#/components/schemas/AttendeeRole","nullable":true,"description":"Defaults to `required`."},"comment":{"type":"string","nullable":true,"description":"Comment the attendee sent with their response. At most 4,096 UTF-8 bytes; on create or\nupdate, a longer comment is dropped rather than rejected."},"responded_at":{"type":"string","format":"date-time","nullable":true,"description":"Time at which the attendee last responded."}},"required":["email"]},"RecurrencePeriod":{"title":"RecurrencePeriod","type":"object","description":"An extra date (RDATE) given as a period. Specify exactly one of `end` or `duration`.","properties":{"start":{"$ref":"#/components/schemas/WallTime"},"end":{"$ref":"#/components/schemas/WallTime","nullable":true},"duration":{"type":"string","nullable":true,"description":"ISO 8601 duration, for example `PT30M`."}},"required":["start"]},"RecurrenceDate":{"title":"RecurrenceDate","oneOf":[{"$ref":"#/components/schemas/WallTime"},{"$ref":"#/components/schemas/RecurrencePeriod"}],"description":"A wall-clock date or date-time, or (timed events only) a period."},"RecurrenceInput":{"title":"RecurrenceInput","type":"object","description":"Repeats the event. `rule` is an RFC 5545 RRULE, evaluated in the event's `timezone` from the\nevent's `start`. Each date keeps its wall-clock time across daylight-saving changes.","properties":{"rule":{"type":"string","description":"RFC 5545 RRULE body, with or without the `RRULE:` prefix, for example\n`FREQ=WEEKLY;BYDAY=MO,WE,FR` or `FREQ=MONTHLY;BYDAY=-1FR;COUNT=12`. Supported parts: `FREQ`,\n`INTERVAL` (1 to 366), `COUNT` (1 to 10,000), `UNTIL` (`YYYYMMDD` or `YYYYMMDDTHHMMSSZ`),\n`WKST`, `BYMONTH`, `BYWEEKNO`, `BYYEARDAY`, `BYMONTHDAY`, `BYDAY`, `BYHOUR`, `BYMINUTE`,\n`BYSECOND` and `BYSETPOS`. `COUNT` and `UNTIL` are mutually exclusive. The rule is stored in\na normalized form, so a response can differ textually from what you sent. At most 512\ncharacters after normalization."},"exdates":{"type":"array","items":{"$ref":"#/components/schemas/WallTime"},"nullable":true,"description":"Dates to skip, matching the original start of a date: `YYYY-MM-DDTHH:mm:ss` for timed events,\n`YYYY-MM-DD` for all-day events. At most 366."},"rdates":{"type":"array","items":{"$ref":"#/components/schemas/RecurrenceDate"},"nullable":true,"description":"Extra dates to add. Timed events take date-times or periods; all-day events take dates. At\nmost 100."}},"required":["rule"]},"Recurrence":{"title":"Recurrence","type":"object","description":"The recurrence of a series, as stored.","properties":{"rule":{"type":"string","description":"Normalized RRULE body, without the `RRULE:` prefix."},"exdates":{"type":"array","items":{"$ref":"#/components/schemas/WallTime"},"nullable":true},"rdates":{"type":"array","items":{"$ref":"#/components/schemas/RecurrenceDate"},"nullable":true},"truncate_before":{"$ref":"#/components/schemas/WallTime","nullable":true,"description":"Set when the series was ended with a `mode=future` delete: no date starting at or after\nthis wall-clock time occurs."}},"required":["rule"]},"CalendarEvent":{"title":"CalendarEvent","type":"object","description":"A calendar event. The same shape is used by every response, list item and webhook. `kind` says\nwhether it is a one-off event, the definition of a recurring series, or one date of a series.","properties":{"event_id":{"$ref":"#/components/schemas/CalendarEventId"},"kind":{"$ref":"#/components/schemas/CalendarEventKind"},"series_id":{"type":"string","nullable":true,"description":"For `instance` events, the UUID of the series this date belongs to."},"original_start":{"$ref":"#/components/schemas/WallTime","nullable":true,"description":"For `instance` events, the date's start as the series rule generated it, before any edit."},"original_start_at":{"type":"string","format":"date-time","nullable":true,"description":"For `instance` events, `original_start` as a UTC instant."},"is_exception":{"type":"boolean","nullable":true,"description":"For `instance` events, `true` when this date was edited or moved, individually or by a `mode=future` change."},"title":{"type":"string","description":"Title of the event.","example":"Intro call with Acme"},"description":{"type":"string","nullable":true,"description":"Description of the event. Omitted from agenda and instance list items."},"location":{"type":"string","nullable":true,"description":"Location of the event."},"metadata":{"nullable":true,"description":"Your own JSON value for the event, usually an object. Never sent to attendees. Omitted from agenda and instance list items."},"status":{"$ref":"#/components/schemas/CalendarEventStatus"},"all_day":{"type":"boolean","description":"Whether this is an all-day event.","example":false},"start":{"$ref":"#/components/schemas/WallTime","description":"Local start time in `timezone`. For all-day events, the first day."},"end":{"$ref":"#/components/schemas/WallTime","description":"Local end time in `timezone`. For all-day events, the last day (inclusive)."},"timezone":{"$ref":"#/components/schemas/IanaTimezone"},"duration_mode":{"$ref":"#/components/schemas/DurationMode"},"duration_value":{"type":"integer","description":"Length of the event, in milliseconds for timed events and in days for all-day events.","example":1800000},"start_at":{"type":"string","format":"date-time","description":"Start as a UTC instant. This is when `calendar.event.starting` is due.","example":"2026-10-15T18:00:00Z"},"end_at":{"type":"string","format":"date-time","description":"End as a UTC instant. This is when `calendar.event.ending` is due.","example":"2026-10-15T18:30:00Z"},"recurrence":{"$ref":"#/components/schemas/Recurrence","nullable":true,"description":"For `series` events, the recurrence."},"attendees":{"type":"array","items":{"$ref":"#/components/schemas/Attendee"},"nullable":true,"description":"Attendees of the event. Omitted from agenda and instance list items; `attendee_count` is always present."},"attendee_count":{"type":"integer","description":"Number of attendees.","example":1},"uid":{"type":"string","description":"iCalendar UID of the event. Invitations about this event carry the same UID.","example":"3f8a2c1e-6b4d-4e9f-a7c2-5d1b8e0f9a36@agentmail.to"},"sequence":{"type":"integer","description":"iCalendar SEQUENCE number. It increases when a change to a one-off or series event affects\nwhat attendees see (time, status, title, description, location, recurrence or attendees).\nA change to a dated event increases it only when the change is sent with `send_invites`.","example":0},"source":{"$ref":"#/components/schemas/CalendarEventSource"},"organizer_email":{"type":"string","nullable":true,"description":"Email address of the organizer. For `api` events, the inbox."},"origin_message_id":{"type":"string","nullable":true,"description":"For `email` events, the ID of the message whose invitation last created or updated the event."},"resource_revision":{"$ref":"#/components/schemas/ResourceRevision","nullable":true,"description":"Present on `single` and `series` events, except agenda items and\n`calendar.event.starting` and `calendar.event.ending` payloads, which omit it."},"created_at":{"type":"string","format":"date-time","description":"Time at which the event (or, for a date, the definition governing it) was created.","example":"2026-10-01T16:30:00Z"},"updated_at":{"type":"string","format":"date-time","description":"Time at which the event (or, for a date, the definition governing it) was last updated.","example":"2026-10-01T16:30:00Z"},"etag":{"type":"string","nullable":true,"description":"The event's or date's current version, also sent as the `ETag` response header. Send it in\n`If-Match` to make an update, delete or response conditional. Present on Get, Create,\nUpdate, Delete and Respond responses; list items and webhooks omit it. Treat it as opaque:\na dated event's `etag` (`\"occ-...\"`) is not derived from `resource_revision`."}},"required":["event_id","kind","title","status","all_day","start","end","timezone","duration_mode","duration_value","start_at","end_at","attendee_count","uid","sequence","source","created_at","updated_at"]},"CalendarEventMutationResponse":{"title":"CalendarEventMutationResponse","type":"object","properties":{"event":{"$ref":"#/components/schemas/CalendarEvent"},"operation_id":{"$ref":"#/components/schemas/OperationId"}},"required":["event","operation_id"]},"DeleteCalendarEventResponse":{"title":"DeleteCalendarEventResponse","type":"object","description":"Deleting a one-off or recurring event (or a `mode=future` delete that covers a whole series)\nreturns `deletion_id`. Deleting dates of a series returns the cancelled date as `event` with an\n`operation_id`.","properties":{"deletion_id":{"$ref":"#/components/schemas/DeletionId","nullable":true},"event":{"$ref":"#/components/schemas/CalendarEvent","nullable":true},"operation_id":{"$ref":"#/components/schemas/OperationId","nullable":true}}},"ListCalendarEventsResponse":{"title":"ListCalendarEventsResponse","type":"object","properties":{"count":{"$ref":"#/components/schemas/Count"},"limit":{"$ref":"#/components/schemas/Limit"},"next_page_token":{"$ref":"#/components/schemas/PageToken","nullable":true},"events":{"type":"array","items":{"$ref":"#/components/schemas/CalendarEvent"},"description":"On List Events, ordered by `updated_at` descending. On Get Agenda and List Event Instances,\nordered by `start_at` ascending."}},"required":["count","limit","events"]},"CreateCalendarEventRequest":{"title":"CreateCalendarEventRequest","type":"object","properties":{"client_id":{"type":"string","nullable":true,"description":"Your idempotency key for this create. Retrying with the same `client_id` and the same body\nreturns the original event with `200` instead of creating a second one, for as long as the\nevent exists (`404` once it has been deleted). Reusing it with a different body is a `409`\n`idempotency_conflict`."},"title":{"type":"string","description":"Title of the event. 1 to 1,000 characters.","example":"Intro call with Acme"},"description":{"type":"string","nullable":true,"description":"Description of the event. At most 65,536 bytes."},"location":{"type":"string","nullable":true,"description":"Location of the event. At most 1,024 characters."},"metadata":{"nullable":true,"description":"Your own JSON value (usually an object), returned on reads and in webhooks (except agenda and instance list items, and the webhook for a date cancelled with `DELETE`). Never sent to attendees. At most 16,384 bytes serialized."},"status":{"$ref":"#/components/schemas/CalendarEventStatus","nullable":true,"description":"Defaults to `confirmed`."},"all_day":{"type":"boolean","nullable":true,"description":"Set to `true` for an all-day event. Defaults to `false`."},"start":{"$ref":"#/components/schemas/WallTime","description":"Local start time in `timezone`: `YYYY-MM-DDTHH:mm:ss` for timed events, `YYYY-MM-DD` for\nall-day events. For a recurring event, this is the first date."},"end":{"$ref":"#/components/schemas/WallTime","description":"Local end time in `timezone`, in the same format as `start`. For timed events it must be\nafter `start`; for all-day events it is the last day (inclusive) and can equal `start`.\nOne-off events can last up to 366 days; each date of a recurring event up to 31 days."},"timezone":{"$ref":"#/components/schemas/IanaTimezone","nullable":true,"description":"Time zone of `start` and `end`. Defaults to the calendar's `timezone`."},"duration_mode":{"$ref":"#/components/schemas/DurationMode","nullable":true,"description":"Timed events only. Defaults to `exact` for one-off events and `nominal` for recurring events."},"recurrence":{"$ref":"#/components/schemas/RecurrenceInput","nullable":true,"description":"Makes this a recurring event."},"attendees":{"type":"array","items":{"$ref":"#/components/schemas/Attendee"},"nullable":true,"description":"Attendees of the event. At most 100."},"send_invites":{"type":"boolean","nullable":true,"description":"When `true`, the inbox emails an invitation (iCalendar `REQUEST`) to every attendee. Defaults\nto `false`."}},"required":["title","start","end"]},"UpdateCalendarEventRequest":{"title":"UpdateCalendarEventRequest","type":"object","description":"Send only the fields to change. Fields set to `null` are cleared. At least one field is required.\n`all_day`, `timezone` and `recurrence` can only be changed on a one-off or series UUID, not on a\ndated event ID.","properties":{"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true,"description":"Set to `null` to clear."},"location":{"type":"string","nullable":true,"description":"Set to `null` to clear."},"metadata":{"nullable":true,"description":"Replaces the metadata (any JSON value, usually an object). Set to `null` to clear."},"status":{"$ref":"#/components/schemas/CalendarEventStatus","nullable":true},"all_day":{"type":"boolean","nullable":true,"description":"Changing `all_day` requires `start`, `end` and `timezone` in the same request. Not accepted for dated event IDs."},"start":{"$ref":"#/components/schemas/WallTime","nullable":true,"description":"New start. For a one-off or series UUID, send it together with `end`. Not accepted with `mode=future`."},"end":{"$ref":"#/components/schemas/WallTime","nullable":true,"description":"New end. For a one-off or series UUID, send it together with `start`. A dated ID accepts `end` alone."},"timezone":{"$ref":"#/components/schemas/IanaTimezone","nullable":true,"description":"New time zone. Not accepted for dated event IDs."},"duration_mode":{"$ref":"#/components/schemas/DurationMode","nullable":true},"recurrence":{"$ref":"#/components/schemas/RecurrenceInput","nullable":true,"description":"Replaces the recurrence. Set to `null` to turn a series into a one-off event (only when no\ndate of it has been edited). Not accepted for dated event IDs."},"attendees":{"type":"array","items":{"$ref":"#/components/schemas/Attendee"},"nullable":true,"description":"Replaces the attendee list."},"send_invites":{"type":"boolean","nullable":true,"description":"When `true`, emails the updated invitation to every attendee. Only the organizer (an `api`\nevent) can send. Defaults to `false`."}}},"RespondStatus":{"title":"RespondStatus","type":"string","enum":["accepted","declined","tentative"],"description":"Your response to the invitation."},"RespondCalendarEventRequest":{"title":"RespondCalendarEventRequest","type":"object","properties":{"status":{"$ref":"#/components/schemas/RespondStatus"},"comment":{"type":"string","nullable":true,"description":"Comment to include with the response. At most 4,096 UTF-8 bytes, with no control characters\nother than tab, line feed and carriage return; a longer comment returns `400`. It is stored\nas the inbox's attendee `comment`."},"send_reply":{"type":"boolean","nullable":true,"description":"When `true` (default), emails the response (iCalendar `REPLY`) to the organizer."}},"required":["status"]},"PreconditionFailedErrorResponse":{"title":"PreconditionFailedErrorResponse","type":"object","properties":{"name":{"$ref":"#/components/schemas/ErrorName"},"code":{"$ref":"#/components/schemas/ErrorCode","nullable":true},"message":{"$ref":"#/components/schemas/ErrorMessage"},"current_revision":{"type":"integer","nullable":true,"description":"The resource's current revision."},"fix":{"$ref":"#/components/schemas/ErrorFix","nullable":true},"docs":{"$ref":"#/components/schemas/ErrorDocs","nullable":true}},"required":["name","message"]},"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."},"InboundEnabled":{"title":"InboundEnabled","type":"boolean","description":"Receive email for this domain. Defaults to `true`. Set `false` for a send-only\ndomain: the apex MX record is not required and is omitted from `records`, so the\ndomain's existing email provider keeps receiving its mail. Inboxes on a send-only\ndomain can still send."},"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"},"inbound_enabled":{"$ref":"#/components/schemas/InboundEnabled","nullable":true,"description":"Absent on domains created before this field existed; those receive email."},"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 the apex\nMX record unless `inbound_enabled` is false, and a wildcard MX record\n(`*.`) 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"},"inbound_enabled":{"$ref":"#/components/schemas/InboundEnabled","nullable":true,"description":"Absent on domains created before this field existed; those receive email."},"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"},"allow_conflicting_provider":{"type":"boolean","nullable":true,"description":"Allow registration when the domain already has Google Workspace MX records.\nDefaults to false; registration otherwise returns 422 when a conflicting\nprovider is detected.\nThis flag does not configure DNS or inbound routing. For shared Google\nWorkspace domains, follow the [Google Workspace guide](/google-workspace).\nOnly checked when `inbound_enabled` is true; a send-only domain skips the check."},"feedback_enabled":{"$ref":"#/components/schemas/FeedbackEnabled","nullable":true},"inbound_enabled":{"$ref":"#/components/schemas/InboundEnabled","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`, `inbound_enabled`,\n`subdomains_enabled`, or `tracking_enabled`. Omitted fields are left\nunchanged; an empty body is rejected. Enabling `inbound_enabled` or\n`subdomains_enabled` on a verified domain returns it to `PENDING` until the\nnewly required MX record (the apex MX, or the wildcard `*.`) is\npublished and verified.","properties":{"feedback_enabled":{"$ref":"#/components/schemas/FeedbackEnabled","nullable":true},"inbound_enabled":{"$ref":"#/components/schemas/InboundEnabled","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","calendar.event.created","calendar.event.updated","calendar.event.deleted","calendar.event.responded","calendar.event.starting","calendar.event.ending"]},"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"]},"CalendarEventPrevious":{"title":"CalendarEventPrevious","type":"object","description":"The values that a `calendar.event.updated` change replaced, for the fields it changed. Only\nchanged fields appear; a field that had no value before the change is absent.","properties":{"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"location":{"type":"string","nullable":true},"metadata":{"nullable":true},"status":{"$ref":"#/components/schemas/CalendarEventStatus","nullable":true},"all_day":{"type":"boolean","nullable":true},"start":{"$ref":"#/components/schemas/WallTime","nullable":true},"end":{"$ref":"#/components/schemas/WallTime","nullable":true},"timezone":{"$ref":"#/components/schemas/IanaTimezone","nullable":true},"duration_mode":{"$ref":"#/components/schemas/DurationMode","nullable":true},"recurrence":{"$ref":"#/components/schemas/Recurrence","nullable":true},"attendees":{"type":"array","items":{"$ref":"#/components/schemas/Attendee"},"nullable":true}}},"CalendarEventCreatedEvent":{"title":"CalendarEventCreatedEvent","type":"object","description":"An event was created, through the API or from an invitation the inbox received. Also sent when\none date of a recurring event is edited for the first time; `calendar_event` is then that date.","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"calendar.event.created"},"event_id":{"$ref":"#/components/schemas/EventId","description":"Equals the `operation_id` returned by the request that made the change."},"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"calendar_event":{"$ref":"#/components/schemas/CalendarEvent"}},"required":["type","event_type","event_id","inbox_id","calendar_event"]},"CalendarEventUpdatedEvent":{"title":"CalendarEventUpdatedEvent","type":"object","description":"An event, or one or more dates of a recurring event, changed. `calendar_event` is the event\n(or the date) after the change. Cancelling dates with a delete on a dated ID also sends this\nevent, with the cancelled date as `calendar_event`.","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"calendar.event.updated"},"event_id":{"$ref":"#/components/schemas/EventId","description":"Equals the `operation_id` returned by the request that made the change."},"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"calendar_event":{"$ref":"#/components/schemas/CalendarEvent"},"previous":{"$ref":"#/components/schemas/CalendarEventPrevious","nullable":true,"description":"For changes to a one-off or series event, the prior values of the fields that changed."}},"required":["type","event_type","event_id","inbox_id","calendar_event"]},"CalendarEventDeletedEvent":{"title":"CalendarEventDeletedEvent","type":"object","description":"A one-off or recurring event was deleted. `calendar_event` is the event as it was. Cancelling\ndates of a recurring event sends `calendar.event.updated` instead.","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"calendar.event.deleted"},"event_id":{"$ref":"#/components/schemas/EventId","description":"Equals the `deletion_id` returned by the request that made the change."},"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"calendar_event":{"$ref":"#/components/schemas/CalendarEvent"}},"required":["type","event_type","event_id","inbox_id","calendar_event"]},"CalendarEventRespondedEvent":{"title":"CalendarEventRespondedEvent","type":"object","description":"An attendee's response changed: the inbox responded with the respond endpoint, or an attendee\nreplied by email to an invitation the inbox sent. `calendar_event.attendees` holds the new\nstatuses.","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"calendar.event.responded"},"event_id":{"$ref":"#/components/schemas/EventId"},"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"calendar_event":{"$ref":"#/components/schemas/CalendarEvent"}},"required":["type","event_type","event_id","inbox_id","calendar_event"]},"CalendarEventStartingEvent":{"title":"CalendarEventStartingEvent","type":"object","description":"An event, or one date of a recurring event, has started. Usually sent within a minute after\n`scheduled_at`. If a date is first picked up after it has already ended and more than 5\nminutes after its start (for example, an event created entirely in the past), neither its\n`calendar.event.starting` nor its `calendar.event.ending` is sent. Retries carry the same\n`event_id` and an identical body.","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"calendar.event.starting"},"event_id":{"$ref":"#/components/schemas/EventId","description":"Stable for this date and boundary. Use it to deduplicate deliveries."},"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"calendar_event":{"$ref":"#/components/schemas/CalendarEvent","description":"The event or date as it stood when the boundary was first processed."},"scheduled_at":{"type":"string","format":"date-time","description":"The start this webhook is for (the event's `start_at`)."}},"required":["type","event_type","event_id","inbox_id","calendar_event","scheduled_at"]},"CalendarEventEndingEvent":{"title":"CalendarEventEndingEvent","type":"object","description":"An event, or one date of a recurring event, has ended. Usually sent within a minute after\n`scheduled_at`. Retries carry the same `event_id` and an identical body.","properties":{"type":{"type":"string","const":"event"},"event_type":{"type":"string","const":"calendar.event.ending"},"event_id":{"$ref":"#/components/schemas/EventId","description":"Stable for this date and boundary. Use it to deduplicate deliveries."},"inbox_id":{"$ref":"#/components/schemas/inboxesInboxId"},"calendar_event":{"$ref":"#/components/schemas/CalendarEvent","description":"The event or date as it stood when the boundary was first processed."},"scheduled_at":{"type":"string","format":"date-time","description":"The end this webhook is for (the event's `end_at`)."}},"required":["type","event_type","event_id","inbox_id","calendar_event","scheduled_at"]},"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":"CloudFront signed 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":"CloudFront signed 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."},"RateType":{"title":"RateType","type":"string","enum":["bounce","complaint"],"description":"Type of rate. `bounce` is bounced messages divided by messages sent,\ncounting permanent and transient bounces; `complaint` is spam complaints\ndivided by messages sent."},"RateTypes":{"title":"RateTypes","type":"array","items":{"$ref":"#/components/schemas/RateType"},"description":"List of rate types to query. Omit to query both."},"RatePeriod":{"title":"RatePeriod","type":"integer","description":"How often a point is sampled, as a whole number of seconds between 60\nand 86400. Defaults to 3600 (one point per hour)."},"Window":{"title":"Window","type":"integer","description":"How far back each point looks, as a whole number of seconds. Must be a\nwhole multiple of `period`, at most 30 days (2592000). Defaults to 86400\n(a rolling 24-hour rate)."},"RatePoint":{"title":"RatePoint","type":"object","properties":{"timestamp":{"type":"string","format":"date-time","description":"End of the window the point covers; the window is the `window` seconds before it."},"rate":{"type":"number","format":"double","nullable":true,"description":"Bounced or complained messages divided by messages sent over the\nwindow, as a fraction (0.05 is 5%). Null when nothing was sent in\nthe window."},"sent":{"type":"integer","description":"Messages sent in the window, counted per recipient."}},"required":["timestamp","sent"]},"QueryRatesResponse":{"title":"QueryRatesResponse","type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/RatePoint"}},"description":"Rate series grouped by rate 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"]},"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"]},"CliCreateApiKeyRequest":{"type":"object","description":"Omit `public_key` to mint a bearer key; include it to register a\npublic key. `client_id` and `expires_at` apply only with `public_key`.","properties":{"name":{"$ref":"#/components/schemas/Name"},"permissions":{"$ref":"#/components/schemas/ApiKeyPermissions"},"public_key":{"type":"object","additionalProperties":true,"description":"Public P-256 JWK with exactly `kty` (\"EC\"), `crv` (\"P-256\"), `x`,\nand `y`, as JSON. Registers a public key instead of minting a\nbearer key."},"client_id":{"$ref":"#/components/schemas/PublicKeyClientId"},"expires_at":{"$ref":"#/components/schemas/ExpiresAt"}}}},"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 1a70282..b014fc6 100644 --- a/cli/agentmail/sdk.rs +++ b/cli/agentmail/sdk.rs @@ -66,6 +66,7 @@ pub fn client(ctx: &AppContext) -> agentmail_sdk::api::ApiClient { http_client: http_client.clone(), accounts: agentmail_sdk::api::resources::inboxes::AccountsClient2 { http_client: http_client.clone() }, api_keys: agentmail_sdk::api::resources::inboxes::ApiKeysClient2 { http_client: http_client.clone() }, + calendar: agentmail_sdk::api::resources::inboxes::CalendarClient { 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 4606e6b..f93c3ed 100644 --- a/reference.md +++ b/reference.md @@ -14,6 +14,7 @@ Full command reference for `agentmail`. - [`agentmail inboxes`](#agentmail-inboxes) - [`agentmail inboxes accounts`](#agentmail-inboxes-accounts) - [`agentmail inboxes api-keys`](#agentmail-inboxes-api-keys) +- [`agentmail inboxes calendar`](#agentmail-inboxes-calendar) - [`agentmail inboxes drafts`](#agentmail-inboxes-drafts) - [`agentmail inboxes events`](#agentmail-inboxes-events) - [`agentmail inboxes lists`](#agentmail-inboxes-lists) @@ -126,7 +127,7 @@ Create a new agent organization with an inbox and API key. This endpoint is for A 6-digit OTP is sent to the human's email for verification. -`human_email` is optional. Without it, the inbox can receive email but cannot send to anyone until a human is attached with the attach human endpoint. There is also no way to recover the API key, so store it durably. Calling sign-up again without `human_email` creates a new organization, which needs a different `username`: the original username stays with the lost organization's inbox. +`human_email` is optional. Without it, the inbox can receive email but cannot send to anyone until a human is attached with the attach human endpoint or, for a US-region inbox, claims it in the AgentMail Console with the API key (see [How do I claim my agent's inbox?](https://docs.agentmail.to/knowledge-base/claiming-agent-inbox)). There is also no way to recover the API key, so store it durably. Calling sign-up again without `human_email` creates a new organization, which needs a different `username`: the original username stays with the lost organization's inbox. This endpoint is idempotent. Calling it again with the same `human_email` will rotate the API key and resend the OTP if expired. @@ -251,6 +252,8 @@ by `client_id`; a sign-in key accepts only `app_connect` and Starts signing an inbox in to an app. 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 app. +An app in the catalog can be named by its `slug`, as in +`POST /v0/apps/firecrawl/connect`. A `404` names the missing resource: `App` or `Inbox`. A `403` `AppSignupLimitError` means the app accepts no more sign-ups from your organization; sign in with an inbox that already has an account there. @@ -259,22 +262,23 @@ your organization; sign in with an inbox that already has an account there. | Flag | Type | Required | Description | |------|------|----------|-------------| -| `--app-id` | `AppId` | Yes | | +| `--app-id` | `string` | Yes | ID of app, or the `slug` of an app in the catalog. A slug ignores case, spaces and punctuation. | | `--idempotency-key` | `string` | No | 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. | | `--json` | `JSON` | No | Request body as JSON (or use individual body-field flags) | #### `agentmail apps get` -Gets one app by ID. An app in the catalog returns its full entry. +Gets one app by ID or slug. A catalog app returns its full entry. A registered app that the catalog does not list returns its ID and name only, without `updated_at`, so anyone holding its ID can still look -it up. List Apps and Search Apps show catalog entries only. +it up; a slug finds catalog apps only. List Apps and Search Apps show +catalog entries only. `GET /v0/apps/{app_id}` | Flag | Type | Required | Description | |------|------|----------|-------------| -| `--app-id` | `AppId` | Yes | | +| `--app-id` | `string` | Yes | ID of app, or the `slug` of an app in the catalog. A slug ignores case, spaces and punctuation. | #### `agentmail apps list` @@ -286,6 +290,7 @@ Lists apps, most popular first. |------|------|----------|-------------| | `--limit` | `Limit` | No | | | `--page-token` | `PageToken` | No | | +| `--category` | `AppCategory` | No | Only apps in this category. A filtered page can hold fewer than `limit` apps while more remain, so page until `next_page_token` is absent. A `page_token` works only with the `category` it was returned for. | #### `agentmail apps list-accounts` @@ -295,7 +300,7 @@ Lists accounts at one app, most recent sign-in first. | Flag | Type | Required | Description | |------|------|----------|-------------| -| `--app-id` | `AppId` | Yes | | +| `--app-id` | `string` | Yes | ID of app, or the `slug` of an app in the catalog. A slug ignores case, spaces and punctuation. | | `--limit` | `Limit` | No | | | `--page-token` | `PageToken` | No | | @@ -579,6 +584,9 @@ cannot exceed 100. A page can be empty and still carry a agentmail inboxes update --inbox-id --display-name "Updated Name" ``` +To pause an inbox, set `status` to `paused`; set it back to `active` to +resume. See [Pausing an inbox](/inboxes#pausing-an-inbox). + `PATCH /v0/inboxes/{inbox_id}` | Flag | Type | Required | Description | @@ -679,6 +687,287 @@ agentmail inboxes api-keys update --inbox-id --api-key-id _`):** cancels that date (`mode=single`, the default) or that date + and every later date (`mode=future`). Returns `202` with the cancelled date. A `mode=future` + delete from the first date deletes the whole series and returns a `deletion_id` instead. + A date that is already running still gets its `calendar.event.ending`. + +Deleting a one-off or series event sends `calendar.event.deleted`. Cancelling dates sends +`calendar.event.updated` with the cancelled date. With `send_invites=true` the organizer +inbox also emails a cancellation to every attendee. Requires the `calendar_event_delete` +permission. To make the delete conditional, send the current `etag` in `If-Match`. + +Emailing cancellations counts one send per attendee against the organization, pod and inbox +send limits, charged before the delete; an over-limit request returns `429` +`rate_limit_exceeded` and deletes nothing. + +Calendar is in private beta: organizations without access receive a `403`. + +`DELETE /v0/inboxes/{inbox_id}/calendar/events/{event_id}` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--inbox-id` | `inboxesInboxId` | Yes | | +| `--event-id` | `CalendarEventId` | Yes | | +| `--mode` | `InstanceMutationMode` | No | | +| `--send-invites` | `boolean` | No | When `true`, emails a cancellation (iCalendar `CANCEL`) to every attendee. Only the organizer can send. Defaults to `false`. | +| `--if-match` | `string` | No | The event's or date's current `etag`. Optional; makes the delete conditional; `*` matches any current version. | +| `--idempotency-key` | `string` | No | 1 to 128 visible ASCII characters. Optional. Retrying a delete with the same key +returns the original result; without a key, retries of the same delete share one +derived from the event and `send_invites`, so a keyless retry that changes +`send_invites` is a different delete and returns `404` while removal runs. Keys are +unique across your organization: reusing one to delete a different event returns +`409` `idempotency_conflict`. | + +#### `agentmail inboxes calendar get` `[PRE RELEASE]` + +Gets the inbox's calendar. Every inbox has one calendar, so this works before any event is +created. Its `etag` (also the `ETag` response header) is the value to send in `If-Match` to +make an update conditional. + +Requires the `calendar_read` permission. Calendar is in private beta: organizations without +access receive a `403`. + +`GET /v0/inboxes/{inbox_id}/calendar` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--inbox-id` | `inboxesInboxId` | Yes | | +| `--consistency` | `CalendarConsistency` | No | | + +#### `agentmail inboxes calendar get-agenda` `[PRE RELEASE]` + +Lists every date on the calendar in a time window, ordered by start time: one-off events, +and recurring events expanded into their individual dates, with cancelled dates left out. +Use it to answer "what is on the calendar". + +The window defaults to now through 90 days from now and can be at most 366 days. Items omit +`description`, `metadata` and `attendees`; get an event by ID for the full object. Dates of +recurring events appear only up to about 90 days from now; use List Event Instances for a +recurring event's later dates. While a recurring event's dates are being regenerated after a +schedule change, which takes a few seconds, the agenda can briefly leave out some of them; +dates that have already started or ended stay as they ran. + +The agenda is read in the region that serves the request, so it can trail a change made +moments earlier by a few seconds. Pass `consistency=primary` to read your own change right +away. Requires the `calendar_event_read` permission. + +Calendar is in private beta: organizations without access receive a `403`. + +`GET /v0/inboxes/{inbox_id}/calendar/agenda` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--inbox-id` | `inboxesInboxId` | Yes | | +| `--consistency` | `CalendarConsistency` | No | | +| `--after` | `WindowAfter` | No | | +| `--before` | `WindowBefore` | No | | +| `--include-overlapping` | `IncludeOverlapping` | No | | +| `--limit` | `CalendarLimit` | No | | +| `--page-token` | `PageToken` | No | | + +#### `agentmail inboxes calendar get-event` `[PRE RELEASE]` + +Gets an event by its UUID, or one date of a recurring event by its dated ID +(`_`). A dated ID returns the date as it currently stands, including any edit +to it, with `kind: instance`. + +The response's `etag` (also the `ETag` header) is the value to send in `If-Match` to make an +update, delete or response to this event or date conditional. Treat it as opaque. + +Reads can trail a change made moments earlier by a few seconds; pass `consistency=primary` +to read the latest state of an event or a date. A date that has already started or ended +reads back as it ran, even if a later change to the series no longer produces it. Requires +the `calendar_event_read` permission. + +Calendar is in private beta: organizations without access receive a `403`. + +`GET /v0/inboxes/{inbox_id}/calendar/events/{event_id}` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--inbox-id` | `inboxesInboxId` | Yes | | +| `--event-id` | `CalendarEventId` | Yes | | +| `--consistency` | `CalendarConsistency` | No | | + +#### `agentmail inboxes calendar list-event-instances` `[PRE RELEASE]` + +Lists the dates of one recurring event in a time window, in start order, with each date's +edits applied. Dates are computed from the rule, so this works for any window up to 366 +days, including dates far in the future. Cancelled dates are left out. + +The window defaults to now through 90 days from now. Items omit `description`, `metadata` +and `attendees`; get a date by its ID for the full object. Like other reads, the list can +trail a change made moments earlier by a few seconds; pass `consistency=primary` to read +your own change right away. Requires the `calendar_event_read` permission. + +Calendar is in private beta: organizations without access receive a `403`. + +`GET /v0/inboxes/{inbox_id}/calendar/events/{event_id}/instances` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--inbox-id` | `inboxesInboxId` | Yes | | +| `--event-id` | `string` | Yes | UUID of the recurring event. | +| `--consistency` | `CalendarConsistency` | No | | +| `--after` | `WindowAfter` | No | | +| `--before` | `WindowBefore` | No | | +| `--include-overlapping` | `IncludeOverlapping` | No | | +| `--limit` | `CalendarLimit` | No | | +| `--page-token` | `PageToken` | No | | + +#### `agentmail inboxes calendar list-events` `[PRE RELEASE]` + +Lists the events stored on the calendar: one item per one-off or recurring event, plus one +item for each edited date of a recurring event (as that dated event, with +`is_exception: true`). Ordered by most recently updated, and cancelled events are included. +Use it to sync or manage what you created. To see what is on the calendar in a time window, +use Get Agenda. + +The list is always read in the region that serves the request, so it can trail a change made +moments earlier by a few seconds. Requires the `calendar_event_read` permission. + +Calendar is in private beta: organizations without access receive a `403`. + +`GET /v0/inboxes/{inbox_id}/calendar/events` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--inbox-id` | `inboxesInboxId` | Yes | | +| `--limit` | `CalendarLimit` | No | | +| `--page-token` | `PageToken` | No | | + +#### `agentmail inboxes calendar respond-to-event` `[PRE RELEASE]` + +Accepts, declines or tentatively accepts an invitation the inbox received by email. Pass the +event's UUID to respond for every date, or a dated ID to respond for one date only. + +Only works on `email` events where the inbox is an attendee; anything else returns 409 +`calendar_response_invalid`. Updates the inbox's attendee entry and sends +`calendar.event.responded`. With `send_reply` (default `true`) the inbox emails the response +to the organizer. + +Requires the `calendar_event_update` permission. To make the response conditional, send the +current `etag` in `If-Match`. + +A reply email counts as one send against the organization, pod and inbox send limits, +charged before the response is saved; an over-limit request returns `429` +`rate_limit_exceeded` and changes nothing. + +Calendar is in private beta: organizations without access receive a `403`. + +`POST /v0/inboxes/{inbox_id}/calendar/events/{event_id}/respond` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--inbox-id` | `inboxesInboxId` | Yes | | +| `--event-id` | `CalendarEventId` | Yes | | +| `--if-match` | `string` | No | The event's or date's current `etag`. Optional; makes the response conditional; `*` matches any current version. | +| `--json` | `JSON` | Yes | Request body as JSON (or use individual body-field flags) | + +#### `agentmail inboxes calendar update` `[PRE RELEASE]` + +Updates the calendar's default time zone. Existing events keep their own `timezone`; only +events created later without a `timezone` use the new default. + +Requires the `calendar_update` permission. To make the update conditional, send the +calendar's current `etag` in `If-Match`: a stale value returns `412`. Without `If-Match` the +update applies to the calendar as it is. + +Calendar is in private beta: organizations without access receive a `403`. + +`PATCH /v0/inboxes/{inbox_id}/calendar` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--inbox-id` | `inboxesInboxId` | Yes | | +| `--if-match` | `string` | No | The calendar's current `etag`, for example `"rv-0"`. Optional; makes the update conditional; `*` matches any current version. | +| `--json` | `JSON` | Yes | Request body as JSON (or use individual body-field flags) | + +#### `agentmail inboxes calendar update-event` `[PRE RELEASE]` + +Updates an event. Send only the fields to change. To make the update conditional, send the +event's current `etag` in `If-Match`: a stale value returns `412`. Without `If-Match` the +update applies to the event as it is; a change that lands while it runs returns `409` +`race_condition`, so retry. Send `If-Match` when replacing `attendees`, so you don't +overwrite a response that arrived in the meantime. + +- **One-off or series UUID:** changes the event itself. For a series, the change applies to + every date that has not been edited individually. +- **Dated ID (`_`):** changes one date (`mode=single`, the default) or that date + and every later date (`mode=future`). `all_day`, `timezone` and `recurrence` cannot be sent + for a dated ID. + +Once a date has started, its start can no longer change (409 `event_already_started`), but +its end and status can; for a one-off or series UUID, send the unchanged `start` with the new +`end`. Once it has ended, only `title`, `description`, `location`, +`metadata` and `attendees` can change. During the few seconds a date is starting, schedule +changes return 409 `event_starting`; retry shortly. + +Sends `calendar.event.updated`. With `send_invites: true` the organizer inbox also emails the +updated invitation to every attendee. Requires the `calendar_event_update` permission. + +Emailing attendees counts one send per attendee against the organization, pod and inbox +send limits, charged before the change is saved; an over-limit request returns `429` +`rate_limit_exceeded` and changes nothing. + +Calendar is in private beta: organizations without access receive a `403`. + +`PATCH /v0/inboxes/{inbox_id}/calendar/events/{event_id}` + +| Flag | Type | Required | Description | +|------|------|----------|-------------| +| `--inbox-id` | `inboxesInboxId` | Yes | | +| `--event-id` | `CalendarEventId` | Yes | | +| `--mode` | `InstanceMutationMode` | No | | +| `--if-match` | `string` | No | The event's or date's current `etag`, from the latest read or write response. Optional; makes the update conditional; `*` matches any current version. | +| `--json` | `JSON` | Yes | Request body as JSON (or use individual body-field flags) | + +--- + ### `agentmail inboxes drafts` #### `agentmail inboxes drafts create` From 71da769b738f48315ed69ee2e9e8994e93afc57a Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 6 Oct 2026 05:27:27 +0000 Subject: [PATCH 2/2] [fern-replay] Applied customizations Patches with unresolved conflicts (2): - patch-bf63549e: chore: restore .fernignore, defer windows npm package - patch-9c5e5935: chore: publish packageIdentity metadata to npm, restore .fernignore Run `fern-replay resolve` to apply these customizations. --- .fern/replay.lock | 8 ++- .github/workflows/ci.yml | 10 ++-- Cargo.lock | 102 ++++++++++++++++++++++++++++----------- 3 files changed, 85 insertions(+), 35 deletions(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index 7375dcf..1677200 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -60,7 +60,13 @@ generations: cli_version: unknown generator_versions: fernapi/fern-cli-generator: 0.38.10 -current_generation: c2dac7d33a1b45c1144403af99c98aedb4d428f6 + - commit_sha: 71e33be5100ac2b6124ea0b07124c9947f0b8b50 + tree_hash: ec5bc6f7a1e2dfd2a9be164896c2ba66a82a2d81 + timestamp: 2026-10-06T05:27:23.180Z + cli_version: unknown + generator_versions: + fernapi/fern-cli-generator: 0.38.10 +current_generation: 71e33be5100ac2b6124ea0b07124c9947f0b8b50 patches: - id: patch-bf63549e content_hash: sha256:a660ef1be2e6211b2d9aee152022a339ffd879d56f0e8b0b557ce0fb5e4d9b5c diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a25fbb..f445ed1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,9 +112,6 @@ jobs: - rust-target: aarch64-apple-darwin runner: macos-latest npm-platform-suffix: darwin-arm64 - - rust-target: x86_64-pc-windows-msvc - runner: windows-latest - npm-platform-suffix: win32-x64 steps: - name: Checkout repo uses: actions/checkout@v6 @@ -257,8 +254,7 @@ jobs: OPTIONAL_DEPS="${OPTIONAL_DEPS}\"agentmail-cli-linux-x64\": \"${VERSION}\"," OPTIONAL_DEPS="${OPTIONAL_DEPS}\"agentmail-cli-linux-arm64\": \"${VERSION}\"," OPTIONAL_DEPS="${OPTIONAL_DEPS}\"agentmail-cli-darwin-x64\": \"${VERSION}\"," - OPTIONAL_DEPS="${OPTIONAL_DEPS}\"agentmail-cli-darwin-arm64\": \"${VERSION}\"," - OPTIONAL_DEPS="${OPTIONAL_DEPS}\"agentmail-cli-win32-x64\": \"${VERSION}\"" + OPTIONAL_DEPS="${OPTIONAL_DEPS}\"agentmail-cli-darwin-arm64\": \"${VERSION}\"" cat > "${PKG_DIR}/package.json" <