{
	"openapi": "3.1.0",
	"info": {
		"title": "Mailset API",
		"version": "1",
		"summary": "Send email from your product, and run everything else Mailset does.",
		"description": "Everything Mailset does is a command, and every command is one request: `POST /v1/<command id>` with a JSON body `{ \"input\": { … } }`. The answer is `{ \"ok\": true, \"data\": … }`, or `{ \"ok\": false, \"error\": { \"code\", \"message\" } }` with a matching HTTP status.\n\nEvery request is signed with the key inside your `MAILSET_KEY` or API token. An SDK does it for you: https://mailset.app/docs/authentication says how to make a key and keep it alive. To sign a request yourself, send `Authorization: Bearer <token>`, `ms-time` and `ms-proof`, an ECDSA P-256 signature over the method, path, time and body. https://mailset.app/docs/authentication/http has the exact scheme, a test vector and a client for Python, Go, Ruby, PHP, Java and Rust.",
		"termsOfService": "https://mailset.app/terms"
	},
	"externalDocs": {
		"description": "Mailset docs",
		"url": "https://mailset.app/docs"
	},
	"servers": [
		{
			"url": "https://mailset.app"
		}
	],
	"tags": [
		{
			"name": "Messages",
			"description": "Send email: whole messages from your product, or a person’s own.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/messages"
			}
		},
		{
			"name": "Delivery",
			"description": "Find what became of a message, recipient by recipient.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/delivery"
			}
		},
		{
			"name": "Event hook",
			"description": "The webhook that hears what became of your product’s email.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/hooks"
			}
		},
		{
			"name": "Unsubscribes",
			"description": "Who opted out of a mailbox’s or sending domain’s promotional email.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/unsubscribes"
			}
		},
		{
			"name": "App keys",
			"description": "The keys your product’s servers hold, and what each one may do.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/keys"
			}
		},
		{
			"name": "Key status",
			"description": "What the key making a call may do, and when it stops.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/grants"
			}
		},
		{
			"name": "API tokens",
			"description": "A person’s own login for scripts.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/tokens"
			}
		},
		{
			"name": "Codes",
			"description": "The newest one-time code an address received.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/codes"
			}
		},
		{
			"name": "Sending domains",
			"description": "Sending-only subdomains, their suppressions, and your org’s limits.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/sending"
			}
		},
		{
			"name": "Campaigns",
			"description": "Bulk email from a sending domain, and its event hook.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/campaigns"
			}
		},
		{
			"name": "Inbound routes",
			"description": "Email to a subdomain, delivered to your webhook.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/routes"
			}
		},
		{
			"name": "Domains",
			"description": "Add a domain, check its records, and set its policies.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/domains"
			}
		},
		{
			"name": "DNS connection",
			"description": "Let Mailset write the records in your own DNS account.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/dns"
			}
		},
		{
			"name": "Postmaster",
			"description": "How Gmail sees each of your domains.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/postmaster"
			}
		},
		{
			"name": "Senders",
			"description": "Photos for the addresses you send from, and who writes to you.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/senders"
			}
		},
		{
			"name": "Mailboxes",
			"description": "Create mailboxes, and decide who holds each one.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/mailboxes"
			}
		},
		{
			"name": "Aliases",
			"description": "More addresses for one mailbox, catch-alls included.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/aliases"
			}
		},
		{
			"name": "Groups",
			"description": "One address that reaches several mailboxes.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/groups"
			}
		},
		{
			"name": "Delegates",
			"description": "Let a teammate read and send from your mailbox.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/delegates"
			}
		},
		{
			"name": "Forwarding",
			"description": "Send a mailbox’s new email on to another address.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/forwarding"
			}
		},
		{
			"name": "Vacation replies",
			"description": "The reply people get while you are away.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/vacation"
			}
		},
		{
			"name": "Imports",
			"description": "Copy a mailbox’s email over from a Google account.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/imports"
			}
		},
		{
			"name": "Mailbox pictures",
			"description": "The picture a mailbox shows inside Mailset.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/avatars"
			}
		},
		{
			"name": "Default address",
			"description": "The address your new email goes out from.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/addresses"
			}
		},
		{
			"name": "Conversations",
			"description": "List, search, read and file conversations.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/threads"
			}
		},
		{
			"name": "Drafts",
			"description": "Save a draft, attach files, and throw one away.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/drafts"
			}
		},
		{
			"name": "Attachments",
			"description": "Download a file from a message.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/attachments"
			}
		},
		{
			"name": "Labels",
			"description": "Your own labels for conversations.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/labels"
			}
		},
		{
			"name": "Rules",
			"description": "File, label or forward new email as it arrives.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/rules"
			}
		},
		{
			"name": "Tab rules",
			"description": "Always file a sender or a domain in one inbox tab.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/tabrules"
			}
		},
		{
			"name": "Blocked senders",
			"description": "Discard a sender’s new email before it is stored.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/blocks"
			}
		},
		{
			"name": "Notes",
			"description": "A note in a shared conversation, for the team only.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/notes"
			}
		},
		{
			"name": "Follow-ups",
			"description": "Email you sent that still waits for an answer.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/followups"
			}
		},
		{
			"name": "Contacts",
			"description": "Your address book: add, merge, import and export.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/contacts"
			}
		},
		{
			"name": "AI",
			"description": "Summaries, drafts and sorting, and what runs them.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/ai"
			}
		},
		{
			"name": "Organizations",
			"description": "The orgs you are in, and an org’s name.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/orgs"
			}
		},
		{
			"name": "Members",
			"description": "Invite people, change roles, and remove someone.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/members"
			}
		},
		{
			"name": "Invites",
			"description": "Invites nobody has accepted yet.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/invites"
			}
		},
		{
			"name": "Policies",
			"description": "The org’s rules on forwarding and sessions.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/policies"
			}
		},
		{
			"name": "Billing",
			"description": "The plan, this month’s use, and the prepaid balance.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/billing"
			}
		},
		{
			"name": "Audit log",
			"description": "What happened in an org, and who did it.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/audit"
			}
		},
		{
			"name": "Paper key",
			"description": "The org’s way back in when every passkey is lost.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/paperkey"
			}
		},
		{
			"name": "Who am I",
			"description": "Who a credential signs in as.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/whoami"
			}
		},
		{
			"name": "Settings",
			"description": "Your own preferences, on every device.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/settings"
			}
		},
		{
			"name": "Devices",
			"description": "Where you are signed in, and signing a device out.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/devices"
			}
		},
		{
			"name": "Passkeys",
			"description": "The passkeys that sign you in.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/passkeys"
			}
		},
		{
			"name": "Notifications",
			"description": "The devices that get push notifications.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/push"
			}
		},
		{
			"name": "Activity",
			"description": "What your account has done lately.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/activity"
			}
		},
		{
			"name": "Storage",
			"description": "How much email each of your mailboxes holds.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/storage"
			}
		},
		{
			"name": "Exports",
			"description": "A copy of your whole account, to download.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/exports"
			}
		},
		{
			"name": "Account",
			"description": "Deactivate or delete your own account.",
			"externalDocs": {
				"url": "https://mailset.app/docs/api/account"
			}
		}
	],
	"security": [
		{
			"token": [],
			"time": [],
			"proof": []
		}
	],
	"paths": {
		"/v1/whoami": {
			"post": {
				"operationId": "whoami",
				"summary": "Show who you are signed in as",
				"description": "Any app key. Or a person: any signed-in person, with an API token.",
				"tags": [
					"Who am I"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/whoami#whoami"
				},
				"x-mailset-cli": "mailset whoami",
				"x-mailset-cli-example": "mailset whoami",
				"x-mailset-grant": "any",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"user": {
													"type": "object",
													"properties": {
														"id": {
															"type": "string",
															"description": "The account’s id."
														},
														"email": {
															"type": "string",
															"description": "The address they sign in with."
														},
														"name": {
															"description": "Their name. Null when they haven’t given one.",
															"type": [
																"string",
																"null"
															]
														}
													},
													"required": [
														"id",
														"email",
														"name"
													],
													"additionalProperties": false,
													"description": "The account signed in."
												},
												"orgs": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string",
																"description": "The org’s id: what `--org` takes."
															},
															"name": {
																"type": "string",
																"description": "The org’s name, as its people see it."
															},
															"role": {
																"type": "string",
																"enum": [
																	"owner",
																	"admin",
																	"member"
																],
																"description": "Your role in it: `owner`, `admin` or `member`."
															}
														},
														"required": [
															"id",
															"name",
															"role"
														],
														"additionalProperties": false
													},
													"description": "The orgs the account is in."
												},
												"device": {
													"type": "object",
													"properties": {
														"id": {
															"type": "string",
															"description": "The device’s id."
														},
														"name": {
															"type": "string",
															"description": "Its name: “Safari on iPhone”, or the name an app or token was given."
														},
														"kind": {
															"type": "string",
															"enum": [
																"browser",
																"cli",
																"token",
																"app",
																"phone"
															],
															"description": "What it is: a `browser`, the `cli`, an API `token`, an `app` with a key, or the iPhone app (`phone`)."
														}
													},
													"required": [
														"id",
														"name",
														"kind"
													],
													"additionalProperties": false,
													"description": "The device, token or app key this call is signed in as."
												},
												"defaultFrom": {
													"description": "The address new mail goes out from. Null when they haven’t picked one.",
													"type": [
														"string",
														"null"
													]
												},
												"sessionEndsAt": {
													"description": "When this session ends, in ms since the epoch, unless it’s ended sooner. Only `whoami` says it.",
													"type": "number"
												},
												"passkeyHandle": {
													"description": "The user handle the account’s passkeys carry. Only `whoami` says it, and only to a person’s own device.",
													"type": "string"
												}
											},
											"required": [
												"user",
												"orgs",
												"device",
												"defaultFrom"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/settings.get": {
			"post": {
				"operationId": "settings.get",
				"summary": "Show your settings",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Settings"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/settings#settings.get"
				},
				"x-mailset-cli": "mailset settings get",
				"x-mailset-cli-example": "mailset settings get",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"density": {
													"default": "comfortable",
													"type": "string",
													"enum": [
														"comfortable",
														"compact"
													],
													"description": "How tight lists are: `comfortable` or `compact`."
												},
												"inboxType": {
													"default": "sections",
													"type": "string",
													"enum": [
														"sections",
														"tabs",
														"unread",
														"starred"
													],
													"description": "How the inbox is cut up: `sections`, `tabs`, unread first (`unread`) or starred first (`starred`)."
												},
												"inboxTabs": {
													"default": [
														"primary",
														"updates",
														"newsletters",
														"promotions"
													],
													"maxItems": 6,
													"type": "array",
													"items": {
														"type": "string",
														"enum": [
															"primary",
															"updates",
															"newsletters",
															"promotions",
															"receipts",
															"notifications"
														]
													},
													"description": "Which categories are tabs of their own. The rest fold into Updates. `primary` always stays."
												},
												"allInboxesHidden": {
													"default": [],
													"maxItems": 500,
													"type": "array",
													"items": {
														"type": "string",
														"maxLength": 254,
														"format": "email",
														"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
													},
													"description": "Mailboxes kept out of All inboxes. A new mailbox is in until you say otherwise."
												},
												"readingPane": {
													"default": "none",
													"type": "string",
													"enum": [
														"none",
														"right",
														"below"
													],
													"description": "Where an open conversation shows beside the list: `none`, `right` or `below`."
												},
												"timeFormat": {
													"default": "24h",
													"type": "string",
													"enum": [
														"24h",
														"12h"
													],
													"description": "How times read: 24-hour (18:00) or 12-hour (6:00 PM)."
												},
												"undoSeconds": {
													"default": 10,
													"type": "number",
													"description": "Seconds mail waits before it leaves, so it can be taken back: 5, 10, 20 or 30."
												},
												"conversations": {
													"default": true,
													"type": "boolean",
													"description": "On folds older messages in a conversation. Off opens them all."
												},
												"sendArchive": {
													"default": true,
													"type": "boolean",
													"description": "Show a button that sends a reply and archives the conversation."
												},
												"images": {
													"default": "ask",
													"type": "string",
													"enum": [
														"ask",
														"always"
													],
													"description": "Remote images in mail: `ask` before showing them, or `always` show them."
												},
												"originalColors": {
													"default": [],
													"maxItems": 500,
													"type": "array",
													"items": {
														"type": "string",
														"maxLength": 254,
														"format": "email",
														"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
													},
													"description": "Senders whose mail shows in the colours it was sent in, never recoloured for the dark theme: the message’s Original colours switch, on the web and the iPhone. The newest go last."
												},
												"leaveAsk": {
													"default": true,
													"type": "boolean",
													"description": "Ask before Unsubscribe opens a sender’s own page in a new tab."
												},
												"shortcuts": {
													"default": true,
													"type": "boolean",
													"description": "Keyboard shortcuts on or off."
												},
												"notify": {
													"default": "important",
													"type": "string",
													"enum": [
														"all",
														"important",
														"people",
														"none"
													],
													"description": "Which new mail notifies you: `all`, `important`, only mail from `people`, or `none`."
												},
												"notifyPerMailbox": {
													"default": {},
													"type": "object",
													"propertyNames": {
														"type": "string",
														"maxLength": 254,
														"format": "email",
														"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
													},
													"additionalProperties": {
														"type": "string",
														"enum": [
															"same",
															"all",
															"none"
														]
													},
													"description": "Mailboxes that notify differently, by address: `same` as `notify`, `all` or `none`."
												},
												"preview": {
													"default": "sender",
													"type": "string",
													"enum": [
														"full",
														"sender",
														"none"
													],
													"description": "What a notification shows: the sender and subject (`full`), only the `sender`, or `none`."
												},
												"push": {
													"default": true,
													"type": "boolean",
													"description": "Push notifications on or off."
												},
												"quiet": {
													"default": true,
													"type": "boolean",
													"description": "Quiet hours: notifications from 22:00 to 07:00 are held, then arrive as one."
												},
												"digest": {
													"default": "off",
													"type": "string",
													"enum": [
														"off",
														"daily",
														"weekly"
													],
													"description": "A summary of new mail filed in your inbox: `off`, `daily` or `weekly`."
												},
												"ai": {
													"default": true,
													"type": "boolean",
													"description": "AI on your mail. Off, none of your mail goes to a model."
												},
												"triage": {
													"default": true,
													"type": "boolean",
													"description": "Sort mail into tabs and flag what needs a reply. Off, there’s one inbox."
												},
												"summaries": {
													"default": true,
													"type": "boolean",
													"description": "A short summary on long conversations."
												},
												"drafts": {
													"default": true,
													"type": "boolean",
													"description": "Draft replies written for you. Nothing is sent without you."
												},
												"followUps": {
													"default": 3,
													"type": "number",
													"description": "Days without an answer before mail you sent comes back: 2, 3, 5 or 7. 0 turns it off."
												},
												"phishing": {
													"default": true,
													"type": "boolean",
													"description": "Warn about mail that looks forged."
												},
												"aliasReply": {
													"default": "received",
													"type": "string",
													"enum": [
														"received",
														"default"
													],
													"description": "The address a reply goes from: the one the mail reached (`received`), or your `default` address."
												},
												"vacation": {
													"default": false,
													"type": "boolean",
													"description": "Whether your vacation replies may go out."
												},
												"forwarding": {
													"default": "passkey",
													"type": "string",
													"enum": [
														"passkey",
														"never"
													],
													"description": "Forwarding rules: allowed with a `passkey` check, or `never`."
												},
												"sharedAi": {
													"default": true,
													"type": "boolean",
													"description": "Whether AI runs on shared mailboxes."
												},
												"sessionDays": {
													"default": 30,
													"type": "number",
													"description": "How long a new sign-in lasts, in days: 30, 7 or 0.5 (12 hours)."
												}
											},
											"required": [
												"density",
												"inboxType",
												"inboxTabs",
												"allInboxesHidden",
												"readingPane",
												"timeFormat",
												"undoSeconds",
												"conversations",
												"sendArchive",
												"images",
												"originalColors",
												"leaveAsk",
												"shortcuts",
												"notify",
												"notifyPerMailbox",
												"preview",
												"push",
												"quiet",
												"digest",
												"ai",
												"triage",
												"summaries",
												"drafts",
												"followUps",
												"phishing",
												"aliasReply",
												"vacation",
												"forwarding",
												"sharedAi",
												"sessionDays"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/settings.set": {
			"post": {
				"operationId": "settings.set",
				"summary": "Change settings",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Settings"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/settings#settings.set"
				},
				"x-mailset-cli": "mailset settings set [--density comfortable|compact] [--inbox-type sections|tabs|unread|starred] [--inbox-tabs <a,b,…>] [--all-inboxes-hidden <a,b,…>] [--reading-pane none|right|below] [--time-format 24h|12h] [--undo-seconds <n>] [--conversations] [--send-archive] [--images ask|always] [--original-colors <a,b,…>] [--leave-ask] [--shortcuts] [--notify all|important|people|none] [--notify-per-mailbox <json>] [--preview full|sender|none] [--push] [--quiet] [--digest off|daily|weekly] [--ai] [--triage] [--summaries] [--drafts] [--follow-ups <n>] [--phishing] [--alias-reply received|default] [--vacation] [--forwarding passkey|never] [--shared-ai] [--session-days <n>]",
				"x-mailset-cli-example": "mailset settings set --density compact --undo-seconds 20",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"density": {
												"type": "string",
												"enum": [
													"comfortable",
													"compact"
												],
												"description": "How tight lists are: `comfortable` or `compact`."
											},
											"inboxType": {
												"type": "string",
												"enum": [
													"sections",
													"tabs",
													"unread",
													"starred"
												],
												"description": "How the inbox is cut up: `sections`, `tabs`, unread first (`unread`) or starred first (`starred`)."
											},
											"inboxTabs": {
												"maxItems": 6,
												"type": "array",
												"items": {
													"type": "string",
													"enum": [
														"primary",
														"updates",
														"newsletters",
														"promotions",
														"receipts",
														"notifications"
													]
												},
												"description": "Which categories are tabs of their own. The rest fold into Updates. `primary` always stays."
											},
											"allInboxesHidden": {
												"maxItems": 500,
												"type": "array",
												"items": {
													"type": "string"
												},
												"description": "Mailboxes kept out of All inboxes. A new mailbox is in until you say otherwise."
											},
											"readingPane": {
												"type": "string",
												"enum": [
													"none",
													"right",
													"below"
												],
												"description": "Where an open conversation shows beside the list: `none`, `right` or `below`."
											},
											"timeFormat": {
												"type": "string",
												"enum": [
													"24h",
													"12h"
												],
												"description": "How times read: 24-hour (18:00) or 12-hour (6:00 PM)."
											},
											"undoSeconds": {
												"type": "number",
												"description": "Seconds mail waits before it leaves, so it can be taken back: 5, 10, 20 or 30."
											},
											"conversations": {
												"type": "boolean",
												"description": "On folds older messages in a conversation. Off opens them all."
											},
											"sendArchive": {
												"type": "boolean",
												"description": "Show a button that sends a reply and archives the conversation."
											},
											"images": {
												"type": "string",
												"enum": [
													"ask",
													"always"
												],
												"description": "Remote images in mail: `ask` before showing them, or `always` show them."
											},
											"originalColors": {
												"maxItems": 500,
												"type": "array",
												"items": {
													"type": "string"
												},
												"description": "Senders whose mail shows in the colours it was sent in, never recoloured for the dark theme: the message’s Original colours switch, on the web and the iPhone. The newest go last."
											},
											"leaveAsk": {
												"type": "boolean",
												"description": "Ask before Unsubscribe opens a sender’s own page in a new tab."
											},
											"shortcuts": {
												"type": "boolean",
												"description": "Keyboard shortcuts on or off."
											},
											"notify": {
												"type": "string",
												"enum": [
													"all",
													"important",
													"people",
													"none"
												],
												"description": "Which new mail notifies you: `all`, `important`, only mail from `people`, or `none`."
											},
											"notifyPerMailbox": {
												"type": "object",
												"propertyNames": {
													"type": "string"
												},
												"additionalProperties": {
													"type": "string",
													"enum": [
														"same",
														"all",
														"none"
													]
												},
												"description": "Mailboxes that notify differently, by address: `same` as `notify`, `all` or `none`."
											},
											"preview": {
												"type": "string",
												"enum": [
													"full",
													"sender",
													"none"
												],
												"description": "What a notification shows: the sender and subject (`full`), only the `sender`, or `none`."
											},
											"push": {
												"type": "boolean",
												"description": "Push notifications on or off."
											},
											"quiet": {
												"type": "boolean",
												"description": "Quiet hours: notifications from 22:00 to 07:00 are held, then arrive as one."
											},
											"digest": {
												"type": "string",
												"enum": [
													"off",
													"daily",
													"weekly"
												],
												"description": "A summary of new mail filed in your inbox: `off`, `daily` or `weekly`."
											},
											"ai": {
												"type": "boolean",
												"description": "AI on your mail. Off, none of your mail goes to a model."
											},
											"triage": {
												"type": "boolean",
												"description": "Sort mail into tabs and flag what needs a reply. Off, there’s one inbox."
											},
											"summaries": {
												"type": "boolean",
												"description": "A short summary on long conversations."
											},
											"drafts": {
												"type": "boolean",
												"description": "Draft replies written for you. Nothing is sent without you."
											},
											"followUps": {
												"type": "number",
												"description": "Days without an answer before mail you sent comes back: 2, 3, 5 or 7. 0 turns it off."
											},
											"phishing": {
												"type": "boolean",
												"description": "Warn about mail that looks forged."
											},
											"aliasReply": {
												"type": "string",
												"enum": [
													"received",
													"default"
												],
												"description": "The address a reply goes from: the one the mail reached (`received`), or your `default` address."
											},
											"vacation": {
												"type": "boolean",
												"description": "Whether your vacation replies may go out."
											},
											"forwarding": {
												"type": "string",
												"enum": [
													"passkey",
													"never"
												],
												"description": "Forwarding rules: allowed with a `passkey` check, or `never`."
											},
											"sharedAi": {
												"type": "boolean",
												"description": "Whether AI runs on shared mailboxes."
											},
											"sessionDays": {
												"type": "number",
												"description": "How long a new sign-in lasts, in days: 30, 7 or 0.5 (12 hours)."
											}
										},
										"additionalProperties": false
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"density": "compact",
									"undoSeconds": 20
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"density": {
													"default": "comfortable",
													"type": "string",
													"enum": [
														"comfortable",
														"compact"
													],
													"description": "How tight lists are: `comfortable` or `compact`."
												},
												"inboxType": {
													"default": "sections",
													"type": "string",
													"enum": [
														"sections",
														"tabs",
														"unread",
														"starred"
													],
													"description": "How the inbox is cut up: `sections`, `tabs`, unread first (`unread`) or starred first (`starred`)."
												},
												"inboxTabs": {
													"default": [
														"primary",
														"updates",
														"newsletters",
														"promotions"
													],
													"maxItems": 6,
													"type": "array",
													"items": {
														"type": "string",
														"enum": [
															"primary",
															"updates",
															"newsletters",
															"promotions",
															"receipts",
															"notifications"
														]
													},
													"description": "Which categories are tabs of their own. The rest fold into Updates. `primary` always stays."
												},
												"allInboxesHidden": {
													"default": [],
													"maxItems": 500,
													"type": "array",
													"items": {
														"type": "string",
														"maxLength": 254,
														"format": "email",
														"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
													},
													"description": "Mailboxes kept out of All inboxes. A new mailbox is in until you say otherwise."
												},
												"readingPane": {
													"default": "none",
													"type": "string",
													"enum": [
														"none",
														"right",
														"below"
													],
													"description": "Where an open conversation shows beside the list: `none`, `right` or `below`."
												},
												"timeFormat": {
													"default": "24h",
													"type": "string",
													"enum": [
														"24h",
														"12h"
													],
													"description": "How times read: 24-hour (18:00) or 12-hour (6:00 PM)."
												},
												"undoSeconds": {
													"default": 10,
													"type": "number",
													"description": "Seconds mail waits before it leaves, so it can be taken back: 5, 10, 20 or 30."
												},
												"conversations": {
													"default": true,
													"type": "boolean",
													"description": "On folds older messages in a conversation. Off opens them all."
												},
												"sendArchive": {
													"default": true,
													"type": "boolean",
													"description": "Show a button that sends a reply and archives the conversation."
												},
												"images": {
													"default": "ask",
													"type": "string",
													"enum": [
														"ask",
														"always"
													],
													"description": "Remote images in mail: `ask` before showing them, or `always` show them."
												},
												"originalColors": {
													"default": [],
													"maxItems": 500,
													"type": "array",
													"items": {
														"type": "string",
														"maxLength": 254,
														"format": "email",
														"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
													},
													"description": "Senders whose mail shows in the colours it was sent in, never recoloured for the dark theme: the message’s Original colours switch, on the web and the iPhone. The newest go last."
												},
												"leaveAsk": {
													"default": true,
													"type": "boolean",
													"description": "Ask before Unsubscribe opens a sender’s own page in a new tab."
												},
												"shortcuts": {
													"default": true,
													"type": "boolean",
													"description": "Keyboard shortcuts on or off."
												},
												"notify": {
													"default": "important",
													"type": "string",
													"enum": [
														"all",
														"important",
														"people",
														"none"
													],
													"description": "Which new mail notifies you: `all`, `important`, only mail from `people`, or `none`."
												},
												"notifyPerMailbox": {
													"default": {},
													"type": "object",
													"propertyNames": {
														"type": "string",
														"maxLength": 254,
														"format": "email",
														"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
													},
													"additionalProperties": {
														"type": "string",
														"enum": [
															"same",
															"all",
															"none"
														]
													},
													"description": "Mailboxes that notify differently, by address: `same` as `notify`, `all` or `none`."
												},
												"preview": {
													"default": "sender",
													"type": "string",
													"enum": [
														"full",
														"sender",
														"none"
													],
													"description": "What a notification shows: the sender and subject (`full`), only the `sender`, or `none`."
												},
												"push": {
													"default": true,
													"type": "boolean",
													"description": "Push notifications on or off."
												},
												"quiet": {
													"default": true,
													"type": "boolean",
													"description": "Quiet hours: notifications from 22:00 to 07:00 are held, then arrive as one."
												},
												"digest": {
													"default": "off",
													"type": "string",
													"enum": [
														"off",
														"daily",
														"weekly"
													],
													"description": "A summary of new mail filed in your inbox: `off`, `daily` or `weekly`."
												},
												"ai": {
													"default": true,
													"type": "boolean",
													"description": "AI on your mail. Off, none of your mail goes to a model."
												},
												"triage": {
													"default": true,
													"type": "boolean",
													"description": "Sort mail into tabs and flag what needs a reply. Off, there’s one inbox."
												},
												"summaries": {
													"default": true,
													"type": "boolean",
													"description": "A short summary on long conversations."
												},
												"drafts": {
													"default": true,
													"type": "boolean",
													"description": "Draft replies written for you. Nothing is sent without you."
												},
												"followUps": {
													"default": 3,
													"type": "number",
													"description": "Days without an answer before mail you sent comes back: 2, 3, 5 or 7. 0 turns it off."
												},
												"phishing": {
													"default": true,
													"type": "boolean",
													"description": "Warn about mail that looks forged."
												},
												"aliasReply": {
													"default": "received",
													"type": "string",
													"enum": [
														"received",
														"default"
													],
													"description": "The address a reply goes from: the one the mail reached (`received`), or your `default` address."
												},
												"vacation": {
													"default": false,
													"type": "boolean",
													"description": "Whether your vacation replies may go out."
												},
												"forwarding": {
													"default": "passkey",
													"type": "string",
													"enum": [
														"passkey",
														"never"
													],
													"description": "Forwarding rules: allowed with a `passkey` check, or `never`."
												},
												"sharedAi": {
													"default": true,
													"type": "boolean",
													"description": "Whether AI runs on shared mailboxes."
												},
												"sessionDays": {
													"default": 30,
													"type": "number",
													"description": "How long a new sign-in lasts, in days: 30, 7 or 0.5 (12 hours)."
												}
											},
											"required": [
												"density",
												"inboxType",
												"inboxTabs",
												"allInboxesHidden",
												"readingPane",
												"timeFormat",
												"undoSeconds",
												"conversations",
												"sendArchive",
												"images",
												"originalColors",
												"leaveAsk",
												"shortcuts",
												"notify",
												"notifyPerMailbox",
												"preview",
												"push",
												"quiet",
												"digest",
												"ai",
												"triage",
												"summaries",
												"drafts",
												"followUps",
												"phishing",
												"aliasReply",
												"vacation",
												"forwarding",
												"sharedAi",
												"sessionDays"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/push.list": {
			"post": {
				"operationId": "push.list",
				"summary": "List the devices that get push notifications",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Notifications"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/push#push.list"
				},
				"x-mailset-cli": "mailset push list",
				"x-mailset-cli-example": "mailset push list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string"
													},
													"name": {
														"type": "string"
													},
													"service": {
														"type": "string",
														"enum": [
															"Google",
															"Apple",
															"Mozilla",
															"Other"
														]
													},
													"timeZone": {
														"type": "string"
													},
													"current": {
														"type": "boolean"
													},
													"createdAt": {
														"type": "number"
													},
													"lastSentAt": {
														"type": [
															"number",
															"null"
														]
													}
												},
												"required": [
													"id",
													"name",
													"service",
													"timeZone",
													"current",
													"createdAt",
													"lastSentAt"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/push.remove": {
			"post": {
				"operationId": "push.remove",
				"summary": "Stop push to a device",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Notifications"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/push#push.remove"
				},
				"x-mailset-cli": "mailset push remove <id>",
				"x-mailset-cli-example": "mailset push remove ps_7c2e9a4f1b6d3058e1a4c9b3",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The device’s id, from `push list`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "ps_7c2e9a4f1b6d3058e1a4c9b3"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean"
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/push.test": {
			"post": {
				"operationId": "push.test",
				"summary": "Send a test notification to your devices, or one with id",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Notifications"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/push#push.test"
				},
				"x-mailset-cli": "mailset push test [--id <id>]",
				"x-mailset-cli-example": "mailset push test",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"description": "Only this device, by its id from `push list`. Left out: all of yours.",
												"type": "string",
												"minLength": 1
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"sent": {
													"type": "number"
												},
												"failed": {
													"type": "number"
												},
												"removed": {
													"type": "number",
													"description": "Devices the push service no longer knows, now forgotten."
												}
											},
											"required": [
												"sent",
												"failed",
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/orgs.list": {
			"post": {
				"operationId": "orgs.list",
				"summary": "List your orgs",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Organizations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/orgs#orgs.list"
				},
				"x-mailset-cli": "mailset orgs list",
				"x-mailset-cli-example": "mailset orgs list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string",
														"description": "The org’s id: what `--org` takes."
													},
													"name": {
														"type": "string",
														"description": "The org’s name, as its people see it."
													},
													"role": {
														"type": "string",
														"enum": [
															"owner",
															"admin",
															"member"
														],
														"description": "Your role in it: `owner`, `admin` or `member`."
													}
												},
												"required": [
													"id",
													"name",
													"role"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/orgs.rename": {
			"post": {
				"operationId": "orgs.rename",
				"summary": "Rename the org",
				"description": "An admin or owner of the org.",
				"tags": [
					"Organizations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/orgs#orgs.rename"
				},
				"x-mailset-cli": "mailset orgs rename <name> [--org <id>]",
				"x-mailset-cli-example": "mailset orgs rename \"Acme Inc\"",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"type": "string",
												"minLength": 1,
												"maxLength": 80,
												"pattern": "^[^\\p{Cc}]+$",
												"description": "The org’s new name, up to 80 characters."
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "Acme Inc"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string",
													"description": "The org’s id: what `--org` takes."
												},
												"name": {
													"type": "string",
													"description": "The org’s name, as its people see it."
												},
												"role": {
													"type": "string",
													"enum": [
														"owner",
														"admin",
														"member"
													],
													"description": "Your role in it: `owner`, `admin` or `member`."
												}
											},
											"required": [
												"id",
												"name",
												"role"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/members.list": {
			"post": {
				"operationId": "members.list",
				"summary": "List the people in an org",
				"description": "Anyone in the org.",
				"tags": [
					"Members"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/members#members.list"
				},
				"x-mailset-cli": "mailset members list [--org <id>]",
				"x-mailset-cli-example": "mailset members list",
				"x-mailset-role": "member",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"userId": {
														"type": "string"
													},
													"email": {
														"type": "string"
													},
													"name": {
														"type": [
															"string",
															"null"
														]
													},
													"role": {
														"type": "string",
														"enum": [
															"owner",
															"admin",
															"member"
														]
													},
													"joinedAt": {
														"type": "number"
													},
													"deactivated": {
														"type": "boolean",
														"description": "Can’t sign in, and their mailboxes are closed to them, until reactivated."
													}
												},
												"required": [
													"userId",
													"email",
													"name",
													"role",
													"joinedAt",
													"deactivated"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/members.invite": {
			"post": {
				"operationId": "members.invite",
				"summary": "Invite someone to an org and email them the link",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Members"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/members#members.invite"
				},
				"x-mailset-cli": "mailset members invite --email <email> [--name <name>] [--role owner|admin|member] [--note <note>] [--no-email] [--yes] [--org <id>]",
				"x-mailset-cli-example": "mailset members invite --email ben@example.com --name \"Ben Carter\" --role member",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"email": {
												"description": "The address to invite.",
												"type": "string"
											},
											"name": {
												"description": "Their name: the email is addressed and greeted by it, and their account starts with it.",
												"type": "string",
												"maxLength": 80,
												"pattern": "^[^\\p{Cc}\\u202a-\\u202e\\u2066-\\u2069<>\"@]*$"
											},
											"role": {
												"default": "member",
												"description": "Their role in the org: `owner`, `admin` or `member`.",
												"type": "string",
												"enum": [
													"owner",
													"admin",
													"member"
												]
											},
											"note": {
												"description": "One line of your own words for the invite email, up to 500 characters.",
												"type": "string",
												"maxLength": 500,
												"pattern": "^[^\\p{Cc}\\u202a-\\u202e\\u2066-\\u2069]*$"
											},
											"noEmail": {
												"default": false,
												"description": "Only make the link: nothing is emailed.",
												"type": "boolean"
											},
											"yes": {
												"default": false,
												"description": "Past the plan’s members this adds a paid seat: yes, go ahead.",
												"type": "boolean"
											}
										},
										"required": [
											"email"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"email": "ben@example.com",
									"name": "Ben Carter",
									"role": "member"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string",
													"description": "The invite’s id: what `invites resend`, `extend` and `revoke` take."
												},
												"email": {
													"type": "string",
													"description": "The address invited."
												},
												"url": {
													"type": "string",
													"description": "The invite’s link, shown this once."
												},
												"expiresAt": {
													"type": "number",
													"description": "When the link stops working, in ms since the epoch."
												},
												"emailed": {
													"type": "boolean",
													"description": "The link went to the address by email too."
												}
											},
											"required": [
												"id",
												"email",
												"url",
												"expiresAt",
												"emailed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/members.role": {
			"post": {
				"operationId": "members.role",
				"summary": "Change someone’s role in an org",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Members"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/members#members.role"
				},
				"x-mailset-cli": "mailset members role <email> --role owner|admin|member [--org <id>]",
				"x-mailset-cli-example": "mailset members role ben@example.com --role admin",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"email": {
												"description": "The member’s address.",
												"type": "string"
											},
											"role": {
												"type": "string",
												"enum": [
													"owner",
													"admin",
													"member"
												],
												"description": "Their new role: `owner`, `admin` or `member`."
											}
										},
										"required": [
											"email",
											"role"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"role": "admin",
									"email": "ben@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"email": {
													"type": "string",
													"description": "The member’s address."
												},
												"role": {
													"type": "string",
													"enum": [
														"owner",
														"admin",
														"member"
													],
													"description": "The role they have now."
												}
											},
											"required": [
												"email",
												"role"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/members.plan": {
			"post": {
				"operationId": "members.plan",
				"summary": "Show what deactivating or removing someone would do",
				"description": "An admin or owner of the org.",
				"tags": [
					"Members"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/members#members.plan"
				},
				"x-mailset-cli": "mailset members plan <email> [--org <id>]",
				"x-mailset-cli-example": "mailset members plan ben@example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"email": {
												"description": "The member’s address.",
												"type": "string"
											}
										},
										"required": [
											"email"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"email": "ben@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"email": {
													"type": "string"
												},
												"role": {
													"type": "string",
													"enum": [
														"owner",
														"admin",
														"member"
													]
												},
												"sessions": {
													"type": "number",
													"description": "Signed-in devices and API tokens that stop working."
												},
												"onlyTheirs": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Nobody else can open these."
												},
												"shared": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Other people keep these."
												},
												"scheduled": {
													"type": "number",
													"description": "Mail waiting for its time, which won’t go."
												},
												"drafts": {
													"type": "number"
												},
												"appKeys": {
													"default": [],
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"name": {
																"type": "string"
															},
															"sendsAs": {
																"type": "string"
															},
															"lastUsedAt": {
																"type": "number"
															},
															"inUse": {
																"type": "boolean"
															}
														},
														"required": [
															"name",
															"sendsAs",
															"lastUsedAt",
															"inUse"
														],
														"additionalProperties": false
													}
												},
												"appKeysElsewhere": {
													"default": 0,
													"type": "number"
												},
												"seatFreed": {
													"default": null,
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"cents": {
																	"type": "number"
																},
																"interval": {
																	"type": "string",
																	"enum": [
																		"month",
																		"year"
																	]
																},
																"currency": {
																	"type": "string"
																}
															},
															"required": [
																"cents",
																"interval",
																"currency"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													]
												}
											},
											"required": [
												"email",
												"role",
												"sessions",
												"onlyTheirs",
												"shared",
												"scheduled",
												"drafts",
												"appKeys",
												"appKeysElsewhere",
												"seatFreed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/members.remove": {
			"post": {
				"operationId": "members.remove",
				"summary": "Remove someone from an org for good. To keep their mail, use deactivate",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Members"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/members#members.remove"
				},
				"x-mailset-cli": "mailset members remove <email> [--reassign-to <reassign-to>] [--org <id>]",
				"x-mailset-cli-example": "mailset members remove ben@example.com --reassign-to ana@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"email": {
												"description": "The member’s address.",
												"type": "string"
											},
											"reassignTo": {
												"description": "Who takes the mailboxes only they had. Leave out to keep them with nobody.",
												"type": "string"
											}
										},
										"required": [
											"email"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"reassignTo": "ana@example.com",
									"email": "ben@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean",
													"const": true
												},
												"sessionsEnded": {
													"type": "number"
												},
												"reassigned": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Now held by the person named."
												},
												"unattended": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Nobody can open these now. They keep receiving mail until an admin decides."
												}
											},
											"required": [
												"removed",
												"sessionsEnded",
												"reassigned",
												"unattended"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/members.deactivate": {
			"post": {
				"operationId": "members.deactivate",
				"summary": "Stop someone signing in: their mail and mailboxes stay",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Members"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/members#members.deactivate"
				},
				"x-mailset-cli": "mailset members deactivate <email> [--refuse-mail] [--org <id>]",
				"x-mailset-cli-example": "mailset members deactivate ben@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"email": {
												"description": "The member’s address.",
												"type": "string"
											},
											"refuseMail": {
												"default": false,
												"description": "Refuse new mail to the mailboxes nobody else can open. Off: it keeps arriving.",
												"type": "boolean"
											}
										},
										"required": [
											"email"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"email": "ben@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"deactivated": {
													"type": "boolean",
													"const": true
												},
												"sessionsEnded": {
													"type": "number"
												},
												"unattended": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Nobody can open these now. Mail keeps arriving unless they’re in `refusing`."
												},
												"refusing": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "New mail to these is refused, until someone reactivates or reassigns them."
												}
											},
											"required": [
												"deactivated",
												"sessionsEnded",
												"unattended",
												"refusing"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/members.reactivate": {
			"post": {
				"operationId": "members.reactivate",
				"summary": "Bring someone deactivated back, with the same access",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Members"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/members#members.reactivate"
				},
				"x-mailset-cli": "mailset members reactivate <email> [--org <id>]",
				"x-mailset-cli-example": "mailset members reactivate ben@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"email": {
												"description": "The member’s address.",
												"type": "string"
											}
										},
										"required": [
											"email"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"email": "ben@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"reactivated": {
													"type": "boolean",
													"const": true
												}
											},
											"required": [
												"reactivated"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/invites.list": {
			"post": {
				"operationId": "invites.list",
				"summary": "List invites nobody has accepted yet",
				"description": "An admin or owner of the org.",
				"tags": [
					"Invites"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/invites#invites.list"
				},
				"x-mailset-cli": "mailset invites list [--org <id>]",
				"x-mailset-cli-example": "mailset invites list",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string"
													},
													"email": {
														"type": "string"
													},
													"role": {
														"type": "string",
														"enum": [
															"owner",
															"admin",
															"member"
														]
													},
													"createdAt": {
														"type": "number"
													},
													"expiresAt": {
														"type": "number"
													}
												},
												"required": [
													"id",
													"email",
													"role",
													"createdAt",
													"expiresAt"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/invites.revoke": {
			"post": {
				"operationId": "invites.revoke",
				"summary": "Cancel an invite",
				"description": "An admin or owner of the org.",
				"tags": [
					"Invites"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/invites#invites.revoke"
				},
				"x-mailset-cli": "mailset invites revoke <id> [--org <id>]",
				"x-mailset-cli-example": "mailset invites revoke i_c2e7a9f14b6d3058a1c4e7b9",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The invite’s id, from `invites list`."
											}
										},
										"required": [
											"id"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "i_c2e7a9f14b6d3058a1c4e7b9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"revoked": {
													"type": "boolean",
													"const": true
												}
											},
											"required": [
												"revoked"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/invites.resend": {
			"post": {
				"operationId": "invites.resend",
				"summary": "Email an invite again with a new link, and cancel the old one",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"Invites"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/invites#invites.resend"
				},
				"x-mailset-cli": "mailset invites resend <id> [--note <note>] [--no-email]",
				"x-mailset-cli-example": "mailset invites resend i_c2e7a9f14b6d3058a1c4e7b9 --note \"Here is a new link.\"",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"maxLength": 64,
												"description": "The invite’s id, from `invites list`."
											},
											"note": {
												"description": "One line of your own words for the invite email, up to 500 characters.",
												"type": "string",
												"maxLength": 500,
												"pattern": "^[^\\p{Cc}\\u202a-\\u202e\\u2066-\\u2069]*$"
											},
											"noEmail": {
												"default": false,
												"description": "Only make the new link: nothing is emailed.",
												"type": "boolean"
											}
										},
										"required": [
											"id"
										]
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"note": "Here is a new link.",
									"id": "i_c2e7a9f14b6d3058a1c4e7b9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string",
													"description": "The invite’s id: what `invites resend`, `extend` and `revoke` take."
												},
												"email": {
													"type": "string",
													"description": "The address invited."
												},
												"url": {
													"type": "string",
													"description": "The invite’s link, shown this once."
												},
												"expiresAt": {
													"type": "number",
													"description": "When the link stops working, in ms since the epoch."
												},
												"emailed": {
													"type": "boolean",
													"description": "The link went to the address by email too."
												}
											},
											"required": [
												"id",
												"email",
												"url",
												"expiresAt",
												"emailed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/invites.extend": {
			"post": {
				"operationId": "invites.extend",
				"summary": "Keep an invite’s link working for longer, the same link",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"Invites"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/invites#invites.extend"
				},
				"x-mailset-cli": "mailset invites extend <id> --days <n>",
				"x-mailset-cli-example": "mailset invites extend i_c2e7a9f14b6d3058a1c4e7b9 --days 30",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"maxLength": 64,
												"description": "The invite’s id, from `invites list`."
											},
											"days": {
												"type": "integer",
												"minimum": 1,
												"maximum": 90,
												"description": "How many days the link works from now, 1 to 90."
											}
										},
										"required": [
											"id",
											"days"
										]
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"days": 30,
									"id": "i_c2e7a9f14b6d3058a1c4e7b9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string",
													"description": "The invite’s id."
												},
												"email": {
													"type": "string",
													"description": "The address invited."
												},
												"expiresAt": {
													"type": "number",
													"description": "When the link stops working now, in ms since the epoch."
												}
											},
											"required": [
												"id",
												"email",
												"expiresAt"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/policies.get": {
			"post": {
				"operationId": "policies.get",
				"summary": "Show the org’s policies",
				"description": "Anyone in the org.",
				"tags": [
					"Policies"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/policies#policies.get"
				},
				"x-mailset-cli": "mailset policies get [--org <id>]",
				"x-mailset-cli-example": "mailset policies get",
				"x-mailset-role": "member",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"forwarding": {
													"default": "passkey",
													"type": "string",
													"enum": [
														"passkey",
														"never"
													],
													"description": "Forwarding rules: allowed with a `passkey` check, or `never`."
												},
												"sharedAi": {
													"default": true,
													"type": "boolean",
													"description": "Whether AI runs on shared mailboxes."
												},
												"sessionDays": {
													"default": 30,
													"type": "number",
													"description": "How long a new sign-in lasts, in days: 30, 7 or 0.5 (12 hours)."
												}
											},
											"required": [
												"forwarding",
												"sharedAi",
												"sessionDays"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/policies.set": {
			"post": {
				"operationId": "policies.set",
				"summary": "Change the org’s policies",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Policies"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/policies#policies.set"
				},
				"x-mailset-cli": "mailset policies set [--forwarding passkey|never] [--shared-ai] [--session-days <n>] [--org <id>]",
				"x-mailset-cli-example": "mailset policies set --forwarding never --session-days 7",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"forwarding": {
												"type": "string",
												"enum": [
													"passkey",
													"never"
												],
												"description": "Forwarding rules: allowed with a `passkey` check, or `never`."
											},
											"sharedAi": {
												"type": "boolean",
												"description": "Whether AI runs on shared mailboxes."
											},
											"sessionDays": {
												"type": "number",
												"description": "How long a new sign-in lasts, in days: 30, 7 or 0.5 (12 hours)."
											}
										},
										"additionalProperties": false
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"forwarding": "never",
									"sessionDays": 7
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"forwarding": {
													"default": "passkey",
													"type": "string",
													"enum": [
														"passkey",
														"never"
													],
													"description": "Forwarding rules: allowed with a `passkey` check, or `never`."
												},
												"sharedAi": {
													"default": true,
													"type": "boolean",
													"description": "Whether AI runs on shared mailboxes."
												},
												"sessionDays": {
													"default": 30,
													"type": "number",
													"description": "How long a new sign-in lasts, in days: 30, 7 or 0.5 (12 hours)."
												}
											},
											"required": [
												"forwarding",
												"sharedAi",
												"sessionDays"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/delivery.search": {
			"post": {
				"operationId": "delivery.search",
				"summary": "Find what happened to a message, by id, sender, recipient, status, since, until",
				"description": "An app key that may send as the mailbox, or as the addresses it names on the domain. Or a person: an admin or owner of the org.",
				"tags": [
					"Delivery"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/delivery#delivery.search"
				},
				"x-mailset-cli": "mailset delivery search [--id <id>] [--message-id <message-id>] [--sender <sender>] [--recipient <recipient>] [--status sent|delivered|delayed|bounced|complained|rejected|expired|skipped|received|junk|blocked] [--since <since>] [--until <until>] [--limit <n>] [--cursor <cursor>] [--org <id>]",
				"x-mailset-cli-example": "mailset delivery search --recipient ana@example.com --status bounced",
				"x-mailset-grant": "send",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"description": "Only the lines of one send: the `id` its send answered (a line’s `message`).",
												"type": "string",
												"minLength": 1,
												"maxLength": 64
											},
											"messageId": {
												"description": "Only the lines of the message with this Message-ID header, with or without its angle brackets.",
												"type": "string",
												"minLength": 1,
												"maxLength": 998
											},
											"sender": {
												"description": "A sender’s whole address, or part of one.",
												"type": "string",
												"maxLength": 254
											},
											"recipient": {
												"description": "A recipient’s whole address, or part of one.",
												"type": "string",
												"maxLength": 254
											},
											"status": {
												"description": "Only lines with this status.",
												"type": "string",
												"enum": [
													"sent",
													"delivered",
													"delayed",
													"bounced",
													"complained",
													"rejected",
													"expired",
													"skipped",
													"received",
													"junk",
													"blocked"
												]
											},
											"since": {
												"description": "From this moment on: milliseconds, an ISO time, or a day (YYYY-MM-DD, from its start in UTC).",
												"anyOf": [
													{
														"type": "integer",
														"minimum": 0,
														"maximum": 9007199254740991
													},
													{
														"type": "string",
														"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
													},
													{
														"type": "string",
														"format": "date-time",
														"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
													}
												]
											},
											"until": {
												"description": "Up to this moment: milliseconds, an ISO time, or a day (YYYY-MM-DD, to its end in UTC).",
												"anyOf": [
													{
														"type": "integer",
														"minimum": 0,
														"maximum": 9007199254740991
													},
													{
														"type": "string",
														"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
													},
													{
														"type": "string",
														"format": "date-time",
														"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
													}
												]
											},
											"limit": {
												"default": 50,
												"description": "How many lines a page holds, 1 to 200.",
												"type": "integer",
												"minimum": 1,
												"maximum": 200
											},
											"cursor": {
												"description": "The `next` of the page before, for the page after it.",
												"type": "string",
												"maxLength": 64
											}
										}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"recipient": "ana@example.com",
									"status": "bounced"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"events": {
													"type": "array",
													"items": {
														"$ref": "#/components/schemas/DeliveryLine"
													},
													"description": "The lines found, newest first."
												},
												"next": {
													"description": "Pass back as `cursor` for the next page. Null at the end.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"events",
												"next"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/devices.list": {
			"post": {
				"operationId": "devices.list",
				"summary": "List your signed-in devices",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Devices"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/devices#devices.list"
				},
				"x-mailset-cli": "mailset devices list",
				"x-mailset-cli-example": "mailset devices list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string"
													},
													"name": {
														"type": "string"
													},
													"kind": {
														"type": "string",
														"enum": [
															"browser",
															"cli",
															"token",
															"app",
															"phone"
														]
													},
													"createdAt": {
														"type": "number"
													},
													"lastSeenAt": {
														"type": "number"
													},
													"current": {
														"type": "boolean"
													},
													"ip": {
														"description": "Where the device last connected from. Null until it has, or when nothing says.",
														"type": [
															"string",
															"null"
														]
													},
													"location": {
														"type": [
															"string",
															"null"
														]
													}
												},
												"required": [
													"id",
													"name",
													"kind",
													"createdAt",
													"lastSeenAt",
													"current",
													"ip",
													"location"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/members.restore": {
			"post": {
				"operationId": "members.restore",
				"summary": "Make a one-time link for a member who lost every passkey",
				"description": "An owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Members"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/members#members.restore"
				},
				"x-mailset-cli": "mailset members restore <email> [--org <id>]",
				"x-mailset-cli-example": "mailset members restore ben@example.com",
				"x-mailset-role": "owner",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"email": {
												"description": "The member’s address.",
												"type": "string"
											}
										},
										"required": [
											"email"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"email": "ben@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"url": {
													"type": "string"
												},
												"expiresAt": {
													"type": "number"
												}
											},
											"required": [
												"url",
												"expiresAt"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/members.delete": {
			"post": {
				"operationId": "members.delete",
				"summary": "Delete someone’s account: deactivate them unless you mean this",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Members"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/members#members.delete"
				},
				"x-mailset-cli": "mailset members delete <email> [--hand-to <hand-to>] [--org <id>]",
				"x-mailset-cli-example": "mailset members delete ben@example.com --hand-to ana@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"email": {
												"description": "The member’s address.",
												"type": "string"
											},
											"handTo": {
												"description": "The owner who takes mailboxes only they could open. Leave out for you, or the org’s oldest owner.",
												"type": "string"
											}
										},
										"required": [
											"email"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"handTo": "ana@example.com",
									"email": "ben@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"scheduledFor": {
													"type": "number"
												},
												"handedTo": {
													"description": "Who got the mailboxes only they could open.",
													"type": [
														"string",
														"null"
													]
												},
												"mailboxes": {
													"type": "array",
													"items": {
														"type": "string"
													}
												}
											},
											"required": [
												"scheduledFor",
												"handedTo",
												"mailboxes"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/paperkey.status": {
			"post": {
				"operationId": "paperkey.status",
				"summary": "Show whether the org’s paper key needs replacing",
				"description": "An owner of the org.",
				"tags": [
					"Paper key"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/paperkey#paperkey.status"
				},
				"x-mailset-cli": "mailset paperkey status [--org <id>]",
				"x-mailset-cli-example": "mailset paperkey status",
				"x-mailset-role": "owner",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"fingerprint": {
													"description": "Enough to compare with the paper. Null: the org has no paper key.",
													"type": [
														"string",
														"null"
													]
												},
												"neededSince": {
													"description": "When an owner left. Null: nothing asks for a new key.",
													"type": [
														"number",
														"null"
													]
												},
												"rotating": {
													"type": "boolean"
												},
												"done": {
													"type": "number"
												},
												"total": {
													"type": "number"
												}
											},
											"required": [
												"fingerprint",
												"neededSince",
												"rotating",
												"done",
												"total"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/paperkey.rotate": {
			"post": {
				"operationId": "paperkey.rotate",
				"summary": "Replace the org’s paper key. The CLI makes the new one and shows it once",
				"description": "An owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Paper key"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/paperkey#paperkey.rotate"
				},
				"x-mailset-cli": "mailset paperkey rotate --recipient <recipient> [--org <id>]",
				"x-mailset-cli-example": "mailset paperkey rotate --out acme-paper-key.txt",
				"x-mailset-role": "owner",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"recipient": {
												"type": "string",
												"minLength": 1,
												"maxLength": 200,
												"description": "The new paper key’s public half. The CLI makes the key and sends only this."
											}
										},
										"required": [
											"recipient"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"recipient": "<recipient>"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"fingerprint": {
													"description": "Enough to compare with the paper. Null: the org has no paper key.",
													"type": [
														"string",
														"null"
													]
												},
												"neededSince": {
													"description": "When an owner left. Null: nothing asks for a new key.",
													"type": [
														"number",
														"null"
													]
												},
												"rotating": {
													"type": "boolean"
												},
												"done": {
													"type": "number"
												},
												"total": {
													"type": "number"
												}
											},
											"required": [
												"fingerprint",
												"neededSince",
												"rotating",
												"done",
												"total"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/devices.revoke": {
			"post": {
				"operationId": "devices.revoke",
				"summary": "Sign a device out for good",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Devices"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/devices#devices.revoke"
				},
				"x-mailset-cli": "mailset devices revoke --id <id>",
				"x-mailset-cli-example": "mailset devices revoke --id d_4b8e2a6c9f1d3057b3e8a2c6",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The device’s id, from `devices list`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "d_4b8e2a6c9f1d3057b3e8a2c6"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"revoked": {
													"type": "boolean"
												}
											},
											"required": [
												"revoked"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/devices.revokeOthers": {
			"post": {
				"operationId": "devices.revokeOthers",
				"summary": "Sign out every device but this one. App keys and API tokens stay",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"Devices"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/devices#devices.revokeOthers"
				},
				"x-mailset-cli": "mailset devices revokeOthers",
				"x-mailset-cli-example": "mailset devices revokeOthers",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"revoked": {
													"type": "number"
												}
											},
											"required": [
												"revoked"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/passkeys.list": {
			"post": {
				"operationId": "passkeys.list",
				"summary": "List your passkeys",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Passkeys"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/passkeys#passkeys.list"
				},
				"x-mailset-cli": "mailset passkeys list",
				"x-mailset-cli-example": "mailset passkeys list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string"
													},
													"name": {
														"type": "string"
													},
													"synced": {
														"type": "boolean",
														"description": "Synced across the person’s devices by their password manager or iCloud."
													},
													"createdAt": {
														"type": "number"
													},
													"lastUsedAt": {
														"type": [
															"number",
															"null"
														]
													}
												},
												"required": [
													"id",
													"name",
													"synced",
													"createdAt",
													"lastUsedAt"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/passkeys.remove": {
			"post": {
				"operationId": "passkeys.remove",
				"summary": "Remove a passkey",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"Passkeys"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/passkeys#passkeys.remove"
				},
				"x-mailset-cli": "mailset passkeys remove --id <id>",
				"x-mailset-cli-example": "mailset passkeys remove --id Kq3vX9mB2nR7tLw0pYc5uA",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The passkey’s id, from `passkeys list`."
											}
										},
										"required": [
											"id"
										]
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "Kq3vX9mB2nR7tLw0pYc5uA"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean"
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/tokens.list": {
			"post": {
				"operationId": "tokens.list",
				"summary": "List your API tokens",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"API tokens"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/tokens#tokens.list"
				},
				"x-mailset-cli": "mailset tokens list",
				"x-mailset-cli-example": "mailset tokens list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Token"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/tokens.create": {
			"post": {
				"operationId": "tokens.create",
				"summary": "Create an API token. It is shown once",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"API tokens"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/tokens#tokens.create"
				},
				"x-mailset-cli": "mailset tokens create <name>",
				"x-mailset-cli-example": "mailset tokens create \"Deploy script\"",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"type": "string",
												"minLength": 1,
												"maxLength": 64,
												"description": "A name to tell it by, up to 64 characters."
											}
										},
										"required": [
											"name"
										]
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "Deploy script"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string",
													"description": "The token’s id: what `tokens revoke` takes."
												},
												"name": {
													"type": "string",
													"description": "The name it was given."
												},
												"token": {
													"type": "string",
													"description": "The token itself, shown this once. It starts with `mst_`."
												},
												"expiresAt": {
													"type": "number",
													"description": "When it stops working, in ms since the epoch: a year from now."
												}
											},
											"required": [
												"id",
												"name",
												"token",
												"expiresAt"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/tokens.revoke": {
			"post": {
				"operationId": "tokens.revoke",
				"summary": "Revoke an API token",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"API tokens"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/tokens#tokens.revoke"
				},
				"x-mailset-cli": "mailset tokens revoke <id>",
				"x-mailset-cli-example": "mailset tokens revoke d_4b8e2a6c9f1d3057b3e8a2c6",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The token’s id, from `tokens list`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "d_4b8e2a6c9f1d3057b3e8a2c6"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"revoked": {
													"type": "boolean",
													"description": "True when the token was there to revoke."
												}
											},
											"required": [
												"revoked"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/keys.list": {
			"post": {
				"operationId": "keys.list",
				"summary": "List your app keys: what each sends as, and when it was last used",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"App keys"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/keys#keys.list"
				},
				"x-mailset-cli": "mailset keys list",
				"x-mailset-cli-example": "mailset keys list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/KeyStatus"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/keys.revoke": {
			"post": {
				"operationId": "keys.revoke",
				"summary": "Revoke an app key. Its server can’t send with it any more",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"App keys"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/keys#keys.revoke"
				},
				"x-mailset-cli": "mailset keys revoke <id>",
				"x-mailset-cli-example": "mailset keys revoke d_4b8e2a6c9f1d3057b3e8a2c6",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The app’s id, from `keys list`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "d_4b8e2a6c9f1d3057b3e8a2c6"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"revoked": {
													"type": "boolean",
													"description": "True when the app was there to disconnect."
												}
											},
											"required": [
												"revoked"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/keys.renew": {
			"post": {
				"operationId": "keys.renew",
				"summary": "Keep an app key working for 90 more days, with the same key",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"App keys"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/keys#keys.renew"
				},
				"x-mailset-cli": "mailset keys renew <id>",
				"x-mailset-cli-example": "mailset keys renew d_4b8e2a6c9f1d3057b3e8a2c6",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The app’s id, from `keys list`."
											}
										},
										"required": [
											"id"
										]
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "d_4b8e2a6c9f1d3057b3e8a2c6"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"expiresAt": {
													"type": "number",
													"description": "When its key stops working now, in ms since the epoch."
												}
											},
											"required": [
												"expiresAt"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/keys.resume": {
			"post": {
				"operationId": "keys.resume",
				"summary": "Let an app key its brake paused send again, once you know why it was",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"App keys"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/keys#keys.resume"
				},
				"x-mailset-cli": "mailset keys resume <id>",
				"x-mailset-cli-example": "mailset keys resume d_4b8e2a6c9f1d3057b3e8a2c6",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The app’s id, from `keys list`."
											}
										},
										"required": [
											"id"
										]
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "d_4b8e2a6c9f1d3057b3e8a2c6"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"resumed": {
													"type": "boolean",
													"description": "True when it was paused and may send again."
												}
											},
											"required": [
												"resumed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/keys.update": {
			"post": {
				"operationId": "keys.update",
				"summary": "Change the From addresses a domain key sends as",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"App keys"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/keys#keys.update"
				},
				"x-mailset-cli": "mailset keys update <id> [--from <a,b,…>] [--any-address true]",
				"x-mailset-cli-example": "mailset keys update d_4b8e2a6c9f1d3057b3e8a2c6 --from receipts@example.com --from noreply@example.com",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The key’s id, from `keys list`."
											},
											"from": {
												"description": "The From addresses it may send as from now on, all on its domain. 1 to 25.",
												"minItems": 1,
												"maxItems": 25,
												"type": "array",
												"items": {
													"type": "string"
												}
											},
											"anyAddress": {
												"description": "Any address on its domain instead: only for a domain where nobody has a mailbox.",
												"type": "boolean",
												"const": true
											}
										},
										"required": [
											"id"
										]
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"from": [
										"receipts@example.com",
										"noreply@example.com"
									],
									"id": "d_4b8e2a6c9f1d3057b3e8a2c6"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/KeyStatus"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/grants.current": {
			"post": {
				"operationId": "grants.current",
				"summary": "Show what this app key may do: its mailbox or sending domain, and whether it can send",
				"description": "Any app key. Or a person: any signed-in person, with an API token.",
				"tags": [
					"Key status"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/grants#grants.current"
				},
				"x-mailset-cli": "mailset grants current",
				"x-mailset-cli-example": "mailset grants current",
				"x-mailset-grant": "any",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/KeyStatus"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/audit.list": {
			"post": {
				"operationId": "audit.list",
				"summary": "Show what happened in an org",
				"description": "An admin or owner of the org.",
				"tags": [
					"Audit log"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/audit#audit.list"
				},
				"x-mailset-cli": "mailset audit list [--limit <n>] [--actor <actor>] [--kind <kind>] [--since <since>] [--until <until>] [--before <before>] [--org <id>]",
				"x-mailset-cli-example": "mailset audit list --actor ben@example.com --since 2026-11-01",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"limit": {
												"default": 50,
												"description": "How many rows to return, 1 to 200.",
												"type": "integer",
												"minimum": 1,
												"maximum": 200
											},
											"actor": {
												"description": "Who did it: a whole address, or part of one.",
												"type": "string",
												"maxLength": 254
											},
											"kind": {
												"description": "Only events of this kind, such as `member_invited`.",
												"type": "string",
												"maxLength": 64
											},
											"since": {
												"description": "From this moment on: milliseconds, an ISO time, or a day (YYYY-MM-DD, from its start in UTC).",
												"anyOf": [
													{
														"type": "integer",
														"minimum": 0,
														"maximum": 9007199254740991
													},
													{
														"type": "string",
														"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
													},
													{
														"type": "string",
														"format": "date-time",
														"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
													}
												]
											},
											"until": {
												"description": "Up to this moment: milliseconds, an ISO time, or a day (YYYY-MM-DD, to its end in UTC).",
												"anyOf": [
													{
														"type": "integer",
														"minimum": 0,
														"maximum": 9007199254740991
													},
													{
														"type": "string",
														"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
													},
													{
														"type": "string",
														"format": "date-time",
														"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
													}
												]
											},
											"before": {
												"description": "The id of the last row you have, for the rows before it.",
												"type": "string",
												"pattern": "^\\d{1,20}$"
											}
										}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"actor": "ben@example.com",
									"since": "2026-11-01"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string"
													},
													"kind": {
														"type": "string"
													},
													"target": {
														"type": "string"
													},
													"actor": {
														"type": [
															"string",
															"null"
														]
													},
													"at": {
														"type": "number"
													},
													"ip": {
														"description": "Where it was done from, for the events that record that.",
														"type": [
															"string",
															"null"
														]
													},
													"location": {
														"type": [
															"string",
															"null"
														]
													}
												},
												"required": [
													"id",
													"kind",
													"target",
													"actor",
													"at",
													"ip",
													"location"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/activity.list": {
			"post": {
				"operationId": "activity.list",
				"summary": "Show what your account has done: sign-ins, devices, passkeys",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Activity"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/activity#activity.list"
				},
				"x-mailset-cli": "mailset activity list [--limit <n>] [--before <before>]",
				"x-mailset-cli-example": "mailset activity list --limit 20",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"limit": {
												"default": 50,
												"description": "How many rows to return, 1 to 200.",
												"type": "integer",
												"minimum": 1,
												"maximum": 200
											},
											"before": {
												"description": "The id of the last row you have, for the rows before it.",
												"type": "string",
												"minLength": 1
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"limit": 20
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string"
													},
													"kind": {
														"type": "string"
													},
													"target": {
														"type": "string"
													},
													"actor": {
														"type": [
															"string",
															"null"
														]
													},
													"at": {
														"type": "number"
													},
													"ip": {
														"description": "Where it was done from, for the events that record that.",
														"type": [
															"string",
															"null"
														]
													},
													"location": {
														"type": [
															"string",
															"null"
														]
													}
												},
												"required": [
													"id",
													"kind",
													"target",
													"actor",
													"at",
													"ip",
													"location"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/storage.usage": {
			"post": {
				"operationId": "storage.usage",
				"summary": "Show how much mail each mailbox holds",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Storage"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/storage#storage.usage"
				},
				"x-mailset-cli": "mailset storage usage",
				"x-mailset-cli-example": "mailset storage usage",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"mailboxes": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"address": {
																"type": "string"
															},
															"messages": {
																"type": "number"
															},
															"bytes": {
																"type": "number"
															}
														},
														"required": [
															"address",
															"messages",
															"bytes"
														],
														"additionalProperties": false
													}
												},
												"contactPhotos": {
													"type": "number",
													"description": "Photos saved on contacts, which belong to the person and not a mailbox."
												},
												"bytes": {
													"type": "number"
												},
												"messages": {
													"type": "number"
												}
											},
											"required": [
												"mailboxes",
												"contactPhotos",
												"bytes",
												"messages"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/exports.start": {
			"post": {
				"operationId": "exports.start",
				"summary": "Start an export of your whole account",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Exports"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/exports#exports.start"
				},
				"x-mailset-cli": "mailset exports start",
				"x-mailset-cli-example": "mailset exports start",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string"
												},
												"state": {
													"type": "string",
													"enum": [
														"running",
														"ready",
														"failed",
														"cancelled"
													]
												},
												"done": {
													"type": "number",
													"description": "Messages written, and how many there are to write."
												},
												"total": {
													"type": "number"
												},
												"skipped": {
													"type": "number"
												},
												"bytes": {
													"type": "number"
												},
												"reason": {
													"type": [
														"string",
														"null"
													]
												},
												"createdAt": {
													"type": "number"
												},
												"finishedAt": {
													"type": [
														"number",
														"null"
													]
												},
												"expiresAt": {
													"description": "When the archive is deleted.",
													"type": [
														"number",
														"null"
													]
												}
											},
											"required": [
												"id",
												"state",
												"done",
												"total",
												"skipped",
												"bytes",
												"reason",
												"createdAt",
												"finishedAt",
												"expiresAt"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/exports.list": {
			"post": {
				"operationId": "exports.list",
				"summary": "Show your data exports",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Exports"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/exports#exports.list"
				},
				"x-mailset-cli": "mailset exports list",
				"x-mailset-cli-example": "mailset exports list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string"
													},
													"state": {
														"type": "string",
														"enum": [
															"running",
															"ready",
															"failed",
															"cancelled"
														]
													},
													"done": {
														"type": "number",
														"description": "Messages written, and how many there are to write."
													},
													"total": {
														"type": "number"
													},
													"skipped": {
														"type": "number"
													},
													"bytes": {
														"type": "number"
													},
													"reason": {
														"type": [
															"string",
															"null"
														]
													},
													"createdAt": {
														"type": "number"
													},
													"finishedAt": {
														"type": [
															"number",
															"null"
														]
													},
													"expiresAt": {
														"description": "When the archive is deleted.",
														"type": [
															"number",
															"null"
														]
													}
												},
												"required": [
													"id",
													"state",
													"done",
													"total",
													"skipped",
													"bytes",
													"reason",
													"createdAt",
													"finishedAt",
													"expiresAt"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/exports.cancel": {
			"post": {
				"operationId": "exports.cancel",
				"summary": "Stop an export, or delete a finished one",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Exports"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/exports#exports.cancel"
				},
				"x-mailset-cli": "mailset exports cancel <id>",
				"x-mailset-cli-example": "mailset exports cancel exp_6f1a9c3e7b2d4058a4c1e9b7",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The export’s id, from `exports list`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "exp_6f1a9c3e7b2d4058a4c1e9b7"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"cancelled": {
													"type": "boolean",
													"const": true
												}
											},
											"required": [
												"cancelled"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/exports.link": {
			"post": {
				"operationId": "exports.link",
				"summary": "Get a short-lived download link for an export",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"Exports"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/exports#exports.link"
				},
				"x-mailset-cli": "mailset exports link <id>",
				"x-mailset-cli-example": "mailset exports link exp_6f1a9c3e7b2d4058a4c1e9b7",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The export’s id, from `exports list`."
											}
										},
										"required": [
											"id"
										]
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "exp_6f1a9c3e7b2d4058a4c1e9b7"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"url": {
													"type": "string"
												},
												"expiresAt": {
													"type": "number"
												}
											},
											"required": [
												"url",
												"expiresAt"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/account.deactivate": {
			"post": {
				"operationId": "account.deactivate",
				"summary": "Deactivate your account: you can’t sign in, your mail stays",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"Account"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/account#account.deactivate"
				},
				"x-mailset-cli": "mailset account deactivate",
				"x-mailset-cli-example": "mailset account deactivate",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"deactivated": {
													"type": "boolean",
													"const": true
												}
											},
											"required": [
												"deactivated"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/account.deletionPlan": {
			"post": {
				"operationId": "account.deletionPlan",
				"summary": "Show what deleting your account would remove, and what stays",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Account"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/account#account.deletionPlan"
				},
				"x-mailset-cli": "mailset account deletionPlan",
				"x-mailset-cli-example": "mailset account deletionPlan",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"scheduledFor": {
													"description": "Null: nothing is scheduled.",
													"type": [
														"number",
														"null"
													]
												},
												"graceDays": {
													"type": "number"
												},
												"blockers": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Each one has to be sorted out first."
												},
												"removes": {
													"type": "object",
													"properties": {
														"mailboxes": {
															"type": "array",
															"items": {
																"type": "object",
																"properties": {
																	"address": {
																		"type": "string"
																	},
																	"messages": {
																		"type": "number"
																	},
																	"bytes": {
																		"type": "number"
																	}
																},
																"required": [
																	"address",
																	"messages",
																	"bytes"
																],
																"additionalProperties": false
															}
														},
														"orgs": {
															"type": "array",
															"items": {
																"type": "string"
															}
														}
													},
													"required": [
														"mailboxes",
														"orgs"
													],
													"additionalProperties": false
												},
												"handsOver": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"address": {
																"type": "string"
															},
															"to": {
																"type": "string"
															}
														},
														"required": [
															"address",
															"to"
														],
														"additionalProperties": false
													},
													"description": "Mailboxes only you can open, in orgs that carry on: they go to an owner first."
												},
												"stays": {
													"type": "object",
													"properties": {
														"sharedMailboxes": {
															"type": "array",
															"items": {
																"type": "string"
															},
															"description": "Shared with someone else, so they carry on without you."
														},
														"orgs": {
															"type": "array",
															"items": {
																"type": "string"
															}
														}
													},
													"required": [
														"sharedMailboxes",
														"orgs"
													],
													"additionalProperties": false
												}
											},
											"required": [
												"scheduledFor",
												"graceDays",
												"blockers",
												"removes",
												"handsOver",
												"stays"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/account.delete": {
			"post": {
				"operationId": "account.delete",
				"summary": "Delete your account, after a grace period you can cancel in",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"Account"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/account#account.delete"
				},
				"x-mailset-cli": "mailset account delete",
				"x-mailset-cli-example": "mailset account delete",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"scheduledFor": {
													"description": "Null: nothing is scheduled.",
													"type": [
														"number",
														"null"
													]
												},
												"graceDays": {
													"type": "number"
												},
												"blockers": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Each one has to be sorted out first."
												},
												"removes": {
													"type": "object",
													"properties": {
														"mailboxes": {
															"type": "array",
															"items": {
																"type": "object",
																"properties": {
																	"address": {
																		"type": "string"
																	},
																	"messages": {
																		"type": "number"
																	},
																	"bytes": {
																		"type": "number"
																	}
																},
																"required": [
																	"address",
																	"messages",
																	"bytes"
																],
																"additionalProperties": false
															}
														},
														"orgs": {
															"type": "array",
															"items": {
																"type": "string"
															}
														}
													},
													"required": [
														"mailboxes",
														"orgs"
													],
													"additionalProperties": false
												},
												"handsOver": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"address": {
																"type": "string"
															},
															"to": {
																"type": "string"
															}
														},
														"required": [
															"address",
															"to"
														],
														"additionalProperties": false
													},
													"description": "Mailboxes only you can open, in orgs that carry on: they go to an owner first."
												},
												"stays": {
													"type": "object",
													"properties": {
														"sharedMailboxes": {
															"type": "array",
															"items": {
																"type": "string"
															},
															"description": "Shared with someone else, so they carry on without you."
														},
														"orgs": {
															"type": "array",
															"items": {
																"type": "string"
															}
														}
													},
													"required": [
														"sharedMailboxes",
														"orgs"
													],
													"additionalProperties": false
												}
											},
											"required": [
												"scheduledFor",
												"graceDays",
												"blockers",
												"removes",
												"handsOver",
												"stays"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/account.cancelDeletion": {
			"post": {
				"operationId": "account.cancelDeletion",
				"summary": "Stop your account from being deleted",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Account"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/account#account.cancelDeletion"
				},
				"x-mailset-cli": "mailset account cancelDeletion",
				"x-mailset-cli-example": "mailset account cancelDeletion",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"scheduledFor": {
													"description": "Null: nothing is scheduled.",
													"type": [
														"number",
														"null"
													]
												},
												"graceDays": {
													"type": "number"
												},
												"blockers": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Each one has to be sorted out first."
												},
												"removes": {
													"type": "object",
													"properties": {
														"mailboxes": {
															"type": "array",
															"items": {
																"type": "object",
																"properties": {
																	"address": {
																		"type": "string"
																	},
																	"messages": {
																		"type": "number"
																	},
																	"bytes": {
																		"type": "number"
																	}
																},
																"required": [
																	"address",
																	"messages",
																	"bytes"
																],
																"additionalProperties": false
															}
														},
														"orgs": {
															"type": "array",
															"items": {
																"type": "string"
															}
														}
													},
													"required": [
														"mailboxes",
														"orgs"
													],
													"additionalProperties": false
												},
												"handsOver": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"address": {
																"type": "string"
															},
															"to": {
																"type": "string"
															}
														},
														"required": [
															"address",
															"to"
														],
														"additionalProperties": false
													},
													"description": "Mailboxes only you can open, in orgs that carry on: they go to an owner first."
												},
												"stays": {
													"type": "object",
													"properties": {
														"sharedMailboxes": {
															"type": "array",
															"items": {
																"type": "string"
															},
															"description": "Shared with someone else, so they carry on without you."
														},
														"orgs": {
															"type": "array",
															"items": {
																"type": "string"
															}
														}
													},
													"required": [
														"sharedMailboxes",
														"orgs"
													],
													"additionalProperties": false
												}
											},
											"required": [
												"scheduledFor",
												"graceDays",
												"blockers",
												"removes",
												"handsOver",
												"stays"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.list": {
			"post": {
				"operationId": "domains.list",
				"summary": "List an org’s domains",
				"description": "Anyone in the org.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.list"
				},
				"x-mailset-cli": "mailset domains list [--org <id>]",
				"x-mailset-cli-example": "mailset domains list",
				"x-mailset-role": "member",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Domain"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.plan": {
			"post": {
				"operationId": "domains.plan",
				"summary": "Show what adding a domain would change",
				"description": "An admin or owner of the org.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.plan"
				},
				"x-mailset-cli": "mailset domains plan <name> [--sending] [--org <id>]",
				"x-mailset-cli-example": "mailset domains plan example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											},
											"sending": {
												"default": false,
												"description": "Sending only: just the records sending needs, with MX and SPF left as they are.",
												"type": "boolean"
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string"
												},
												"zone": {
													"type": "string"
												},
												"dnsHost": {
													"type": [
														"string",
														"null"
													]
												},
												"dnsPage": {
													"description": "The host’s own page for this zone’s records, when it has one.",
													"type": [
														"string",
														"null"
													]
												},
												"writable": {
													"type": "boolean",
													"description": "Mailset can write to this DNS host itself."
												},
												"changes": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"purpose": {
																"type": "string",
																"enum": [
																	"mx",
																	"dkim",
																	"dkim2",
																	"dkim3",
																	"bounce",
																	"bounce_spf",
																	"spf",
																	"dmarc",
																	"mta_sts",
																	"mta_sts_host",
																	"tls_rpt",
																	"bimi"
																]
															},
															"type": {
																"type": "string",
																"enum": [
																	"MX",
																	"TXT",
																	"CNAME"
																]
															},
															"host": {
																"type": "string"
															},
															"from": {
																"type": [
																	"string",
																	"null"
																]
															},
															"to": {
																"type": "string"
															}
														},
														"required": [
															"purpose",
															"type",
															"host",
															"from",
															"to"
														],
														"additionalProperties": false
													},
													"description": "The records that can be named now. The DKIM and bounce records come once the domain is added."
												},
												"warnings": {
													"type": "array",
													"items": {
														"type": "string"
													}
												},
												"leftovers": {
													"description": "Records old providers left, on `domains plan`.",
													"type": "object",
													"properties": {
														"visible": {
															"type": "boolean",
															"description": "Mailset read the zone. False: its DNS host has to be checked by hand."
														},
														"found": {
															"type": "array",
															"items": {
																"type": "object",
																"properties": {
																	"providerId": {
																		"type": "string",
																		"description": "What `--drop-leftovers` calls it: `sparkpost`."
																	},
																	"provider": {
																		"type": "string"
																	},
																	"kind": {
																		"type": "string",
																		"enum": [
																			"bounce",
																			"dkim",
																			"spf",
																			"mx",
																			"verification",
																			"tracking"
																		]
																	},
																	"type": {
																		"type": "string"
																	},
																	"host": {
																		"type": "string"
																	},
																	"value": {
																		"type": "string"
																	}
																},
																"required": [
																	"providerId",
																	"provider",
																	"kind",
																	"type",
																	"host",
																	"value"
																],
																"additionalProperties": false
															}
														},
														"providers": {
															"type": "array",
															"items": {
																"type": "object",
																"properties": {
																	"id": {
																		"type": "string"
																	},
																	"name": {
																		"type": "string"
																	},
																	"sent": {
																		"description": "Messages it sent as the domain. Null when Mailset couldn’t check.",
																		"type": [
																			"number",
																			"null"
																		]
																	},
																	"unchecked": {
																		"anyOf": [
																			{
																				"type": "string",
																				"enum": [
																					"no_reports",
																					"unrecognizable"
																				]
																			},
																			{
																				"type": "null"
																			}
																		],
																		"description": "Why it couldn’t: no reports naming senders, or nothing it left shows in one."
																	}
																},
																"required": [
																	"id",
																	"name",
																	"sent",
																	"unchecked"
																],
																"additionalProperties": false
															},
															"description": "Each provider in `found`, and whether it still sends as the domain."
														}
													},
													"required": [
														"visible",
														"found",
														"providers"
													],
													"additionalProperties": false
												}
											},
											"required": [
												"name",
												"zone",
												"dnsHost",
												"dnsPage",
												"writable",
												"changes",
												"warnings"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.add": {
			"post": {
				"operationId": "domains.add",
				"summary": "Add a domain and get its DNS records",
				"description": "An admin or owner of the org.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.add"
				},
				"x-mailset-cli": "mailset domains add <name> [--sending] [--org <id>]",
				"x-mailset-cli-example": "mailset domains add example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											},
											"sending": {
												"default": false,
												"description": "Sending only: its mail keeps arriving where it does today, so it needs only the DKIM, bounce and DMARC records, and a domain key sends as the addresses it names there.",
												"type": "boolean"
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Domain"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.parkPlan": {
			"post": {
				"operationId": "domains.parkPlan",
				"summary": "Show what parking a domain would change",
				"description": "An admin or owner of the org.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.parkPlan"
				},
				"x-mailset-cli": "mailset domains parkPlan <name> [--org <id>]",
				"x-mailset-cli-example": "mailset domains parkPlan acme.org",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "acme.org"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string"
												},
												"zone": {
													"type": "string"
												},
												"dnsHost": {
													"type": [
														"string",
														"null"
													]
												},
												"dnsPage": {
													"description": "The host’s own page for this zone’s records, when it has one.",
													"type": [
														"string",
														"null"
													]
												},
												"writable": {
													"type": "boolean",
													"description": "Mailset can write to this DNS host itself."
												},
												"changes": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"purpose": {
																"type": "string",
																"enum": [
																	"mx",
																	"dkim",
																	"dkim2",
																	"dkim3",
																	"bounce",
																	"bounce_spf",
																	"spf",
																	"dmarc",
																	"mta_sts",
																	"mta_sts_host",
																	"tls_rpt",
																	"bimi"
																]
															},
															"type": {
																"type": "string",
																"enum": [
																	"MX",
																	"TXT",
																	"CNAME"
																]
															},
															"host": {
																"type": "string"
															},
															"from": {
																"type": [
																	"string",
																	"null"
																]
															},
															"to": {
																"type": "string"
															}
														},
														"required": [
															"purpose",
															"type",
															"host",
															"from",
															"to"
														],
														"additionalProperties": false
													},
													"description": "The records that can be named now. The DKIM and bounce records come once the domain is added."
												},
												"warnings": {
													"type": "array",
													"items": {
														"type": "string"
													}
												},
												"leftovers": {
													"description": "Records old providers left, on `domains plan`.",
													"type": "object",
													"properties": {
														"visible": {
															"type": "boolean",
															"description": "Mailset read the zone. False: its DNS host has to be checked by hand."
														},
														"found": {
															"type": "array",
															"items": {
																"type": "object",
																"properties": {
																	"providerId": {
																		"type": "string",
																		"description": "What `--drop-leftovers` calls it: `sparkpost`."
																	},
																	"provider": {
																		"type": "string"
																	},
																	"kind": {
																		"type": "string",
																		"enum": [
																			"bounce",
																			"dkim",
																			"spf",
																			"mx",
																			"verification",
																			"tracking"
																		]
																	},
																	"type": {
																		"type": "string"
																	},
																	"host": {
																		"type": "string"
																	},
																	"value": {
																		"type": "string"
																	}
																},
																"required": [
																	"providerId",
																	"provider",
																	"kind",
																	"type",
																	"host",
																	"value"
																],
																"additionalProperties": false
															}
														},
														"providers": {
															"type": "array",
															"items": {
																"type": "object",
																"properties": {
																	"id": {
																		"type": "string"
																	},
																	"name": {
																		"type": "string"
																	},
																	"sent": {
																		"description": "Messages it sent as the domain. Null when Mailset couldn’t check.",
																		"type": [
																			"number",
																			"null"
																		]
																	},
																	"unchecked": {
																		"anyOf": [
																			{
																				"type": "string",
																				"enum": [
																					"no_reports",
																					"unrecognizable"
																				]
																			},
																			{
																				"type": "null"
																			}
																		],
																		"description": "Why it couldn’t: no reports naming senders, or nothing it left shows in one."
																	}
																},
																"required": [
																	"id",
																	"name",
																	"sent",
																	"unchecked"
																],
																"additionalProperties": false
															},
															"description": "Each provider in `found`, and whether it still sends as the domain."
														}
													},
													"required": [
														"visible",
														"found",
														"providers"
													],
													"additionalProperties": false
												}
											},
											"required": [
												"name",
												"zone",
												"dnsHost",
												"dnsPage",
												"writable",
												"changes",
												"warnings"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.park": {
			"post": {
				"operationId": "domains.park",
				"summary": "Park a domain: no mail to or from it, and nobody can spoof it",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.park"
				},
				"x-mailset-cli": "mailset domains park <name> [--org <id>]",
				"x-mailset-cli-example": "mailset domains park acme.org",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "acme.org"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Domain"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.check": {
			"post": {
				"operationId": "domains.check",
				"summary": "Check a domain’s DNS records now",
				"description": "Anyone in the org.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.check"
				},
				"x-mailset-cli": "mailset domains check <name> [--org <id>]",
				"x-mailset-cli-example": "mailset domains check example.com",
				"x-mailset-role": "member",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Domain"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.dmarc": {
			"post": {
				"operationId": "domains.dmarc",
				"summary": "Show a domain’s DMARC: what’s wrong with the record, its pass rate and the sources that fail",
				"description": "Anyone in the org. It can stop for a passkey approval.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.dmarc"
				},
				"x-mailset-cli": "mailset domains dmarc <name> [--policy none|quarantine|reject] [--anyway] [--org <id>]",
				"x-mailset-cli-example": "mailset domains dmarc example.com --policy quarantine",
				"x-mailset-role": "member",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											},
											"policy": {
												"description": "The DMARC policy to publish: `none`, `quarantine` or `reject`. Left out: only show where it stands.",
												"type": "string",
												"enum": [
													"none",
													"quarantine",
													"reject"
												]
											},
											"anyway": {
												"default": false,
												"description": "Raise it before reports show the mail passing.",
												"type": "boolean"
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"policy": "quarantine",
									"name": "example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string"
												},
												"record": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"purpose": {
																	"type": "string",
																	"enum": [
																		"mx",
																		"dkim",
																		"dkim2",
																		"dkim3",
																		"bounce",
																		"bounce_spf",
																		"spf",
																		"dmarc",
																		"mta_sts",
																		"mta_sts_host",
																		"tls_rpt",
																		"bimi"
																	],
																	"description": "What the record is for: `mx`, `spf`, `dkim`, `dmarc`, `bounce` and the like."
																},
																"type": {
																	"type": "string",
																	"enum": [
																		"MX",
																		"TXT",
																		"CNAME"
																	],
																	"description": "The record’s type: MX, TXT or CNAME."
																},
																"host": {
																	"type": "string",
																	"description": "The record’s name, in full."
																},
																"value": {
																	"type": "string",
																	"description": "What the record has to hold."
																},
																"priority": {
																	"description": "An MX’s priority. Null on any other record.",
																	"type": [
																		"number",
																		"null"
																	]
																},
																"state": {
																	"type": "string",
																	"enum": [
																		"ok",
																		"missing",
																		"wrong"
																	],
																	"description": "`ok`: DNS answers with it. `missing`: nothing is there. `wrong`: something else is."
																},
																"found": {
																	"description": "What DNS answered instead, when it isn’t what the record should hold.",
																	"type": [
																		"string",
																		"null"
																	]
																}
															},
															"required": [
																"purpose",
																"type",
																"host",
																"value",
																"priority",
																"state",
																"found"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													],
													"description": "The DMARC record as last checked: what’s published, and what to publish instead."
												},
												"dmarc": {
													"type": "object",
													"properties": {
														"problems": {
															"type": "array",
															"items": {
																"type": "string"
															},
															"description": "What’s wrong with the record for mail Mailset sends, one sentence each. Empty: nothing."
														},
														"fix": {
															"description": "The record to publish instead, the owner’s policy kept. Null when nothing needs changing.",
															"type": [
																"string",
																"null"
															]
														},
														"reportsAuthorized": {
															"type": "boolean",
															"description": "Whether Mailset’s zone lets receivers send this domain’s reports to Mailset."
														},
														"reports": {
															"type": "object",
															"properties": {
																"windowDays": {
																	"type": "number"
																},
																"reports": {
																	"type": "number"
																},
																"messages": {
																	"type": "number"
																},
																"passed": {
																	"type": "number",
																	"description": "Messages that passed DMARC."
																},
																"reporters": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	},
																	"description": "The DKIM-verified domains that sent reports: `google.com`."
																},
																"failing": {
																	"type": "array",
																	"items": {
																		"type": "object",
																		"properties": {
																			"ip": {
																				"type": "string"
																			},
																			"messages": {
																				"type": "number"
																			},
																			"disposition": {
																				"type": "string",
																				"description": "What receivers mostly did with it: none, quarantine or reject."
																			},
																			"dkim": {
																				"type": "string",
																				"description": "DKIM’s and SPF’s own results, before alignment: `pass`, `fail`, `none`."
																			},
																			"spf": {
																				"type": "string"
																			}
																		},
																		"required": [
																			"ip",
																			"messages",
																			"disposition",
																			"dkim",
																			"spf"
																		],
																		"additionalProperties": false
																	},
																	"description": "The sources that failed, most messages first."
																},
																"lastAt": {
																	"type": [
																		"number",
																		"null"
																	]
																}
															},
															"required": [
																"windowDays",
																"reports",
																"messages",
																"passed",
																"reporters",
																"failing",
																"lastAt"
															],
															"additionalProperties": false
														}
													},
													"required": [
														"problems",
														"fix",
														"reportsAuthorized",
														"reports"
													],
													"additionalProperties": false
												},
												"change": {
													"type": "object",
													"properties": {
														"policy": {
															"type": "string",
															"enum": [
																"none",
																"quarantine",
																"reject"
															]
														},
														"host": {
															"type": "string",
															"description": "`_dmarc.<domain>`."
														},
														"before": {
															"description": "The DMARC records published before, joined with ` | `. Null: none.",
															"type": [
																"string",
																"null"
															]
														},
														"record": {
															"type": "string",
															"description": "The one record now, or the one to publish in place of every DMARC record there."
														},
														"changed": {
															"type": "boolean",
															"description": "False when the record already said this."
														},
														"written": {
															"type": "boolean",
															"description": "Mailset wrote it to the zone itself."
														},
														"live": {
															"type": "boolean",
															"description": "The zone’s own nameservers answer it, and only it."
														},
														"unchecked": {
															"type": "boolean",
															"description": "Raised with --anyway, before reports showed it safe."
														},
														"writable": {
															"type": "boolean",
															"description": "Mailset can write this zone."
														},
														"dnsHost": {
															"type": [
																"string",
																"null"
															]
														},
														"dnsPage": {
															"type": [
																"string",
																"null"
															]
														},
														"problem": {
															"description": "Why Mailset couldn’t write it just now.",
															"type": [
																"string",
																"null"
															]
														}
													},
													"required": [
														"policy",
														"host",
														"before",
														"record",
														"changed",
														"written",
														"live",
														"unchecked",
														"writable",
														"dnsHost",
														"dnsPage",
														"problem"
													],
													"additionalProperties": false
												}
											},
											"required": [
												"name",
												"record",
												"dmarc"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.apply": {
			"post": {
				"operationId": "domains.apply",
				"summary": "Write a domain’s records to its DNS host",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.apply"
				},
				"x-mailset-cli": "mailset domains apply <name> [--sending] [--only-mailset] [--drop-leftovers <drop-leftovers>] [--include-tracking] [--anyway] [--org <id>]",
				"x-mailset-cli-example": "mailset domains apply example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											},
											"sending": {
												"default": false,
												"description": "Only the DKIM and bounce records: the domain sends, and its mail still arrives where it does today.",
												"type": "boolean"
											},
											"onlyMailset": {
												"default": false,
												"description": "Mailset is the only thing that sends as this domain: SPF names only Mailset, and every other DKIM key is deleted. For a domain that left Google or another provider for good.",
												"type": "boolean"
											},
											"dropLeftovers": {
												"description": "The old providers whose records go, by id, as `domains plan` lists them: bounce, DKIM, SPF, verification and, once mail comes here, MX. Never what Mailset wrote. A bare flag is refused with the ids found.",
												"anyOf": [
													{
														"type": "boolean"
													},
													{
														"maxItems": 20,
														"type": "array",
														"items": {
															"type": "string"
														}
													}
												]
											},
											"includeTracking": {
												"default": false,
												"description": "With --drop-leftovers: their tracking records too, which old links still use.",
												"type": "boolean"
											},
											"anyway": {
												"default": false,
												"description": "With --drop-leftovers: without DMARC reports showing they stopped sending.",
												"type": "boolean"
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"applied": {
													"type": "array",
													"items": {
														"type": "string"
													}
												},
												"removed": {
													"default": [],
													"description": "DKIM keys deleted by --only-mailset: other senders that could sign as the domain.",
													"type": "array",
													"items": {
														"type": "string"
													}
												},
												"leftovers": {
													"description": "Records old providers left, and what `--drop-leftovers` did with each.",
													"type": "object",
													"properties": {
														"removed": {
															"type": "array",
															"items": {
																"type": "object",
																"properties": {
																	"providerId": {
																		"type": "string",
																		"description": "What `--drop-leftovers` calls it: `sparkpost`."
																	},
																	"provider": {
																		"type": "string"
																	},
																	"kind": {
																		"type": "string",
																		"enum": [
																			"bounce",
																			"dkim",
																			"spf",
																			"mx",
																			"verification",
																			"tracking"
																		]
																	},
																	"type": {
																		"type": "string"
																	},
																	"host": {
																		"type": "string"
																	},
																	"value": {
																		"type": "string"
																	}
																},
																"required": [
																	"providerId",
																	"provider",
																	"kind",
																	"type",
																	"host",
																	"value"
																],
																"additionalProperties": false
															}
														},
														"kept": {
															"type": "array",
															"items": {
																"type": "object",
																"properties": {
																	"providerId": {
																		"type": "string",
																		"description": "What `--drop-leftovers` calls it: `sparkpost`."
																	},
																	"provider": {
																		"type": "string"
																	},
																	"kind": {
																		"type": "string",
																		"enum": [
																			"bounce",
																			"dkim",
																			"spf",
																			"mx",
																			"verification",
																			"tracking"
																		]
																	},
																	"type": {
																		"type": "string"
																	},
																	"host": {
																		"type": "string"
																	},
																	"value": {
																		"type": "string"
																	},
																	"reason": {
																		"type": "string"
																	}
																},
																"required": [
																	"providerId",
																	"provider",
																	"kind",
																	"type",
																	"host",
																	"value",
																	"reason"
																],
																"additionalProperties": false
															}
														}
													},
													"required": [
														"removed",
														"kept"
													],
													"additionalProperties": false
												},
												"domain": {
													"$ref": "#/components/schemas/Domain"
												}
											},
											"required": [
												"applied",
												"removed",
												"domain"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.sts": {
			"post": {
				"operationId": "domains.sts",
				"summary": "Set a domain’s MTA-STS mode: testing or enforce",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.sts"
				},
				"x-mailset-cli": "mailset domains sts <name> --mode testing|enforce [--org <id>]",
				"x-mailset-cli-example": "mailset domains sts example.com --mode enforce",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name.",
												"type": "string"
											},
											"mode": {
												"type": "string",
												"enum": [
													"testing",
													"enforce"
												],
												"description": "`testing`: senders report TLS failures and deliver anyway. `enforce`: they refuse to deliver without TLS."
											}
										},
										"required": [
											"name",
											"mode"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mode": "enforce",
									"name": "example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"domain": {
													"$ref": "#/components/schemas/Domain"
												},
												"published": {
													"type": "boolean",
													"description": "Whether Mailset wrote the new policy id to DNS itself."
												},
												"publishRecord": {
													"description": "When it didn’t: the record to publish so senders notice the change.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"domain",
												"published",
												"publishRecord"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.remove": {
			"post": {
				"operationId": "domains.remove",
				"summary": "Remove a domain",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.remove"
				},
				"x-mailset-cli": "mailset domains remove <name> [--org <id>]",
				"x-mailset-cli-example": "mailset domains remove acme.org",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "acme.org"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean"
												},
												"note": {
													"description": "On a parked domain: what removing it left as it was.",
													"type": "string"
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.postmaster": {
			"post": {
				"operationId": "domains.postmaster",
				"summary": "Gmail’s view of a domain, from Google Postmaster Tools",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.postmaster"
				},
				"x-mailset-cli": "mailset domains postmaster <name> [--token <token>] [--org <id>]",
				"x-mailset-cli-example": "mailset domains postmaster example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											},
											"token": {
												"description": "The TXT value Postmaster Tools shows for the domain. Given, Mailset writes that record and checks it.",
												"type": "string"
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string"
												},
												"sending": {
													"type": "boolean",
													"description": "It sends through Mailset: its DKIM and bounce records pass. Gmail’s numbers are shown only then."
												},
												"record": {
													"type": "object",
													"properties": {
														"host": {
															"type": "string",
															"description": "The domain itself: Postmaster Tools verifies the apex."
														},
														"type": {
															"type": "string",
															"const": "TXT"
														},
														"value": {
															"type": [
																"string",
																"null"
															]
														},
														"state": {
															"type": "string",
															"enum": [
																"none",
																"live",
																"missing"
															]
														},
														"writable": {
															"type": "boolean",
															"description": "Mailset writes it to the DNS host itself."
														},
														"dnsHost": {
															"description": "Who hosts the zone, when Mailset can tell: \"Cloudflare\".",
															"type": [
																"string",
																"null"
															]
														},
														"dnsPage": {
															"description": "The host’s own page for this zone’s records.",
															"type": [
																"string",
																"null"
															]
														}
													},
													"required": [
														"host",
														"type",
														"value",
														"state",
														"writable",
														"dnsHost",
														"dnsPage"
													],
													"additionalProperties": false
												},
												"gmail": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"verification": {
																	"type": "string",
																	"enum": [
																		"not_added",
																		"unverified",
																		"verified",
																		"no_access"
																	]
																},
																"days": {
																	"type": "array",
																	"items": {
																		"type": "object",
																		"properties": {
																			"date": {
																				"type": "string",
																				"description": "`2026-11-19`, Gmail’s own day."
																			},
																			"spamRate": {
																				"type": [
																					"number",
																					"null"
																				]
																			},
																			"dkim": {
																				"type": [
																					"number",
																					"null"
																				]
																			},
																			"spf": {
																				"type": [
																					"number",
																					"null"
																				]
																			},
																			"dmarc": {
																				"type": [
																					"number",
																					"null"
																				]
																			},
																			"deliveryErrors": {
																				"type": [
																					"number",
																					"null"
																				]
																			}
																		},
																		"required": [
																			"date",
																			"spamRate",
																			"dkim",
																			"spf",
																			"dmarc",
																			"deliveryErrors"
																		],
																		"additionalProperties": false
																	},
																	"description": "Newest first, only the days Gmail has numbers for."
																},
																"requirements": {
																	"type": "array",
																	"items": {
																		"type": "object",
																		"properties": {
																			"requirement": {
																				"type": "string",
																				"enum": [
																					"SPF",
																					"DKIM",
																					"SPF_AND_DKIM",
																					"DMARC_POLICY",
																					"DMARC_ALIGNMENT",
																					"MESSAGE_FORMATTING",
																					"DNS_RECORDS",
																					"ENCRYPTION",
																					"USER_REPORTED_SPAM_RATE",
																					"ONE_CLICK_UNSUBSCRIBE",
																					"HONOR_UNSUBSCRIBE"
																				]
																			},
																			"compliant": {
																				"type": "boolean"
																			}
																		},
																		"required": [
																			"requirement",
																			"compliant"
																		],
																		"additionalProperties": false
																	}
																}
															},
															"required": [
																"verification",
																"days",
																"requirements"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													],
													"description": "Null: no Google account connected, or the domain doesn’t send yet."
												},
												"problem": {
													"description": "Why Gmail’s numbers couldn’t be read just now.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"name",
												"sending",
												"record",
												"gmail",
												"problem"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.logo": {
			"post": {
				"operationId": "domains.logo",
				"summary": "A domain’s brand logo (BIMI)",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.logo"
				},
				"x-mailset-cli": "mailset domains logo <name> [--title <title>] [--certificate <certificate>] [--remove] [--file <path>] [--org <id>]",
				"x-mailset-cli-example": "mailset domains logo example.com --file logo.svg --title Acme",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"x-mailset-max-body-bytes": 703147,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											},
											"file": {
												"description": "The SVG, base64.",
												"type": "string",
												"minLength": 1
											},
											"fileName": {
												"description": "The SVG file’s name.",
												"type": "string",
												"maxLength": 255
											},
											"title": {
												"description": "The brand’s name, the logo’s `<title>`. The org’s name when left out.",
												"type": "string",
												"minLength": 1,
												"maxLength": 64
											},
											"certificate": {
												"description": "The https URL of the logo’s VMC or CMC certificate, or `none` to take it off.",
												"type": "string",
												"maxLength": 2048
											},
											"remove": {
												"default": false,
												"description": "Take the logo off the domain.",
												"type": "boolean"
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"file": "<base64 of the file>",
									"title": "Acme",
									"name": "example.com",
									"fileName": "logo.svg"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string"
												},
												"logo": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"url": {
																	"type": "string",
																	"description": "Where receivers fetch the logo from."
																},
																"title": {
																	"type": "string"
																},
																"bytes": {
																	"type": "number"
																},
																"setAt": {
																	"type": "number"
																},
																"notes": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	},
																	"description": "What the conversion noticed and couldn’t fix for you: a transparent background."
																}
															},
															"required": [
																"url",
																"title",
																"bytes",
																"setAt",
																"notes"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													]
												},
												"certificate": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"url": {
																	"type": "string"
																},
																"stale": {
																	"type": "boolean",
																	"description": "It was added for an earlier logo, and a certificate covers one logo only."
																}
															},
															"required": [
																"url",
																"stale"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													]
												},
												"record": {
													"type": "object",
													"properties": {
														"host": {
															"type": "string"
														},
														"value": {
															"description": "The record to publish. Null without a logo.",
															"type": [
																"string",
																"null"
															]
														},
														"state": {
															"type": "string",
															"enum": [
																"none",
																"live",
																"missing",
																"wrong"
															]
														},
														"found": {
															"description": "What DNS answers there instead, when it isn’t the record to publish.",
															"type": [
																"string",
																"null"
															]
														},
														"writable": {
															"type": "boolean"
														},
														"dnsHost": {
															"type": [
																"string",
																"null"
															]
														},
														"dnsPage": {
															"type": [
																"string",
																"null"
															]
														}
													},
													"required": [
														"host",
														"value",
														"state",
														"found",
														"writable",
														"dnsHost",
														"dnsPage"
													],
													"additionalProperties": false
												},
												"dmarc": {
													"type": "object",
													"properties": {
														"domain": {
															"type": "string",
															"description": "Where the policy that counts lives: the registered domain."
														},
														"enforced": {
															"type": "boolean"
														},
														"problems": {
															"type": "array",
															"items": {
																"type": "string"
															}
														},
														"fixes": {
															"type": "array",
															"items": {
																"type": "object",
																"properties": {
																	"host": {
																		"type": "string"
																	},
																	"value": {
																		"type": "string"
																	}
																},
																"required": [
																	"host",
																	"value"
																],
																"additionalProperties": false
															},
															"description": "The records to publish: the owner’s own, with only what keeps a logo away changed."
														},
														"passed": {
															"description": "What DMARC reports said over their window: the share that passed.",
															"type": [
																"number",
																"null"
															]
														},
														"messages": {
															"type": "number"
														}
													},
													"required": [
														"domain",
														"enforced",
														"problems",
														"fixes",
														"passed",
														"messages"
													],
													"additionalProperties": false
												},
												"providers": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string",
																"enum": [
																	"yahoo",
																	"fastmail",
																	"gmail",
																	"apple"
																]
															},
															"name": {
																"type": "string"
															},
															"state": {
																"type": "string",
																"enum": [
																	"ready",
																	"waiting",
																	"certificate"
																]
															},
															"note": {
																"type": "string"
															}
														},
														"required": [
															"id",
															"name",
															"state",
															"note"
														],
														"additionalProperties": false
													}
												},
												"problem": {
													"description": "Why DNS couldn’t be read just now.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"name",
												"logo",
												"certificate",
												"record",
												"dmarc",
												"providers",
												"problem"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.verify": {
			"post": {
				"operationId": "domains.verify",
				"summary": "Add the TXT record a service asks for to prove a domain (Google, Yahoo, Apple, Microsoft, Facebook)",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.verify"
				},
				"x-mailset-cli": "mailset domains verify <name> --txt <txt> [--host <host>] [--org <id>]",
				"x-mailset-cli-example": "mailset domains verify example.com --txt \"google-site-verification=k3XwPq7Zr2Lm9Vt4Yb8Nc1Hd6Jf0Sg5Ua3Ee7Ww2Ii4\"",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											},
											"txt": {
												"description": "The TXT value the service asks for, as it shows it.",
												"type": "string"
											},
											"host": {
												"description": "The name under the domain the record goes on, when the service names one. Left out: the domain itself.",
												"type": "string"
											}
										},
										"required": [
											"name",
											"txt"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"txt": "google-site-verification=k3XwPq7Zr2Lm9Vt4Yb8Nc1Hd6Jf0Sg5Ua3Ee7Ww2Ii4",
									"name": "example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string",
													"description": "The org’s domain the record is for."
												},
												"host": {
													"type": "string",
													"description": "Where it goes: the domain itself or a name under it."
												},
												"relative": {
													"type": "string",
													"description": "The host as a DNS host’s form asks for it: `@` for the domain itself."
												},
												"type": {
													"type": "string",
													"const": "TXT"
												},
												"value": {
													"type": "string"
												},
												"strings": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "The value as DNS holds it, in 255-character strings."
												},
												"state": {
													"type": "string",
													"enum": [
														"live",
														"missing"
													],
													"description": "`live`: the zone’s own nameservers answer it. `missing`: not yet."
												},
												"already": {
													"type": "boolean",
													"description": "It was there before, so nothing changed."
												},
												"written": {
													"type": "boolean",
													"description": "Mailset wrote it to the zone just now."
												},
												"writable": {
													"type": "boolean",
													"description": "Mailset writes this zone itself."
												},
												"dnsHost": {
													"type": [
														"string",
														"null"
													]
												},
												"dnsPage": {
													"type": [
														"string",
														"null"
													]
												},
												"problem": {
													"description": "Why Mailset couldn’t write or check it just now.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"name",
												"host",
												"relative",
												"type",
												"value",
												"strings",
												"state",
												"already",
												"written",
												"writable",
												"dnsHost",
												"dnsPage",
												"problem"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.status": {
			"post": {
				"operationId": "domains.status",
				"summary": "A domain’s setup checklist: where each step stands and the next command for it, steps on other sites included",
				"description": "An admin or owner of the org.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.status"
				},
				"x-mailset-cli": "mailset domains status <name> [--org <id>]",
				"x-mailset-cli-example": "mailset domains status example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string"
												},
												"kind": {
													"type": "string",
													"enum": [
														"mail",
														"sending",
														"parked"
													]
												},
												"status": {
													"type": "string",
													"enum": [
														"pending",
														"receiving",
														"ready",
														"parked"
													]
												},
												"sending": {
													"type": "string",
													"enum": [
														"pending",
														"ready",
														"blocked"
													]
												},
												"checkedAt": {
													"description": "When its records were last checked. The rows that read DNS read it now.",
													"type": [
														"number",
														"null"
													]
												},
												"rows": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string",
																"enum": [
																	"dns",
																	"mta_sts",
																	"dmarc",
																	"logo",
																	"certificate",
																	"postmaster",
																	"campaigns",
																	"mailboxes",
																	"yahoo",
																	"sender_photos",
																	"old_provider"
																]
															},
															"title": {
																"type": "string"
															},
															"state": {
																"type": "string",
																"enum": [
																	"ok",
																	"todo",
																	"manual",
																	"info"
																]
															},
															"detail": {
																"type": "string",
																"description": "Where it stands, in a sentence or two."
															},
															"next": {
																"description": "What to run next: a `mailset` command, or `mailset guide <topic>` for a step on another site. Null when nothing is left to do.",
																"type": [
																	"string",
																	"null"
																]
															}
														},
														"required": [
															"id",
															"title",
															"state",
															"detail",
															"next"
														],
														"additionalProperties": false
													}
												}
											},
											"required": [
												"name",
												"kind",
												"status",
												"sending",
												"checkedAt",
												"rows"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/domains.connect": {
			"post": {
				"operationId": "domains.connect",
				"summary": "One-click setup: a link to the DNS host’s own page, where you approve Mailset’s records once, for a host Mailset can’t write that supports Domain Connect",
				"description": "An admin or owner of the org.",
				"tags": [
					"Domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domains.connect"
				},
				"x-mailset-cli": "mailset domains connect <name> [--sending] [--org <id>]",
				"x-mailset-cli-example": "mailset domains connect example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"description": "The domain’s name, such as `example.com`.",
												"type": "string"
											},
											"sending": {
												"default": false,
												"description": "Only what sending needs: the DKIM and bounce records.",
												"type": "boolean"
											}
										},
										"required": [
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string"
												},
												"dnsHost": {
													"description": "The DNS host, as it names itself. Null when Mailset can’t tell.",
													"type": [
														"string",
														"null"
													]
												},
												"writable": {
													"type": "boolean",
													"description": "Mailset writes this zone itself, so `domains apply` needs no link."
												},
												"links": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"service": {
																"type": "string",
																"enum": [
																	"mail",
																	"sending",
																	"tracking",
																	"park",
																	"logo"
																],
																"description": "Which of Mailset’s templates the page applies: `mail`, `sending`, `tracking`, `park` or `logo`."
															},
															"url": {
																"type": "string",
																"description": "The DNS host’s page where the domain’s owner approves the records."
															},
															"records": {
																"type": "array",
																"items": {
																	"type": "object",
																	"properties": {
																		"type": {
																			"type": "string",
																			"description": "The record’s type: CNAME, TXT or MX."
																		},
																		"host": {
																			"type": "string",
																			"description": "The record’s name, in full."
																		},
																		"value": {
																			"type": "string",
																			"description": "What the record holds."
																		},
																		"priority": {
																			"description": "An MX’s priority. Null on any other record.",
																			"type": [
																				"number",
																				"null"
																			]
																		}
																	},
																	"required": [
																		"type",
																		"host",
																		"value",
																		"priority"
																	],
																	"additionalProperties": false
																},
																"description": "What the page adds, as `domains check` lists them."
															}
														},
														"required": [
															"service",
															"url",
															"records"
														],
														"additionalProperties": false
													}
												},
												"byHand": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"type": {
																"type": "string",
																"description": "The record’s type: CNAME, TXT or MX."
															},
															"host": {
																"type": "string",
																"description": "The record’s name, in full."
															},
															"value": {
																"type": "string",
																"description": "What the record holds."
															},
															"priority": {
																"description": "An MX’s priority. Null on any other record.",
																"type": [
																	"number",
																	"null"
																]
															}
														},
														"required": [
															"type",
															"host",
															"value",
															"priority"
														],
														"additionalProperties": false
													},
													"description": "Records no link covers, to add by hand."
												},
												"notes": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Steps the links can’t take, in sentences."
												},
												"problem": {
													"description": "Why there’s no link, in a sentence. Null when there is one, or nothing is left to add.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"name",
												"dnsHost",
												"writable",
												"links",
												"byHand",
												"notes",
												"problem"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/postmaster.status": {
			"post": {
				"operationId": "postmaster.status",
				"summary": "The Google account connected to Postmaster Tools, and Gmail’s view of each domain",
				"description": "An admin or owner of the org.",
				"tags": [
					"Postmaster"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/postmaster#postmaster.status"
				},
				"x-mailset-cli": "mailset postmaster status [--org <id>]",
				"x-mailset-cli-example": "mailset postmaster status",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"available": {
													"type": "boolean",
													"description": "Whether a Google account can be connected."
												},
												"connection": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"state": {
																	"type": "string",
																	"enum": [
																		"connected",
																		"lost"
																	]
																},
																"account": {
																	"type": "string"
																},
																"reason": {
																	"type": [
																		"string",
																		"null"
																	]
																},
																"connectedAt": {
																	"type": "number"
																}
															},
															"required": [
																"state",
																"account",
																"reason",
																"connectedAt"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													]
												},
												"domains": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"name": {
																"type": "string"
															},
															"sending": {
																"type": "boolean",
																"description": "It sends through Mailset: its DKIM and bounce records pass. Gmail’s numbers are shown only then."
															},
															"record": {
																"type": "object",
																"properties": {
																	"host": {
																		"type": "string",
																		"description": "The domain itself: Postmaster Tools verifies the apex."
																	},
																	"type": {
																		"type": "string",
																		"const": "TXT"
																	},
																	"value": {
																		"type": [
																			"string",
																			"null"
																		]
																	},
																	"state": {
																		"type": "string",
																		"enum": [
																			"none",
																			"live",
																			"missing"
																		]
																	},
																	"writable": {
																		"type": "boolean",
																		"description": "Mailset writes it to the DNS host itself."
																	},
																	"dnsHost": {
																		"description": "Who hosts the zone, when Mailset can tell: \"Cloudflare\".",
																		"type": [
																			"string",
																			"null"
																		]
																	},
																	"dnsPage": {
																		"description": "The host’s own page for this zone’s records.",
																		"type": [
																			"string",
																			"null"
																		]
																	}
																},
																"required": [
																	"host",
																	"type",
																	"value",
																	"state",
																	"writable",
																	"dnsHost",
																	"dnsPage"
																],
																"additionalProperties": false
															},
															"gmail": {
																"anyOf": [
																	{
																		"type": "object",
																		"properties": {
																			"verification": {
																				"type": "string",
																				"enum": [
																					"not_added",
																					"unverified",
																					"verified",
																					"no_access"
																				]
																			},
																			"days": {
																				"type": "array",
																				"items": {
																					"type": "object",
																					"properties": {
																						"date": {
																							"type": "string",
																							"description": "`2026-11-19`, Gmail’s own day."
																						},
																						"spamRate": {
																							"type": [
																								"number",
																								"null"
																							]
																						},
																						"dkim": {
																							"type": [
																								"number",
																								"null"
																							]
																						},
																						"spf": {
																							"type": [
																								"number",
																								"null"
																							]
																						},
																						"dmarc": {
																							"type": [
																								"number",
																								"null"
																							]
																						},
																						"deliveryErrors": {
																							"type": [
																								"number",
																								"null"
																							]
																						}
																					},
																					"required": [
																						"date",
																						"spamRate",
																						"dkim",
																						"spf",
																						"dmarc",
																						"deliveryErrors"
																					],
																					"additionalProperties": false
																				},
																				"description": "Newest first, only the days Gmail has numbers for."
																			},
																			"requirements": {
																				"type": "array",
																				"items": {
																					"type": "object",
																					"properties": {
																						"requirement": {
																							"type": "string",
																							"enum": [
																								"SPF",
																								"DKIM",
																								"SPF_AND_DKIM",
																								"DMARC_POLICY",
																								"DMARC_ALIGNMENT",
																								"MESSAGE_FORMATTING",
																								"DNS_RECORDS",
																								"ENCRYPTION",
																								"USER_REPORTED_SPAM_RATE",
																								"ONE_CLICK_UNSUBSCRIBE",
																								"HONOR_UNSUBSCRIBE"
																							]
																						},
																						"compliant": {
																							"type": "boolean"
																						}
																					},
																					"required": [
																						"requirement",
																						"compliant"
																					],
																					"additionalProperties": false
																				}
																			}
																		},
																		"required": [
																			"verification",
																			"days",
																			"requirements"
																		],
																		"additionalProperties": false
																	},
																	{
																		"type": "null"
																	}
																],
																"description": "Null: no Google account connected, or the domain doesn’t send yet."
															},
															"problem": {
																"description": "Why Gmail’s numbers couldn’t be read just now.",
																"type": [
																	"string",
																	"null"
																]
															}
														},
														"required": [
															"name",
															"sending",
															"record",
															"gmail",
															"problem"
														],
														"additionalProperties": false
													}
												}
											},
											"required": [
												"available",
												"connection",
												"domains"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/postmaster.connect": {
			"post": {
				"operationId": "postmaster.connect",
				"summary": "Connect a Google account so Mailset can read Gmail’s numbers: opens Google",
				"description": "An admin or owner of the org.",
				"tags": [
					"Postmaster"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/postmaster#postmaster.connect"
				},
				"x-mailset-cli": "mailset postmaster connect [--org <id>]",
				"x-mailset-cli-example": "mailset postmaster connect",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"url": {
													"type": "string"
												}
											},
											"required": [
												"url"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/postmaster.disconnect": {
			"post": {
				"operationId": "postmaster.disconnect",
				"summary": "End Mailset’s access to Postmaster Tools at Google",
				"description": "An admin or owner of the org.",
				"tags": [
					"Postmaster"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/postmaster#postmaster.disconnect"
				},
				"x-mailset-cli": "mailset postmaster disconnect [--org <id>]",
				"x-mailset-cli-example": "mailset postmaster disconnect",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"disconnected": {
													"type": "boolean",
													"const": true
												}
											},
											"required": [
												"disconnected"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/dns.status": {
			"post": {
				"operationId": "dns.status",
				"summary": "Whether the org’s own Cloudflare is connected, the accounts and zones it sees, and whose token writes each domain",
				"description": "An admin or owner of the org.",
				"tags": [
					"DNS connection"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/dns#dns.status"
				},
				"x-mailset-cli": "mailset dns status [--org <id>]",
				"x-mailset-cli-example": "mailset dns status",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"available": {
													"type": "boolean",
													"description": "Whether connecting Cloudflare is offered."
												},
												"connection": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"provider": {
																	"type": "string",
																	"enum": [
																		"cloudflare"
																	]
																},
																"state": {
																	"type": "string",
																	"enum": [
																		"connected",
																		"broken"
																	],
																	"description": "`broken`: Cloudflare refused the grant, so records go in by hand until it’s connected again."
																},
																"problem": {
																	"description": "Why it broke, or what last went wrong with it.",
																	"type": [
																		"string",
																		"null"
																	]
																},
																"connectedBy": {
																	"description": "Who connected it.",
																	"type": [
																		"string",
																		"null"
																	]
																},
																"connectedAt": {
																	"type": "number"
																},
																"refreshedAt": {
																	"description": "When Mailset last renewed its access. Null: never needed to.",
																	"type": [
																		"number",
																		"null"
																	]
																},
																"expiresAt": {
																	"description": "When the access token runs out. Null: Cloudflare didn’t say.",
																	"type": [
																		"number",
																		"null"
																	]
																},
																"scopes": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	}
																}
															},
															"required": [
																"provider",
																"state",
																"problem",
																"connectedBy",
																"connectedAt",
																"refreshedAt",
																"expiresAt",
																"scopes"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													]
												},
												"accounts": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string"
															},
															"name": {
																"type": "string"
															}
														},
														"required": [
															"id",
															"name"
														],
														"additionalProperties": false
													},
													"description": "The Cloudflare accounts the grant reaches, by the zones it sees."
												},
												"zones": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "The zones the grant sees, by name."
												},
												"moreZones": {
													"type": "boolean",
													"description": "The grant sees more zones than listed."
												},
												"domains": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"name": {
																"type": "string"
															},
															"zone": {
																"description": "The zone the domain is in, when its nameservers answer.",
																"type": [
																	"string",
																	"null"
																]
															},
															"writer": {
																"type": "string",
																"enum": [
																	"org",
																	"mailset",
																	"by_hand"
																]
															}
														},
														"required": [
															"name",
															"zone",
															"writer"
														],
														"additionalProperties": false
													},
													"description": "Each of the org’s domains, and whose token writes its records."
												},
												"problem": {
													"description": "Why the zones couldn’t be read just now.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"available",
												"connection",
												"accounts",
												"zones",
												"moreZones",
												"domains",
												"problem"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/dns.connect": {
			"post": {
				"operationId": "dns.connect",
				"summary": "Let Mailset write your domains’ DNS records in your own Cloudflare: cloudflare (gives a Mailset page to open, signed in)",
				"description": "An admin or owner of the org.",
				"tags": [
					"DNS connection"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/dns#dns.connect"
				},
				"x-mailset-cli": "mailset dns connect <provider> [--org <id>]",
				"x-mailset-cli-example": "mailset dns connect cloudflare",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"provider": {
												"type": "string",
												"enum": [
													"cloudflare"
												],
												"description": "The DNS provider to connect: `cloudflare`."
											}
										},
										"required": [
											"provider"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"provider": "cloudflare"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"url": {
													"type": "string",
													"description": "A Mailset page to open, signed in, that starts the connection."
												}
											},
											"required": [
												"url"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/dns.disconnect": {
			"post": {
				"operationId": "dns.disconnect",
				"summary": "End Mailset’s access to your Cloudflare at Cloudflare, and go back to adding records by hand",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"DNS connection"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/dns#dns.disconnect"
				},
				"x-mailset-cli": "mailset dns disconnect [--org <id>]",
				"x-mailset-cli-example": "mailset dns disconnect",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"disconnected": {
													"type": "boolean",
													"const": true
												},
												"revoked": {
													"type": "boolean",
													"description": "Cloudflare was told. False: Cloudflare connect isn’t set up here, so end it there too."
												}
											},
											"required": [
												"disconnected",
												"revoked"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/senders.connect": {
			"post": {
				"operationId": "senders.connect",
				"summary": "Connect your Google Workspace or Cloud Identity org, so Mailset can make the Google users behind sender photos: opens Google",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/senders#senders.connect"
				},
				"x-mailset-cli": "mailset senders connect [--org <id>]",
				"x-mailset-cli-example": "mailset senders connect",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"url": {
													"type": "string"
												}
											},
											"required": [
												"url"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/senders.disconnect": {
			"post": {
				"operationId": "senders.disconnect",
				"summary": "End Mailset’s access to your Google org at Google",
				"description": "An admin or owner of the org.",
				"tags": [
					"Senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/senders#senders.disconnect"
				},
				"x-mailset-cli": "mailset senders disconnect [--org <id>]",
				"x-mailset-cli-example": "mailset senders disconnect",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"disconnected": {
													"type": "boolean",
													"const": true
												}
											},
											"required": [
												"disconnected"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/senders.accounts": {
			"post": {
				"operationId": "senders.accounts",
				"summary": "The addresses you send from, and whether each has a Google user with a photo, the picture Gmail shows beside your mail. A domain narrows it",
				"description": "An admin or owner of the org.",
				"tags": [
					"Senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/senders#senders.accounts"
				},
				"x-mailset-cli": "mailset senders accounts [<domain>] [--org <id>]",
				"x-mailset-cli-example": "mailset senders accounts example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "Only addresses at this domain.",
												"type": "string"
											}
										}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"domain": "example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"available": {
													"type": "boolean",
													"description": "Whether a Google org can be connected."
												},
												"connection": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"state": {
																	"type": "string",
																	"enum": [
																		"connected",
																		"lost"
																	]
																},
																"account": {
																	"type": "string",
																	"description": "The Google admin who connected it."
																},
																"reason": {
																	"type": [
																		"string",
																		"null"
																	]
																},
																"connectedAt": {
																	"type": "number"
																}
															},
															"required": [
																"state",
																"account",
																"reason",
																"connectedAt"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													]
												},
												"addresses": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"address": {
																"type": "string"
															},
															"uses": {
																"type": "array",
																"items": {
																	"type": "string",
																	"enum": [
																		"mailbox",
																		"alias",
																		"campaign"
																	]
																}
															},
															"google": {
																"type": "string",
																"enum": [
																	"user",
																	"alias",
																	"none",
																	"domain_missing",
																	"domain_unverified",
																	"domain_pending",
																	"unknown"
																]
															},
															"aliasOf": {
																"type": [
																	"string",
																	"null"
																]
															},
															"photo": {
																"description": "Null when there’s no user to have one.",
																"type": [
																	"boolean",
																	"null"
																]
															}
														},
														"required": [
															"address",
															"uses",
															"google",
															"aliasOf",
															"photo"
														],
														"additionalProperties": false
													}
												},
												"more": {
													"type": "number",
													"description": "Addresses past the most one call asks about: name a domain to see them."
												},
												"problem": {
													"description": "Why Google couldn’t answer for some or all of them.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"available",
												"connection",
												"addresses",
												"more",
												"problem"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/senders.create": {
			"post": {
				"operationId": "senders.create",
				"summary": "Make the Google user for a sending address, so Gmail shows its photo",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/senders#senders.create"
				},
				"x-mailset-cli": "mailset senders create <address> --name <name> [--photo <path>] [--org <id>]",
				"x-mailset-cli-example": "mailset senders create hello@example.com --name \"Acme Team\" --photo logo.png",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"x-mailset-max-body-bytes": 1402198,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The sending address the Google user is for.",
												"type": "string"
											},
											"name": {
												"type": "string",
												"minLength": 1,
												"maxLength": 121,
												"description": "The user’s name, as “First Last”."
											},
											"photo": {
												"description": "The photo, base64.",
												"type": "string",
												"minLength": 1
											},
											"photoName": {
												"description": "The photo file’s name.",
												"type": "string",
												"maxLength": 255
											}
										},
										"required": [
											"address",
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "Acme Team",
									"photo": "<base64 of the file>",
									"address": "hello@example.com",
									"photoName": "logo.png"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"address": {
													"type": "string"
												},
												"domainAdded": {
													"description": "The subdomain Mailset added to the Google org first, when it had to.",
													"type": [
														"string",
														"null"
													]
												},
												"photo": {
													"type": "string",
													"enum": [
														"set",
														"none",
														"failed"
													],
													"description": "`none`: no photo was given. `failed`: the user exists, and the photo didn’t go."
												},
												"photoProblem": {
													"type": [
														"string",
														"null"
													]
												},
												"licence": {
													"type": "string"
												},
												"visibility": {
													"type": "string"
												},
												"guide": {
													"type": "string"
												}
											},
											"required": [
												"address",
												"domainAdded",
												"photo",
												"photoProblem",
												"licence",
												"visibility",
												"guide"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/senders.photo": {
			"post": {
				"operationId": "senders.photo",
				"summary": "Replace the photo of a sending address’s Google user",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/senders#senders.photo"
				},
				"x-mailset-cli": "mailset senders photo <address> --file <path> [--org <id>]",
				"x-mailset-cli-example": "mailset senders photo hello@example.com --file logo.png",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"x-mailset-max-body-bytes": 1402198,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The sending address whose Google user gets the photo.",
												"type": "string"
											},
											"file": {
												"type": "string",
												"minLength": 1,
												"description": "The photo, base64."
											},
											"fileName": {
												"description": "The photo file’s name.",
												"type": "string",
												"maxLength": 255
											}
										},
										"required": [
											"address",
											"file"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"file": "<base64 of the file>",
									"address": "hello@example.com",
									"fileName": "logo.png"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"address": {
													"type": "string"
												},
												"visibility": {
													"type": "string"
												},
												"guide": {
													"type": "string"
												}
											},
											"required": [
												"address",
												"visibility",
												"guide"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/routes.list": {
			"post": {
				"operationId": "routes.list",
				"summary": "List the inbound routes: domains whose mail goes to a webhook",
				"description": "An admin or owner of the org.",
				"tags": [
					"Inbound routes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/routes#routes.list"
				},
				"x-mailset-cli": "mailset routes list [--org <id>]",
				"x-mailset-cli-example": "mailset routes list",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Route"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/routes.add": {
			"post": {
				"operationId": "routes.add",
				"summary": "Send every message to a subdomain to a webhook",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Inbound routes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/routes#routes.add"
				},
				"x-mailset-cli": "mailset routes add <domain> --url <url> [--org <id>]",
				"x-mailset-cli-example": "mailset routes add in.example.com --url https://app.example.com/hooks/inbound",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The route’s domain: every address at it goes to the hook.",
												"type": "string"
											},
											"url": {
												"type": "string",
												"minLength": 1,
												"maxLength": 500,
												"description": "Where each message is POSTed: an https URL on a public host name."
											}
										},
										"required": [
											"domain",
											"url"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"url": "https://app.example.com/hooks/inbound",
									"domain": "in.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"route": {
													"description": "The route as it is now.",
													"$ref": "#/components/schemas/Route"
												},
												"secret": {
													"type": "string",
													"description": "The signing secret, shown this once. Keep it where the hook can read it."
												}
											},
											"required": [
												"route",
												"secret"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/routes.check": {
			"post": {
				"operationId": "routes.check",
				"summary": "Check that a route’s MX points at Mailset",
				"description": "An admin or owner of the org.",
				"tags": [
					"Inbound routes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/routes#routes.check"
				},
				"x-mailset-cli": "mailset routes check <domain> [--org <id>]",
				"x-mailset-cli-example": "mailset routes check in.example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The route’s domain: every address at it goes to the hook.",
												"type": "string"
											}
										},
										"required": [
											"domain"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"domain": "in.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Route"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/routes.apply": {
			"post": {
				"operationId": "routes.apply",
				"summary": "Write a route’s MX to its DNS host",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Inbound routes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/routes#routes.apply"
				},
				"x-mailset-cli": "mailset routes apply <domain> [--org <id>]",
				"x-mailset-cli-example": "mailset routes apply in.example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The route’s domain: every address at it goes to the hook.",
												"type": "string"
											}
										},
										"required": [
											"domain"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"domain": "in.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Route"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/routes.rotate": {
			"post": {
				"operationId": "routes.rotate",
				"summary": "Make a route a new signing secret; the old one stops at once",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Inbound routes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/routes#routes.rotate"
				},
				"x-mailset-cli": "mailset routes rotate <domain> [--org <id>]",
				"x-mailset-cli-example": "mailset routes rotate in.example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The route’s domain: every address at it goes to the hook.",
												"type": "string"
											}
										},
										"required": [
											"domain"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"domain": "in.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"route": {
													"description": "The route as it is now.",
													"$ref": "#/components/schemas/Route"
												},
												"secret": {
													"type": "string",
													"description": "The signing secret, shown this once. Keep it where the hook can read it."
												}
											},
											"required": [
												"route",
												"secret"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/routes.remove": {
			"post": {
				"operationId": "routes.remove",
				"summary": "Remove a route; mail still waiting for its hook is dropped",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Inbound routes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/routes#routes.remove"
				},
				"x-mailset-cli": "mailset routes remove <domain> [--org <id>]",
				"x-mailset-cli-example": "mailset routes remove in.example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The route’s domain: every address at it goes to the hook.",
												"type": "string"
											}
										},
										"required": [
											"domain"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"domain": "in.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean",
													"description": "True when the route was there to remove."
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/sending.domains.add": {
			"post": {
				"operationId": "sending.domains.add",
				"summary": "Add a sending domain, with a tracking domain or without",
				"description": "A campaigns key for the org. Or a person: an admin or owner of the org.",
				"tags": [
					"Sending domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/sending#sending.domains.add"
				},
				"x-mailset-cli": "mailset sending domains add <domain> [--tracking-domain <tracking-domain>] [--org <id>]",
				"x-mailset-cli-example": "mailset sending domains add news.example.com --tracking-domain link.example.com",
				"x-mailset-grant": "campaigns",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The sending domain, such as `news.example.com`.",
												"type": "string"
											},
											"trackingDomain": {
												"description": "Where its links and opens go: a CNAME to Mailset’s link host, on the same registered domain. Left out, its mail is never tracked, and the domain may be the registered domain itself (`example.com`), for replies sent as its support address.",
												"type": [
													"string",
													"null"
												]
											}
										},
										"required": [
											"domain"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"trackingDomain": "link.example.com",
									"domain": "news.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/SendingDomain"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/sending.domains.check": {
			"post": {
				"operationId": "sending.domains.check",
				"summary": "Check a sending domain’s records and certificate now",
				"description": "A campaigns key for the org. Or a person: an admin or owner of the org.",
				"tags": [
					"Sending domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/sending#sending.domains.check"
				},
				"x-mailset-cli": "mailset sending domains check <domain> [--org <id>]",
				"x-mailset-cli-example": "mailset sending domains check news.example.com",
				"x-mailset-grant": "campaigns",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The sending domain, such as `news.example.com`.",
												"type": "string"
											}
										},
										"required": [
											"domain"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"domain": "news.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/SendingDomain"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/sending.domains.list": {
			"post": {
				"operationId": "sending.domains.list",
				"summary": "List the sending domains, their checks and records",
				"description": "A campaigns key for the org. Or a person: an admin or owner of the org.",
				"tags": [
					"Sending domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/sending#sending.domains.list"
				},
				"x-mailset-cli": "mailset sending domains list [--org <id>]",
				"x-mailset-cli-example": "mailset sending domains list",
				"x-mailset-grant": "campaigns",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/SendingDomain"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/sending.domains.remove": {
			"post": {
				"operationId": "sending.domains.remove",
				"summary": "Remove a sending domain; mail still waiting is dropped",
				"description": "A campaigns key for the org. Or a person: an admin or owner of the org.",
				"tags": [
					"Sending domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/sending#sending.domains.remove"
				},
				"x-mailset-cli": "mailset sending domains remove <domain> [--org <id>]",
				"x-mailset-cli-example": "mailset sending domains remove news.example.com",
				"x-mailset-grant": "campaigns",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The sending domain, such as `news.example.com`.",
												"type": "string"
											}
										},
										"required": [
											"domain"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"domain": "news.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean",
													"description": "True when the domain was there to remove."
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/sending.domains.route": {
			"post": {
				"operationId": "sending.domains.route",
				"summary": "Send every message to a sending domain to a webhook",
				"description": "A campaigns key for the org. Or a person: an admin or owner of the org.",
				"tags": [
					"Sending domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/sending#sending.domains.route"
				},
				"x-mailset-cli": "mailset sending domains route <domain> --url <url> [--org <id>]",
				"x-mailset-cli-example": "mailset sending domains route news.example.com --url https://app.example.com/hooks/replies",
				"x-mailset-grant": "campaigns",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The sending domain, such as `news.example.com`.",
												"type": "string"
											},
											"url": {
												"type": "string",
												"minLength": 1,
												"maxLength": 500,
												"description": "Where every message to the domain is POSTed: an https URL on a public host name."
											}
										},
										"required": [
											"domain",
											"url"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"url": "https://app.example.com/hooks/replies",
									"domain": "news.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"domain": {
													"description": "The domain as it is now.",
													"$ref": "#/components/schemas/SendingDomain"
												},
												"secret": {
													"type": "string",
													"description": "The route’s signing secret, shown this once."
												}
											},
											"required": [
												"domain",
												"secret"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/sending.submit": {
			"post": {
				"operationId": "sending.submit",
				"summary": "Send one whole message from a sending domain, the way a reply goes",
				"description": "A campaigns key for the org. Or a person: an admin or owner of the org.",
				"tags": [
					"Sending domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/sending#sending.submit"
				},
				"x-mailset-cli": "mailset sending submit <domain> --ref <ref> --file <path> [--recipients <a,b,…>] [--org <id>]",
				"x-mailset-cli-example": "mailset sending submit news.example.com --ref ticket-4821 --file reply.eml",
				"x-mailset-grant": "campaigns",
				"x-mailset-role": "admin",
				"x-mailset-max-body-bytes": 28027563,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The sending domain the message goes from.",
												"type": "string"
											},
											"raw": {
												"type": "string",
												"minLength": 1,
												"maxLength": 27962035,
												"description": "The whole RFC 5322 message, base64, up to 20 MB. From is an address at the domain."
											},
											"ref": {
												"type": "string",
												"pattern": "^[A-Za-z0-9_-]{1,64}$",
												"description": "Your own id for the message: 1 to 64 letters, digits, - or _. It comes back on its events."
											},
											"recipients": {
												"description": "The envelope: who it goes to. Left out, everyone the message names in To, Cc and Bcc, each once whatever its case.",
												"minItems": 1,
												"maxItems": 50,
												"type": "array",
												"items": {
													"type": "string"
												}
											}
										},
										"required": [
											"domain",
											"raw",
											"ref"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"ref": "ticket-4821",
									"domain": "news.example.com",
									"name": "reply.eml",
									"raw": "<the message as base64>"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"results": {
													"type": "array",
													"items": {
														"anyOf": [
															{
																"type": "object",
																"properties": {
																	"address": {
																		"type": "string",
																		"description": "The envelope address."
																	},
																	"id": {
																		"type": "string",
																		"description": "Mailset’s id for this address’s copy. Its events carry it as `message`."
																	},
																	"state": {
																		"type": "string",
																		"const": "queued",
																		"description": "`queued`: it will go."
																	}
																},
																"required": [
																	"address",
																	"id",
																	"state"
																],
																"additionalProperties": false
															},
															{
																"type": "object",
																"properties": {
																	"address": {
																		"type": "string",
																		"description": "The envelope address."
																	},
																	"refused": {
																		"type": "string",
																		"enum": [
																			"suppressed",
																			"invalid",
																			"paused"
																		],
																		"description": "Why it wasn’t taken. `suppressed`: the address bounced or reported spam from this domain before. `invalid`: the message is wrong, or the address can’t or won’t get it. `paused`: the domain is paused or isn’t ready."
																	},
																	"reason": {
																		"type": "string",
																		"description": "The refusal, in words."
																	}
																},
																"required": [
																	"address",
																	"refused",
																	"reason"
																],
																"additionalProperties": false
															}
														]
													},
													"description": "One result per envelope address, in order."
												}
											},
											"required": [
												"results"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/sending.domains.resume": {
			"post": {
				"operationId": "sending.domains.resume",
				"summary": "Let a sending domain its brake paused send again, once you know why it was",
				"description": "An owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Sending domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/sending#sending.domains.resume"
				},
				"x-mailset-cli": "mailset sending domains resume <domain> [--org <id>]",
				"x-mailset-cli-example": "mailset sending domains resume news.example.com",
				"x-mailset-role": "owner",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The sending domain, such as `news.example.com`.",
												"type": "string"
											}
										},
										"required": [
											"domain"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"domain": "news.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/SendingDomain"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/sending.suppressions.list": {
			"post": {
				"operationId": "sending.suppressions.list",
				"summary": "The addresses a sending domain won’t write to",
				"description": "A campaigns key for the org. Or a person: an admin or owner of the org.",
				"tags": [
					"Sending domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/sending#sending.suppressions.list"
				},
				"x-mailset-cli": "mailset sending suppressions list <domain> [--cursor <cursor>] [--org <id>]",
				"x-mailset-cli-example": "mailset sending suppressions list news.example.com",
				"x-mailset-grant": "campaigns",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The sending domain, such as `news.example.com`.",
												"type": "string"
											},
											"cursor": {
												"description": "The `next` of the page before, for the page after it.",
												"type": "string",
												"maxLength": 400
											}
										},
										"required": [
											"domain"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"domain": "news.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"suppressions": {
													"type": "array",
													"items": {
														"$ref": "#/components/schemas/Suppression"
													},
													"description": "One page of the suppressed addresses."
												},
												"next": {
													"description": "Pass it as `cursor` for the next page. Null on the last one.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"suppressions",
												"next"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/sending.suppressions.remove": {
			"post": {
				"operationId": "sending.suppressions.remove",
				"summary": "Let a sending domain write to an address again",
				"description": "A campaigns key for the org. Or a person: an admin or owner of the org.",
				"tags": [
					"Sending domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/sending#sending.suppressions.remove"
				},
				"x-mailset-cli": "mailset sending suppressions remove <domain> --address <address> [--org <id>]",
				"x-mailset-cli-example": "mailset sending suppressions remove news.example.com --address maria@example.com",
				"x-mailset-grant": "campaigns",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The sending domain, such as `news.example.com`.",
												"type": "string"
											},
											"address": {
												"description": "The address the domain may write to again.",
												"type": "string"
											}
										},
										"required": [
											"domain",
											"address"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"address": "maria@example.com",
									"domain": "news.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean",
													"description": "True when the address was suppressed."
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/campaigns.submit": {
			"post": {
				"operationId": "campaigns.submit",
				"summary": "Queue up to 100 whole messages from a sending domain, each for one recipient",
				"description": "A campaigns key for the org. Or a person: an admin or owner of the org.",
				"tags": [
					"Campaigns"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/campaigns#campaigns.submit"
				},
				"x-mailset-cli": "mailset campaigns submit --domain <domain> --messages <json> [--org <id>]",
				"x-mailset-cli-example": "mailset campaigns submit --domain news.example.com --messages @campaign.json",
				"x-mailset-grant": "campaigns",
				"x-mailset-role": "admin",
				"x-mailset-max-body-bytes": 67108864,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"domain": {
												"description": "The sending domain the messages go from.",
												"type": "string"
											},
											"messages": {
												"minItems": 1,
												"maxItems": 100,
												"type": "array",
												"items": {
													"type": "object",
													"properties": {
														"raw": {
															"type": "string",
															"minLength": 1,
															"maxLength": 1398110,
															"description": "The whole RFC 5322 message, base64, rendered for this one recipient. Up to 1 MB before base64."
														},
														"campaign": {
															"type": "string",
															"pattern": "^[A-Za-z0-9_-]{1,64}$",
															"description": "Your own id for the campaign: 1 to 64 letters, digits, - or _. It comes back on every event."
														},
														"recipient": {
															"type": "string",
															"pattern": "^[A-Za-z0-9_-]{1,64}$",
															"description": "Your own id for the recipient, in the same form. It comes back on every event."
														},
														"track": {
															"type": "object",
															"properties": {
																"opens": {
																	"type": "boolean",
																	"description": "Count when it’s opened."
																},
																"clicks": {
																	"type": "boolean",
																	"description": "Count clicks on its links."
																}
															},
															"required": [
																"opens",
																"clicks"
															],
															"description": "What to track on this message. Only a domain with a tracking domain can track."
														}
													},
													"required": [
														"raw",
														"campaign",
														"recipient",
														"track"
													]
												},
												"description": "The messages, 1 to 100, each for one recipient."
											}
										},
										"required": [
											"domain",
											"messages"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"domain": "news.example.com",
									"messages": [
										{
											"raw": "<the message as base64>",
											"campaign": "spring-sale",
											"recipient": "user_4821",
											"track": {
												"opens": true,
												"clicks": true
											}
										}
									]
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"results": {
													"type": "array",
													"items": {
														"anyOf": [
															{
																"type": "object",
																"properties": {
																	"recipient": {
																		"type": "string",
																		"description": "Your id for the recipient, as given."
																	},
																	"id": {
																		"type": "string",
																		"description": "Mailset’s id for the message. Its events carry it as `message`."
																	},
																	"state": {
																		"type": "string",
																		"const": "queued",
																		"description": "`queued`: it will go."
																	}
																},
																"required": [
																	"recipient",
																	"id",
																	"state"
																],
																"additionalProperties": false
															},
															{
																"type": "object",
																"properties": {
																	"recipient": {
																		"type": "string",
																		"description": "Your id for the recipient, as given."
																	},
																	"refused": {
																		"type": "string",
																		"enum": [
																			"suppressed",
																			"invalid",
																			"paused"
																		],
																		"description": "Why it wasn’t taken. `suppressed`: the address bounced or reported spam from this domain before. `invalid`: the message is wrong, or the address can’t or won’t get it. `paused`: the domain is paused or isn’t ready."
																	},
																	"reason": {
																		"type": "string",
																		"description": "The refusal, in words."
																	}
																},
																"required": [
																	"recipient",
																	"refused",
																	"reason"
																],
																"additionalProperties": false
															}
														]
													},
													"description": "One result per message, in the order they came."
												}
											},
											"required": [
												"results"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/campaigns.hook.set": {
			"post": {
				"operationId": "campaigns.hook.set",
				"summary": "Where events go",
				"description": "A campaigns key for the org. Or a person: an admin or owner of the org.",
				"tags": [
					"Campaigns"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/campaigns#campaigns.hook.set"
				},
				"x-mailset-cli": "mailset campaigns hook set --url <url> [--org <id>]",
				"x-mailset-cli-example": "mailset campaigns hook set --url https://app.example.com/hooks/campaigns",
				"x-mailset-grant": "campaigns",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"url": {
												"type": "string",
												"minLength": 1,
												"maxLength": 500,
												"description": "Where events are POSTed: an https URL on a public host name."
											}
										},
										"required": [
											"url"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"url": "https://app.example.com/hooks/campaigns"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"secret": {
													"type": "string",
													"description": "The hook’s signing secret, shown this once."
												}
											},
											"required": [
												"secret"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/campaigns.hook.rotate": {
			"post": {
				"operationId": "campaigns.hook.rotate",
				"summary": "A new signing secret for the hook; the old one stops",
				"description": "A campaigns key for the org. Or a person: an admin or owner of the org.",
				"tags": [
					"Campaigns"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/campaigns#campaigns.hook.rotate"
				},
				"x-mailset-cli": "mailset campaigns hook rotate [--org <id>]",
				"x-mailset-cli-example": "mailset campaigns hook rotate",
				"x-mailset-grant": "campaigns",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"secret": {
													"type": "string",
													"description": "The hook’s signing secret, shown this once."
												}
											},
											"required": [
												"secret"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/hooks.get": {
			"post": {
				"operationId": "hooks.get",
				"summary": "Show where your products’ mail events go, and what waits for the hook",
				"description": "An admin or owner of the org.",
				"tags": [
					"Event hook"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/hooks#hooks.get"
				},
				"x-mailset-cli": "mailset hooks get [--org <id>]",
				"x-mailset-cli-example": "mailset hooks get",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"hook": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"url": {
																	"type": "string",
																	"description": "Where events go."
																},
																"setAt": {
																	"type": "number",
																	"description": "When the hook was set, in milliseconds since 1970."
																},
																"waiting": {
																	"type": "number",
																	"description": "Events still to hand over."
																},
																"lastError": {
																	"description": "Why the oldest waiting batch hasn’t gone, when one failed.",
																	"type": [
																		"string",
																		"null"
																	]
																}
															},
															"required": [
																"url",
																"setAt",
																"waiting",
																"lastError"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													],
													"description": "The org’s hook, or null when it has none."
												}
											},
											"required": [
												"hook"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/hooks.set": {
			"post": {
				"operationId": "hooks.set",
				"summary": "Send events for your products’ mail to a webhook",
				"description": "An admin or owner of the org.",
				"tags": [
					"Event hook"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/hooks#hooks.set"
				},
				"x-mailset-cli": "mailset hooks set --url <url> [--org <id>]",
				"x-mailset-cli-example": "mailset hooks set --url https://app.example.com/hooks/mailset",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"url": {
												"type": "string",
												"minLength": 1,
												"maxLength": 500,
												"description": "Where Mailset posts the events: https, port 443, on a public host name."
											}
										},
										"required": [
											"url"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"url": "https://app.example.com/hooks/mailset"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"secret": {
													"type": "string",
													"description": "The signing secret, shown this once. Each post’s `Mailset-Signature` is made with it."
												}
											},
											"required": [
												"secret"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/hooks.rotate": {
			"post": {
				"operationId": "hooks.rotate",
				"summary": "A new signing secret for the products’ hook; the old one stops",
				"description": "An admin or owner of the org.",
				"tags": [
					"Event hook"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/hooks#hooks.rotate"
				},
				"x-mailset-cli": "mailset hooks rotate [--org <id>]",
				"x-mailset-cli-example": "mailset hooks rotate",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"secret": {
													"type": "string",
													"description": "The signing secret, shown this once. Each post’s `Mailset-Signature` is made with it."
												}
											},
											"required": [
												"secret"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/hooks.remove": {
			"post": {
				"operationId": "hooks.remove",
				"summary": "Stop sending product mail events; what was waiting is dropped",
				"description": "An admin or owner of the org.",
				"tags": [
					"Event hook"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/hooks#hooks.remove"
				},
				"x-mailset-cli": "mailset hooks remove [--org <id>]",
				"x-mailset-cli-example": "mailset hooks remove",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean",
													"description": "True when there was a hook to remove."
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/hooks.test": {
			"post": {
				"operationId": "hooks.test",
				"summary": "Post one signed test event to the products’ hook now",
				"description": "An admin or owner of the org.",
				"tags": [
					"Event hook"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/hooks#hooks.test"
				},
				"x-mailset-cli": "mailset hooks test [--org <id>]",
				"x-mailset-cli-example": "mailset hooks test",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"url": {
													"type": "string",
													"description": "Where the test event was posted."
												},
												"took": {
													"type": "boolean",
													"description": "Whether the hook answered 2xx."
												},
												"status": {
													"description": "The hook’s HTTP status, or null when it couldn’t be reached.",
													"type": [
														"number",
														"null"
													]
												},
												"error": {
													"description": "Why the post wasn’t taken, in a few words, or null.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"url",
												"took",
												"status",
												"error"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/unsubscribes.list": {
			"post": {
				"operationId": "unsubscribes.list",
				"summary": "Who unsubscribed from a mailbox’s (or a domain key’s domain’s) promotional mail, newest first",
				"description": "An app key that may send as the mailbox, or as the addresses it names on the domain. Or a person: an admin or owner of the org.",
				"tags": [
					"Unsubscribes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/unsubscribes#unsubscribes.list"
				},
				"x-mailset-cli": "mailset unsubscribes list <mailbox> [--cursor <cursor>] [--org <id>]",
				"x-mailset-cli-example": "mailset unsubscribes list news@news.example.com",
				"x-mailset-grant": "send",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "The mailbox whose promotional mail they unsubscribed from, by its address. For a domain key’s mail, its sending domain, such as `example.com`.",
												"type": "string"
											},
											"cursor": {
												"description": "The `next` of the page before, for the page after it.",
												"type": "string",
												"maxLength": 600
											}
										},
										"required": [
											"mailbox"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "news@news.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"unsubscribes": {
													"type": "array",
													"items": {
														"$ref": "#/components/schemas/Unsubscribe"
													},
													"description": "Up to 100 opt-outs, newest first."
												},
												"next": {
													"description": "Pass back as `cursor` for the next page. Null on the last one.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"unsubscribes",
												"next"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/unsubscribes.remove": {
			"post": {
				"operationId": "unsubscribes.remove",
				"summary": "Let a mailbox’s (or a domain key’s domain’s) promotional mail reach an address again, once they ask for it",
				"description": "An app key that may send as the mailbox, or as the addresses it names on the domain. Or a person: an admin or owner of the org.",
				"tags": [
					"Unsubscribes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/unsubscribes#unsubscribes.remove"
				},
				"x-mailset-cli": "mailset unsubscribes remove <mailbox> --address <address> [--org <id>]",
				"x-mailset-cli-example": "mailset unsubscribes remove news@news.example.com --address ana@example.org",
				"x-mailset-grant": "send",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "The mailbox they unsubscribed from, by its address. For a domain key’s mail, its sending domain, such as `example.com`.",
												"type": "string"
											},
											"address": {
												"description": "The address that asked for its promotional mail again.",
												"type": "string"
											}
										},
										"required": [
											"mailbox",
											"address"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"address": "ana@example.org",
									"mailbox": "news@news.example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean",
													"description": "True when the address had unsubscribed and now gets this mailbox’s promotional mail again. False when it hadn’t."
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/sending.status": {
			"post": {
				"operationId": "sending.status",
				"summary": "Show your org’s sending limits, and whether it is paused",
				"description": "Anyone in the org.",
				"tags": [
					"Sending domains"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/sending#sending.status"
				},
				"x-mailset-cli": "mailset sending status [--org <id>]",
				"x-mailset-cli-example": "mailset sending status",
				"x-mailset-role": "member",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"tier": {
													"type": "string",
													"enum": [
														"no_card",
														"trial",
														"paid"
													],
													"description": "How far the org may send: `no_card` (only to its own domains), `trial` or `paid`. `limits` has the numbers."
												},
												"limits": {
													"type": "object",
													"properties": {
														"externalPerDay": {
															"description": "Recipients outside the org, per 24 hours. Null: no limit.",
															"type": [
																"number",
																"null"
															]
														},
														"externalTotal": {
															"description": "Recipients outside the org, ever. Null: no limit.",
															"type": [
																"number",
																"null"
															]
														},
														"perMinute": {
															"description": "Recipients per minute. Null: no limit.",
															"type": [
																"number",
																"null"
															]
														},
														"perMessage": {
															"type": "number",
															"description": "Recipients in one message, at most."
														}
													},
													"required": [
														"externalPerDay",
														"externalTotal",
														"perMinute",
														"perMessage"
													],
													"additionalProperties": false,
													"description": "The limits its tier sets."
												},
												"externalToday": {
													"type": "number",
													"description": "Recipients outside the org in the last 24 hours."
												},
												"externalTotal": {
													"type": "number",
													"description": "Recipients outside the org, ever."
												},
												"campaignsPerDay": {
													"description": "What its campaigns may send outside the org in 24 hours: the day’s cap less the room kept for people’s mail. Null: no cap.",
													"type": [
														"number",
														"null"
													]
												},
												"campaignsToday": {
													"type": "number",
													"description": "Campaign recipients outside the org in the last 24 hours, counted in `externalToday` too."
												},
												"paused": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"reason": {
																	"type": "string",
																	"description": "Why it was paused, in words."
																},
																"at": {
																	"type": "number",
																	"description": "When it was paused, in ms since the epoch."
																}
															},
															"required": [
																"reason",
																"at"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													],
													"description": "Set when this org’s mail is stopped. Only Mailset support ends it."
												},
												"held": {
													"description": "Set while Mailset is holding mail from new and smaller accounts for now, to protect delivery for everyone.",
													"type": [
														"string",
														"null"
													]
												},
												"pausedMailboxes": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"address": {
																"type": "string",
																"description": "The mailbox’s address."
															},
															"reason": {
																"type": "string",
																"description": "Why its brake stopped it, in words."
															},
															"at": {
																"type": "number",
																"description": "When it was paused, in ms since the epoch."
															}
														},
														"required": [
															"address",
															"reason",
															"at"
														],
														"additionalProperties": false
													},
													"description": "Mailboxes whose own brake stopped the mail people write from them. An owner or admin resumes each with `mailboxes resume`."
												}
											},
											"required": [
												"tier",
												"limits",
												"externalToday",
												"externalTotal",
												"campaignsPerDay",
												"campaignsToday",
												"paused",
												"held",
												"pausedMailboxes"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/billing.status": {
			"post": {
				"operationId": "billing.status",
				"summary": "Your org’s plan, members, Mailset AI, the balance and this month’s use",
				"description": "An admin or owner of the org.",
				"tags": [
					"Billing"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing.status"
				},
				"x-mailset-cli": "mailset billing status [--org <id>]",
				"x-mailset-cli-example": "mailset billing status",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Billing"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/billing.usage": {
			"post": {
				"operationId": "billing.usage",
				"summary": "This month’s outside email, storage and AI against the plan, and what went past it",
				"description": "An admin or owner of the org.",
				"tags": [
					"Billing"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing.usage"
				},
				"x-mailset-cli": "mailset billing usage [--org <id>]",
				"x-mailset-cli-example": "mailset billing usage",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"usage": {
													"type": "object",
													"properties": {
														"periodStart": {
															"type": "number",
															"description": "The calendar month in UTC: its first instant and the next month’s."
														},
														"periodEnd": {
															"type": "number"
														},
														"ai": {
															"type": "object",
															"properties": {
																"priceMicros": {
																	"type": "number",
																	"description": "Mailset’s AI this month at its price list."
																},
																"creditMicros": {
																	"description": "The month’s AI credit. Null: none limits it (no prices here, or Mailset’s own org).",
																	"type": [
																		"number",
																		"null"
																	]
																},
																"overMicros": {
																	"type": "number"
																}
															},
															"required": [
																"priceMicros",
																"creditMicros",
																"overMicros"
															],
															"additionalProperties": false
														},
														"storage": {
															"type": "object",
															"properties": {
																"bytes": {
																	"type": "number",
																	"description": "The latest daily count."
																},
																"includedBytes": {
																	"description": "Null: no prices here, so nothing is included or over.",
																	"type": [
																		"number",
																		"null"
																	]
																},
																"overGbMonths": {
																	"type": "number",
																	"description": "GB-months past what’s included, so far this month."
																}
															},
															"required": [
																"bytes",
																"includedBytes",
																"overGbMonths"
															],
															"additionalProperties": false
														},
														"emails": {
															"type": "object",
															"properties": {
																"outside": {
																	"type": "number",
																	"description": "Recipients outside the org’s own domains this month. Incoming and internal mail never count."
																},
																"allowance": {
																	"type": [
																		"number",
																		"null"
																	]
																},
																"over": {
																	"type": "number"
																}
															},
															"required": [
																"outside",
																"allowance",
																"over"
															],
															"additionalProperties": false
														},
														"owedMicros": {
															"type": "number",
															"description": "What this month’s use past the allowances costs so far: drawn, and not yet."
														},
														"billed": {
															"type": "boolean",
															"description": "Pay as you go draws it from the balance."
														}
													},
													"required": [
														"periodStart",
														"periodEnd",
														"ai",
														"storage",
														"emails",
														"owedMicros",
														"billed"
													],
													"additionalProperties": false
												},
												"prices": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"currency": {
																	"type": "string"
																},
																"baseMonthlyCents": {
																	"type": "number"
																},
																"baseYearlyCents": {
																	"type": "number"
																},
																"teamMonthlyCents": {
																	"type": "number"
																},
																"teamYearlyCents": {
																	"type": "number"
																},
																"baseMembers": {
																	"type": "number",
																	"description": "Members (people who sign in) each plan includes. Mailboxes are unlimited."
																},
																"teamMembers": {
																	"type": "number"
																},
																"trialMembers": {
																	"type": "number"
																},
																"baseSeatMonthlyCents": {
																	"type": "number",
																	"description": "Each member past them: a seat on the subscription."
																},
																"baseSeatYearlyCents": {
																	"type": "number"
																},
																"teamSeatMonthlyCents": {
																	"type": "number"
																},
																"teamSeatYearlyCents": {
																	"type": "number"
																},
																"storageGb": {
																	"type": "number",
																	"description": "Every plan’s monthly allowances."
																},
																"emailAllowance": {
																	"type": "number"
																},
																"aiCreditCents": {
																	"type": "number"
																},
																"emailsPer1000Cents": {
																	"type": "number",
																	"description": "What draws from the balance past them."
																},
																"storageGbMonthCents": {
																	"type": "number"
																},
																"topupMinCents": {
																	"type": "number",
																	"description": "Top-ups: the least one can be, and the defaults an owner can change."
																},
																"topupThresholdCents": {
																	"type": "number"
																},
																"topupAmountCents": {
																	"type": "number"
																},
																"topupCeilingCents": {
																	"type": "number"
																},
																"overdraftCents": {
																	"type": "number",
																	"description": "How far storage may take the balance below zero before it stops drawing."
																},
																"creditMonths": {
																	"type": "number",
																	"description": "How long a credit lasts."
																},
																"endedReceiveDays": {
																	"type": "number",
																	"description": "After a plan ends unpaid: new mail to the org is refused from this many days on, and its mail and files are deleted at the second."
																},
																"endedDeleteDays": {
																	"type": "number"
																}
															},
															"required": [
																"currency",
																"baseMonthlyCents",
																"baseYearlyCents",
																"teamMonthlyCents",
																"teamYearlyCents",
																"baseMembers",
																"teamMembers",
																"trialMembers",
																"baseSeatMonthlyCents",
																"baseSeatYearlyCents",
																"teamSeatMonthlyCents",
																"teamSeatYearlyCents",
																"storageGb",
																"emailAllowance",
																"aiCreditCents",
																"emailsPer1000Cents",
																"storageGbMonthCents",
																"topupMinCents",
																"topupThresholdCents",
																"topupAmountCents",
																"topupCeilingCents",
																"overdraftCents",
																"creditMonths",
																"endedReceiveDays",
																"endedDeleteDays"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													]
												}
											},
											"required": [
												"usage",
												"prices"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/billing.upgrade": {
			"post": {
				"operationId": "billing.upgrade",
				"summary": "Open Stripe Checkout for a plan",
				"description": "An owner of the org.",
				"tags": [
					"Billing"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing.upgrade"
				},
				"x-mailset-cli": "mailset billing upgrade [--plan base|team] [--yearly] [--org <id>]",
				"x-mailset-cli-example": "mailset billing upgrade --plan base --yearly",
				"x-mailset-role": "owner",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"plan": {
												"default": "base",
												"description": "The plan: `base` or `team`.",
												"type": "string",
												"enum": [
													"base",
													"team"
												]
											},
											"yearly": {
												"default": false,
												"description": "Base only: billed once a year.",
												"type": "boolean"
											}
										}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"plan": "base",
									"yearly": true
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"url": {
													"type": "string",
													"description": "The checkout page’s link, to open in a browser."
												}
											},
											"required": [
												"url"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/billing.portal": {
			"post": {
				"operationId": "billing.portal",
				"summary": "Owners",
				"description": "An owner of the org.",
				"tags": [
					"Billing"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing.portal"
				},
				"x-mailset-cli": "mailset billing portal [--card] [--org <id>]",
				"x-mailset-cli-example": "mailset billing portal --card",
				"x-mailset-role": "owner",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"card": {
												"description": "Go straight to changing the card.",
												"type": "boolean"
											}
										}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"card": true
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"url": {
													"type": "string",
													"description": "The billing portal’s link, to open in a browser."
												}
											},
											"required": [
												"url"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/billing.switch": {
			"post": {
				"operationId": "billing.switch",
				"summary": "Move a paying org to another plan, seats and all",
				"description": "An owner of the org.",
				"tags": [
					"Billing"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing.switch"
				},
				"x-mailset-cli": "mailset billing switch [<plan>] [--yearly] [--org <id>]",
				"x-mailset-cli-example": "mailset billing switch team",
				"x-mailset-role": "owner",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"plan": {
												"default": "base",
												"description": "The plan: `base` or `team`.",
												"type": "string",
												"enum": [
													"base",
													"team"
												]
											},
											"yearly": {
												"default": false,
												"description": "Base only: billed once a year.",
												"type": "boolean"
											}
										}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"plan": "team"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Billing"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/billing.cancel": {
			"post": {
				"operationId": "billing.cancel",
				"summary": "End the plan when its paid period ends, saying why",
				"description": "An owner of the org.",
				"tags": [
					"Billing"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing.cancel"
				},
				"x-mailset-cli": "mailset billing cancel <reason> [--comment <comment>] [--org <id>]",
				"x-mailset-cli-example": "mailset billing cancel too_expensive --comment \"We only need two mailboxes\"",
				"x-mailset-role": "owner",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"reason": {
												"type": "string",
												"enum": [
													"too_expensive",
													"missing_features",
													"switched_service",
													"unused",
													"customer_service",
													"too_complex",
													"low_quality",
													"other"
												],
												"description": "Why the plan is ending, one of the listed reasons."
											},
											"comment": {
												"description": "Anything to add, up to 1,000 characters.",
												"type": "string",
												"maxLength": 1000
											}
										},
										"required": [
											"reason"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"comment": "We only need two mailboxes",
									"reason": "too_expensive"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Billing"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/billing.resume": {
			"post": {
				"operationId": "billing.resume",
				"summary": "Keep a plan that was set to end, so it renews again",
				"description": "An owner of the org.",
				"tags": [
					"Billing"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing.resume"
				},
				"x-mailset-cli": "mailset billing resume [--org <id>]",
				"x-mailset-cli-example": "mailset billing resume",
				"x-mailset-role": "owner",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Billing"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/billing.payg": {
			"post": {
				"operationId": "billing.payg",
				"summary": "Turn pay as you go on or off: on|off (with no card yet, it prints the first top-up’s link)",
				"description": "An owner of the org.",
				"tags": [
					"Billing"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing.payg"
				},
				"x-mailset-cli": "mailset billing payg <state> [--org <id>]",
				"x-mailset-cli-example": "mailset billing payg on",
				"x-mailset-role": "owner",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"state": {
												"type": "string",
												"enum": [
													"on",
													"off"
												],
												"description": "`on` or `off`."
											}
										},
										"required": [
											"state"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"state": "on"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"billing": {
													"description": "The org’s billing as it is now.",
													"$ref": "#/components/schemas/Billing"
												},
												"url": {
													"description": "With no card saved yet: the first top-up’s checkout link. Null otherwise.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"billing",
												"url"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/billing.balance": {
			"post": {
				"operationId": "billing.balance",
				"summary": "The prepaid balance, what’s pending, and auto top-up",
				"description": "An admin or owner of the org.",
				"tags": [
					"Billing"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing.balance"
				},
				"x-mailset-cli": "mailset billing balance [--org <id>]",
				"x-mailset-cli-example": "mailset billing balance",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Billing"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/billing.topup": {
			"post": {
				"operationId": "billing.topup",
				"summary": "Add credit to the balance through Stripe Checkout",
				"description": "An owner of the org.",
				"tags": [
					"Billing"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing.topup"
				},
				"x-mailset-cli": "mailset billing topup <amount> [--org <id>]",
				"x-mailset-cli-example": "mailset billing topup 20",
				"x-mailset-role": "owner",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"amount": {
												"type": "integer",
												"minimum": 1,
												"maximum": 100000,
												"description": "How much credit to add, in whole units of the plan’s currency."
											}
										},
										"required": [
											"amount"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"amount": "20"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"url": {
													"type": "string",
													"description": "The checkout page’s link, to open in a browser."
												}
											},
											"required": [
												"url"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/billing.autotopup": {
			"post": {
				"operationId": "billing.autotopup",
				"summary": "Auto top-up",
				"description": "An owner of the org.",
				"tags": [
					"Billing"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing.autotopup"
				},
				"x-mailset-cli": "mailset billing autotopup [<state>] [--threshold <n>] [--amount <n>] [--ceiling <n>] [--org <id>]",
				"x-mailset-cli-example": "mailset billing autotopup on --threshold 5 --amount 20 --ceiling 100",
				"x-mailset-role": "owner",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"state": {
												"description": "`on` or `off`. Left out: as it is.",
												"type": "string",
												"enum": [
													"on",
													"off"
												]
											},
											"threshold": {
												"description": "Top up when the balance falls below this, in whole units.",
												"type": "integer",
												"minimum": 1,
												"maximum": 100000
											},
											"amount": {
												"description": "How much each top-up adds, in whole units.",
												"type": "integer",
												"minimum": 1,
												"maximum": 100000
											},
											"ceiling": {
												"description": "The most auto top-ups may charge in a calendar month, in whole units.",
												"type": "integer",
												"minimum": 1,
												"maximum": 100000
											}
										}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"threshold": "5",
									"amount": "20",
									"ceiling": "100",
									"state": "on"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Billing"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/billing.ledger": {
			"post": {
				"operationId": "billing.ledger",
				"summary": "The balance’s credits and debits, newest first",
				"description": "An admin or owner of the org.",
				"tags": [
					"Billing"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing.ledger"
				},
				"x-mailset-cli": "mailset billing ledger [--limit <n>] [--org <id>]",
				"x-mailset-cli-example": "mailset billing ledger --limit 20",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"limit": {
												"default": 50,
												"description": "How many lines to return, 1 to 500.",
												"type": "integer",
												"minimum": 1,
												"maximum": 500
											}
										}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"limit": 20
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string"
													},
													"at": {
														"type": "number"
													},
													"kind": {
														"type": "string",
														"enum": [
															"topup",
															"auto_topup",
															"ai",
															"storage",
															"emails",
															"expiry"
														]
													},
													"micros": {
														"type": "number"
													},
													"reason": {
														"type": "string"
													},
													"ref": {
														"type": "string",
														"description": "The usage or payment it’s for: `ai:<day>`, `storage:<day>`, `emails:<day>`, or a payment’s id."
													},
													"expiresAt": {
														"description": "A credit’s end.",
														"type": [
															"number",
															"null"
														]
													},
													"receipt": {
														"default": null,
														"description": "A link to a payment’s invoice PDF or receipt page, once the receipt went.",
														"type": [
															"string",
															"null"
														]
													}
												},
												"required": [
													"id",
													"at",
													"kind",
													"micros",
													"reason",
													"ref",
													"expiresAt",
													"receipt"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/mailboxes.list": {
			"post": {
				"operationId": "mailboxes.list",
				"summary": "List the mailboxes you can open",
				"description": "An app key with `read` on the mailbox. Or a person: any signed-in person, with an API token.",
				"tags": [
					"Mailboxes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/mailboxes#mailboxes.list"
				},
				"x-mailset-cli": "mailset mailboxes list",
				"x-mailset-cli-example": "mailset mailboxes list",
				"x-mailset-grant": "read",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Mailbox"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/mailboxes.add": {
			"post": {
				"operationId": "mailboxes.add",
				"summary": "Add a mailbox on one of your domains",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Mailboxes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/mailboxes#mailboxes.add"
				},
				"x-mailset-cli": "mailset mailboxes add <address> [--kind person|shared] [--members <a,b,…>] [--org <id>]",
				"x-mailset-cli-example": "mailset mailboxes add support@example.com --kind shared --members ana@example.com,ben@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The new mailbox’s address, on one of the org’s domains.",
												"type": "string"
											},
											"kind": {
												"default": "person",
												"description": "`person` for one person’s mail, `shared` for a team’s.",
												"type": "string",
												"enum": [
													"person",
													"shared"
												]
											},
											"members": {
												"default": [],
												"description": "Who can open it. Empty means you.",
												"type": "array",
												"items": {
													"type": "string"
												}
											}
										},
										"required": [
											"address"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"kind": "shared",
									"members": [
										"ana@example.com",
										"ben@example.com"
									],
									"address": "support@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string",
													"description": "The mailbox’s id."
												},
												"address": {
													"type": "string",
													"description": "Its address."
												}
											},
											"required": [
												"id",
												"address"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/mailboxes.grant": {
			"post": {
				"operationId": "mailboxes.grant",
				"summary": "Give someone in the org access to a mailbox",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Mailboxes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/mailboxes#mailboxes.grant"
				},
				"x-mailset-cli": "mailset mailboxes grant <address> --member <member> [--org <id>]",
				"x-mailset-cli-example": "mailset mailboxes grant support@example.com --member ben@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The mailbox’s address.",
												"type": "string"
											},
											"member": {
												"description": "The member’s address.",
												"type": "string"
											}
										},
										"required": [
											"address",
											"member"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"member": "ben@example.com",
									"address": "support@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"address": {
													"type": "string",
													"description": "The mailbox’s address."
												},
												"members": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Everyone who can open it now, by address."
												}
											},
											"required": [
												"address",
												"members"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/mailboxes.revoke": {
			"post": {
				"operationId": "mailboxes.revoke",
				"summary": "Take someone out of a mailbox",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Mailboxes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/mailboxes#mailboxes.revoke"
				},
				"x-mailset-cli": "mailset mailboxes revoke <address> --member <member> [--org <id>]",
				"x-mailset-cli-example": "mailset mailboxes revoke support@example.com --member ben@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The mailbox’s address.",
												"type": "string"
											},
											"member": {
												"description": "The member’s address.",
												"type": "string"
											}
										},
										"required": [
											"address",
											"member"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"member": "ben@example.com",
									"address": "support@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"address": {
													"type": "string",
													"description": "The mailbox’s address."
												},
												"members": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Everyone who can open it now, by address."
												}
											},
											"required": [
												"address",
												"members"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/mailboxes.all": {
			"post": {
				"operationId": "mailboxes.all",
				"summary": "List every mailbox in the org, and who holds each",
				"description": "An admin or owner of the org.",
				"tags": [
					"Mailboxes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/mailboxes#mailboxes.all"
				},
				"x-mailset-cli": "mailset mailboxes all [--org <id>]",
				"x-mailset-cli-example": "mailset mailboxes all",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string"
													},
													"address": {
														"type": "string"
													},
													"kind": {
														"type": "string",
														"enum": [
															"person",
															"shared"
														]
													},
													"people": {
														"type": "array",
														"items": {
															"type": "object",
															"properties": {
																"email": {
																	"type": "string"
																},
																"access": {
																	"type": "string",
																	"enum": [
																		"owner",
																		"delegate"
																	]
																},
																"deactivated": {
																	"type": "boolean"
																}
															},
															"required": [
																"email",
																"access",
																"deactivated"
															],
															"additionalProperties": false
														}
													},
													"aliases": {
														"type": "array",
														"items": {
															"type": "string"
														}
													},
													"receiving": {
														"type": "boolean",
														"description": "False: mail to it is refused."
													},
													"paused": {
														"anyOf": [
															{
																"type": "object",
																"properties": {
																	"reason": {
																		"type": "string",
																		"description": "Why it was paused, in words."
																	},
																	"at": {
																		"type": "number",
																		"description": "When it was paused, in ms since the epoch."
																	}
																},
																"required": [
																	"reason",
																	"at"
																],
																"additionalProperties": false
															},
															{
																"type": "null"
															}
														],
														"description": "Set when its brake stopped the mail people write from it. An owner or admin ends it with `mailboxes.resume`."
													}
												},
												"required": [
													"id",
													"address",
													"kind",
													"people",
													"aliases",
													"receiving",
													"paused"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/mailboxes.deletePlan": {
			"post": {
				"operationId": "mailboxes.deletePlan",
				"summary": "Show exactly what deleting a mailbox would destroy",
				"description": "An admin or owner of the org.",
				"tags": [
					"Mailboxes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/mailboxes#mailboxes.deletePlan"
				},
				"x-mailset-cli": "mailset mailboxes deletePlan <address> [--org <id>]",
				"x-mailset-cli-example": "mailset mailboxes deletePlan old@example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The mailbox’s address.",
												"type": "string"
											}
										},
										"required": [
											"address"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"address": "old@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"address": {
													"type": "string"
												},
												"kind": {
													"type": "string",
													"enum": [
														"person",
														"shared"
													]
												},
												"people": {
													"type": "array",
													"items": {
														"type": "string"
													}
												},
												"conversations": {
													"type": "number"
												},
												"messages": {
													"type": "number"
												},
												"attachments": {
													"type": "number"
												},
												"drafts": {
													"type": "number"
												},
												"scheduled": {
													"type": "number"
												},
												"aliases": {
													"type": "array",
													"items": {
														"type": "string"
													}
												},
												"groups": {
													"type": "array",
													"items": {
														"type": "string"
													}
												},
												"objects": {
													"type": "number",
													"description": "Stored files that go with it."
												},
												"bytes": {
													"type": "number"
												}
											},
											"required": [
												"address",
												"kind",
												"people",
												"conversations",
												"messages",
												"attachments",
												"drafts",
												"scheduled",
												"aliases",
												"groups",
												"objects",
												"bytes"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/mailboxes.delete": {
			"post": {
				"operationId": "mailboxes.delete",
				"summary": "Delete a mailbox and all its mail for good",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Mailboxes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/mailboxes#mailboxes.delete"
				},
				"x-mailset-cli": "mailset mailboxes delete <address> [--org <id>]",
				"x-mailset-cli-example": "mailset mailboxes delete old@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The mailbox’s address.",
												"type": "string"
											}
										},
										"required": [
											"address"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"address": "old@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"deleted": {
													"type": "boolean",
													"const": true,
													"description": "Always true: the mailbox is gone."
												},
												"objects": {
													"type": "number",
													"description": "How many stored files went with it."
												}
											},
											"required": [
												"deleted",
												"objects"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/mailboxes.receiving": {
			"post": {
				"operationId": "mailboxes.receiving",
				"summary": "Accept or refuse new mail to a mailbox",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Mailboxes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/mailboxes#mailboxes.receiving"
				},
				"x-mailset-cli": "mailset mailboxes receiving <address> --receiving [--org <id>]",
				"x-mailset-cli-example": "mailset mailboxes receiving old@example.com --receiving false",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The mailbox’s address.",
												"type": "string"
											},
											"receiving": {
												"type": "boolean",
												"description": "True to accept new mail, false to refuse it."
											}
										},
										"required": [
											"address",
											"receiving"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"receiving": false,
									"address": "old@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"address": {
													"type": "string",
													"description": "The mailbox’s address."
												},
												"receiving": {
													"type": "boolean",
													"description": "Whether it accepts new mail now."
												}
											},
											"required": [
												"address",
												"receiving"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/mailboxes.resume": {
			"post": {
				"operationId": "mailboxes.resume",
				"summary": "Let a mailbox its brake paused send again, once you know why it was",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Mailboxes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/mailboxes#mailboxes.resume"
				},
				"x-mailset-cli": "mailset mailboxes resume <address> [--org <id>]",
				"x-mailset-cli-example": "mailset mailboxes resume ana@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The mailbox’s address.",
												"type": "string"
											}
										},
										"required": [
											"address"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"address": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"address": {
													"type": "string",
													"description": "The mailbox’s address."
												},
												"resumed": {
													"type": "boolean",
													"description": "True when it was paused and may send again."
												}
											},
											"required": [
												"address",
												"resumed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/mailboxes.reassign": {
			"post": {
				"operationId": "mailboxes.reassign",
				"summary": "Give a mailbox to one person. Everyone else loses it",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Mailboxes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/mailboxes#mailboxes.reassign"
				},
				"x-mailset-cli": "mailset mailboxes reassign <address> --to <to> [--org <id>]",
				"x-mailset-cli-example": "mailset mailboxes reassign ben@example.com --to ana@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The mailbox’s address.",
												"type": "string"
											},
											"to": {
												"description": "The member who gets it, by address.",
												"type": "string"
											}
										},
										"required": [
											"address",
											"to"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"to": "ana@example.com",
									"address": "ben@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"address": {
													"type": "string",
													"description": "The mailbox’s address."
												},
												"members": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Everyone who can open it now: the one person."
												}
											},
											"required": [
												"address",
												"members"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/delegates.list": {
			"post": {
				"operationId": "delegates.list",
				"summary": "Show who can use a mailbox you hold",
				"description": "Anyone in the org.",
				"tags": [
					"Delegates"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/delegates#delegates.list"
				},
				"x-mailset-cli": "mailset delegates list <mailbox> [--org <id>]",
				"x-mailset-cli-example": "mailset delegates list ana@example.com",
				"x-mailset-role": "member",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "The mailbox’s address.",
												"type": "string"
											}
										},
										"required": [
											"mailbox"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"mailbox": {
													"type": "string"
												},
												"owners": {
													"type": "array",
													"items": {
														"type": "string"
													}
												},
												"delegates": {
													"type": "array",
													"items": {
														"type": "string"
													}
												},
												"deactivated": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Delegates or owners who are deactivated, kept so you can see them."
												},
												"canChange": {
													"type": "boolean",
													"description": "You hold this mailbox, so you can change who else does."
												}
											},
											"required": [
												"mailbox",
												"owners",
												"delegates",
												"deactivated",
												"canChange"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/delegates.add": {
			"post": {
				"operationId": "delegates.add",
				"summary": "Let someone in the org read and send from your mailbox",
				"description": "Anyone in the org. It can stop for a passkey approval.",
				"tags": [
					"Delegates"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/delegates#delegates.add"
				},
				"x-mailset-cli": "mailset delegates add <mailbox> --member <member> [--org <id>]",
				"x-mailset-cli-example": "mailset delegates add ana@example.com --member ben@example.com",
				"x-mailset-role": "member",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "Your mailbox’s address.",
												"type": "string"
											},
											"member": {
												"description": "The member’s address.",
												"type": "string"
											}
										},
										"required": [
											"mailbox",
											"member"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"member": "ben@example.com",
									"mailbox": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"mailbox": {
													"type": "string"
												},
												"owners": {
													"type": "array",
													"items": {
														"type": "string"
													}
												},
												"delegates": {
													"type": "array",
													"items": {
														"type": "string"
													}
												},
												"deactivated": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Delegates or owners who are deactivated, kept so you can see them."
												},
												"canChange": {
													"type": "boolean",
													"description": "You hold this mailbox, so you can change who else does."
												}
											},
											"required": [
												"mailbox",
												"owners",
												"delegates",
												"deactivated",
												"canChange"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/delegates.remove": {
			"post": {
				"operationId": "delegates.remove",
				"summary": "Stop someone using your mailbox",
				"description": "Anyone in the org.",
				"tags": [
					"Delegates"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/delegates#delegates.remove"
				},
				"x-mailset-cli": "mailset delegates remove <mailbox> --member <member> [--org <id>]",
				"x-mailset-cli-example": "mailset delegates remove ana@example.com --member ben@example.com",
				"x-mailset-role": "member",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "Your mailbox’s address.",
												"type": "string"
											},
											"member": {
												"description": "The member’s address.",
												"type": "string"
											}
										},
										"required": [
											"mailbox",
											"member"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"member": "ben@example.com",
									"mailbox": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean",
													"const": true
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/groups.list": {
			"post": {
				"operationId": "groups.list",
				"summary": "List an org’s groups",
				"description": "An admin or owner of the org.",
				"tags": [
					"Groups"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/groups#groups.list"
				},
				"x-mailset-cli": "mailset groups list [--org <id>]",
				"x-mailset-cli-example": "mailset groups list",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Group"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/groups.add": {
			"post": {
				"operationId": "groups.add",
				"summary": "Add a group: one address, a copy to every member mailbox",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Groups"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/groups#groups.add"
				},
				"x-mailset-cli": "mailset groups add <address> [--name <name>] [--senders anyone|org|members] [--members <a,b,…>] [--org <id>]",
				"x-mailset-cli-example": "mailset groups add team@example.com --name Team --members ana@example.com,ben@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The group’s address, on one of the org’s domains.",
												"type": "string"
											},
											"name": {
												"default": "",
												"description": "A name for the group.",
												"type": "string",
												"maxLength": 120
											},
											"senders": {
												"default": "org",
												"description": "Who may write to it: `anyone`, people in the `org`, or only its `members`.",
												"type": "string",
												"enum": [
													"anyone",
													"org",
													"members"
												]
											},
											"members": {
												"default": [],
												"description": "Mailboxes and other groups, by address.",
												"maxItems": 1000,
												"type": "array",
												"items": {
													"type": "string"
												}
											}
										},
										"required": [
											"address"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "Team",
									"members": [
										"ana@example.com",
										"ben@example.com"
									],
									"address": "team@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Group"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/groups.update": {
			"post": {
				"operationId": "groups.update",
				"summary": "Rename a group, or change who can send to it",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Groups"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/groups#groups.update"
				},
				"x-mailset-cli": "mailset groups update <address> [--name <name>] [--senders anyone|org|members] [--org <id>]",
				"x-mailset-cli-example": "mailset groups update team@example.com --senders anyone",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The group’s address.",
												"type": "string"
											},
											"name": {
												"description": "A new name for the group.",
												"type": "string",
												"maxLength": 120
											},
											"senders": {
												"description": "Who may write to it: `anyone`, people in the `org`, or only its `members`.",
												"type": "string",
												"enum": [
													"anyone",
													"org",
													"members"
												]
											}
										},
										"required": [
											"address"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"senders": "anyone",
									"address": "team@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Group"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/groups.remove": {
			"post": {
				"operationId": "groups.remove",
				"summary": "Delete a group. Its members keep their mail",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Groups"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/groups#groups.remove"
				},
				"x-mailset-cli": "mailset groups remove <address> [--org <id>]",
				"x-mailset-cli-example": "mailset groups remove team@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The group’s address.",
												"type": "string"
											}
										},
										"required": [
											"address"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"address": "team@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean",
													"const": true
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/groups.addMember": {
			"post": {
				"operationId": "groups.addMember",
				"summary": "Add a mailbox or group to a group",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Groups"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/groups#groups.addMember"
				},
				"x-mailset-cli": "mailset groups addMember <address> --member <member> [--org <id>]",
				"x-mailset-cli-example": "mailset groups addMember team@example.com --member carla@example.com",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The group’s address.",
												"type": "string"
											},
											"member": {
												"description": "The mailbox or group to add or take out, by address.",
												"type": "string"
											}
										},
										"required": [
											"address",
											"member"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"member": "carla@example.com",
									"address": "team@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Group"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/groups.removeMember": {
			"post": {
				"operationId": "groups.removeMember",
				"summary": "Take a mailbox or group out of a group",
				"description": "An admin or owner of the org.",
				"tags": [
					"Groups"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/groups#groups.removeMember"
				},
				"x-mailset-cli": "mailset groups removeMember <address> --member <member> [--org <id>]",
				"x-mailset-cli-example": "mailset groups removeMember team@example.com --member ben@example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The group’s address.",
												"type": "string"
											},
											"member": {
												"description": "The mailbox or group to add or take out, by address.",
												"type": "string"
											}
										},
										"required": [
											"address",
											"member"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"member": "ben@example.com",
									"address": "team@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Group"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/avatars.set": {
			"post": {
				"operationId": "avatars.set",
				"summary": "Set a mailbox’s picture from a PNG, JPEG or WebP file",
				"description": "An admin or owner of the org.",
				"tags": [
					"Mailbox pictures"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/avatars#avatars.set"
				},
				"x-mailset-cli": "mailset avatars set <address> --file <path> [--org <id>]",
				"x-mailset-cli-example": "mailset avatars set support@example.com --file logo.png",
				"x-mailset-role": "admin",
				"x-mailset-max-body-bytes": 6994603,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The mailbox’s address.",
												"type": "string"
											},
											"name": {
												"type": "string",
												"minLength": 1,
												"maxLength": 255,
												"description": "The picture file’s name."
											},
											"data": {
												"type": "string",
												"minLength": 1,
												"description": "The file, base64."
											}
										},
										"required": [
											"address",
											"name",
											"data"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"address": "support@example.com",
									"name": "logo.png",
									"data": "<base64 of the file>"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"address": {
													"type": "string",
													"description": "The mailbox’s address."
												},
												"picture": {
													"type": "string",
													"description": "A short-lived URL for the picture."
												}
											},
											"required": [
												"address",
												"picture"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/avatars.remove": {
			"post": {
				"operationId": "avatars.remove",
				"summary": "Remove a mailbox’s picture",
				"description": "An admin or owner of the org.",
				"tags": [
					"Mailbox pictures"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/avatars#avatars.remove"
				},
				"x-mailset-cli": "mailset avatars remove <address> [--org <id>]",
				"x-mailset-cli-example": "mailset avatars remove support@example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The mailbox’s address.",
												"type": "string"
											}
										},
										"required": [
											"address"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"address": "support@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean"
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/mailboxes.name": {
			"post": {
				"operationId": "mailboxes.name",
				"summary": "Set the name a mailbox’s mail goes out under",
				"description": "An admin or owner of the org.",
				"tags": [
					"Mailboxes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/mailboxes#mailboxes.name"
				},
				"x-mailset-cli": "mailset mailboxes name <address> --name <name> [--org <id>]",
				"x-mailset-cli-example": "mailset mailboxes name support@example.com --name \"Acme Support\"",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The mailbox’s address.",
												"type": "string"
											},
											"name": {
												"type": "string",
												"maxLength": 200,
												"description": "The name its mail goes out under. Empty clears it."
											}
										},
										"required": [
											"address",
											"name"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "Acme Support",
									"address": "support@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"address": {
													"type": "string",
													"description": "The mailbox’s address."
												},
												"name": {
													"description": "The name it has now. Null: it sends with the address alone.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"address",
												"name"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/addresses.default": {
			"post": {
				"operationId": "addresses.default",
				"summary": "Choose the address new mail goes out from",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Default address"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/addresses#addresses.default"
				},
				"x-mailset-cli": "mailset addresses default <address>",
				"x-mailset-cli-example": "mailset addresses default ana@example.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "One of your addresses.",
												"type": "string"
											}
										},
										"required": [
											"address"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"address": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"address": {
													"type": "string",
													"description": "The address new mail goes out from now."
												}
											},
											"required": [
												"address"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/aliases.list": {
			"post": {
				"operationId": "aliases.list",
				"summary": "List an org’s aliases",
				"description": "Anyone in the org.",
				"tags": [
					"Aliases"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/aliases#aliases.list"
				},
				"x-mailset-cli": "mailset aliases list [--org <id>]",
				"x-mailset-cli-example": "mailset aliases list",
				"x-mailset-role": "member",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Alias"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/aliases.add": {
			"post": {
				"operationId": "aliases.add",
				"summary": "Send an address, or *@domain, to a mailbox",
				"description": "An admin or owner of the org.",
				"tags": [
					"Aliases"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/aliases#aliases.add"
				},
				"x-mailset-cli": "mailset aliases add <alias> --mailbox <mailbox> [--org <id>]",
				"x-mailset-cli-example": "mailset aliases add billing@example.com --mailbox ana@example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"alias": {
												"anyOf": [
													{
														"type": "string"
													},
													{
														"type": "string",
														"pattern": "^\\*@[a-z0-9.-]+\\.[a-z]{2,}$"
													}
												],
												"description": "The address to add, or `*@domain` for everything else at a domain."
											},
											"mailbox": {
												"description": "The mailbox its mail goes into.",
												"type": "string"
											}
										},
										"required": [
											"alias",
											"mailbox"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"alias": "billing@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Alias"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/aliases.remove": {
			"post": {
				"operationId": "aliases.remove",
				"summary": "Remove an alias",
				"description": "An admin or owner of the org.",
				"tags": [
					"Aliases"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/aliases#aliases.remove"
				},
				"x-mailset-cli": "mailset aliases remove <alias> [--org <id>]",
				"x-mailset-cli-example": "mailset aliases remove billing@example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"alias": {
												"anyOf": [
													{
														"type": "string"
													},
													{
														"type": "string",
														"pattern": "^\\*@[a-z0-9.-]+\\.[a-z]{2,}$"
													}
												],
												"description": "The alias’s address, or `*@domain`."
											}
										},
										"required": [
											"alias"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"alias": "billing@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean"
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/vacation.list": {
			"post": {
				"operationId": "vacation.list",
				"summary": "Show the vacation reply on each of your mailboxes",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Vacation replies"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/vacation#vacation.list"
				},
				"x-mailset-cli": "mailset vacation list",
				"x-mailset-cli-example": "mailset vacation list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"mailbox": {
														"type": "string"
													},
													"on": {
														"type": "boolean"
													},
													"subject": {
														"type": "string"
													},
													"text": {
														"type": "string"
													},
													"startsAt": {
														"type": [
															"number",
															"null"
														]
													},
													"endsAt": {
														"type": [
															"number",
															"null"
														]
													},
													"state": {
														"type": "string",
														"enum": [
															"off",
															"scheduled",
															"ended",
															"held",
															"active"
														]
													},
													"note": {
														"description": "Why it isn’t replying right now, in words.",
														"type": [
															"string",
															"null"
														]
													}
												},
												"required": [
													"mailbox",
													"on",
													"subject",
													"text",
													"startsAt",
													"endsAt",
													"state",
													"note"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/vacation.set": {
			"post": {
				"operationId": "vacation.set",
				"summary": "Set a mailbox’s vacation reply",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Vacation replies"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/vacation#vacation.set"
				},
				"x-mailset-cli": "mailset vacation set <mailbox> [--on] [--subject <subject>] [--text <text>] [--starts-at <starts-at>] [--ends-at <ends-at>]",
				"x-mailset-cli-example": "mailset vacation set ana@example.com --on --subject \"Away until Monday\" --text \"I am away and will answer on Monday.\" --ends-at 2026-12-07T09:00:00Z",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "The mailbox’s address.",
												"type": "string"
											},
											"on": {
												"description": "Turn the reply on or off.",
												"type": "boolean"
											},
											"subject": {
												"description": "The reply’s subject.",
												"type": "string",
												"minLength": 1,
												"maxLength": 200
											},
											"text": {
												"description": "The reply’s text.",
												"type": "string",
												"minLength": 1,
												"maxLength": 20000
											},
											"startsAt": {
												"description": "When it starts replying: ms since the epoch, or an ISO date and time with its offset (`2026-12-07T09:00:00Z`). Null clears it.",
												"anyOf": [
													{
														"anyOf": [
															{
																"type": "integer",
																"exclusiveMinimum": 0,
																"maximum": 9007199254740991
															},
															{
																"type": "string",
																"format": "date-time",
																"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
															}
														]
													},
													{
														"type": "null"
													}
												]
											},
											"endsAt": {
												"description": "When it stops: ms since the epoch, or an ISO date and time with its offset (`2026-12-07T09:00:00Z`). Null clears it.",
												"anyOf": [
													{
														"anyOf": [
															{
																"type": "integer",
																"exclusiveMinimum": 0,
																"maximum": 9007199254740991
															},
															{
																"type": "string",
																"format": "date-time",
																"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
															}
														]
													},
													{
														"type": "null"
													}
												]
											}
										},
										"required": [
											"mailbox"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"on": true,
									"subject": "Away until Monday",
									"text": "I am away and will answer on Monday.",
									"endsAt": "2026-12-07T09:00:00Z",
									"mailbox": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"mailbox": {
													"type": "string"
												},
												"on": {
													"type": "boolean"
												},
												"subject": {
													"type": "string"
												},
												"text": {
													"type": "string"
												},
												"startsAt": {
													"type": [
														"number",
														"null"
													]
												},
												"endsAt": {
													"type": [
														"number",
														"null"
													]
												},
												"state": {
													"type": "string",
													"enum": [
														"off",
														"scheduled",
														"ended",
														"held",
														"active"
													]
												},
												"note": {
													"description": "Why it isn’t replying right now, in words.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"mailbox",
												"on",
												"subject",
												"text",
												"startsAt",
												"endsAt",
												"state",
												"note"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/forwarding.list": {
			"post": {
				"operationId": "forwarding.list",
				"summary": "Show where each of your mailboxes forwards",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Forwarding"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/forwarding#forwarding.list"
				},
				"x-mailset-cli": "mailset forwarding list",
				"x-mailset-cli-example": "mailset forwarding list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Forward"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/forwarding.set": {
			"post": {
				"operationId": "forwarding.set",
				"summary": "Forward a mailbox’s new mail to an outside address, once that address confirms (one of your inbound routes needs no confirming)",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"Forwarding"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/forwarding#forwarding.set"
				},
				"x-mailset-cli": "mailset forwarding set <mailbox> --to <to> [--sent] [--org <id>]",
				"x-mailset-cli-example": "mailset forwarding set ana@example.com --to ana@example.org",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "The mailbox’s address.",
												"type": "string"
											},
											"to": {
												"description": "Where its new mail goes: an outside address, or one of your inbound routes.",
												"type": "string"
											},
											"sent": {
												"description": "Also what the mailbox sends. Only for one of your inbound routes. Left out: as it is.",
												"type": "boolean"
											}
										},
										"required": [
											"mailbox",
											"to"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"to": "ana@example.org",
									"mailbox": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Forward"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/forwarding.remove": {
			"post": {
				"operationId": "forwarding.remove",
				"summary": "Stop forwarding a mailbox",
				"description": "An admin or owner of the org.",
				"tags": [
					"Forwarding"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/forwarding#forwarding.remove"
				},
				"x-mailset-cli": "mailset forwarding remove <mailbox> [--org <id>]",
				"x-mailset-cli-example": "mailset forwarding remove ana@example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "The mailbox’s address.",
												"type": "string"
											}
										},
										"required": [
											"mailbox"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean"
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/forwarding.resend": {
			"post": {
				"operationId": "forwarding.resend",
				"summary": "Send the confirmation link to the destination again",
				"description": "An admin or owner of the org.",
				"tags": [
					"Forwarding"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/forwarding#forwarding.resend"
				},
				"x-mailset-cli": "mailset forwarding resend <mailbox> [--org <id>]",
				"x-mailset-cli-example": "mailset forwarding resend ana@example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "The mailbox’s address.",
												"type": "string"
											}
										},
										"required": [
											"mailbox"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Forward"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/imports.start": {
			"post": {
				"operationId": "imports.start",
				"summary": "Copy a mailbox’s mail from a Google account: opens Google to connect",
				"description": "An admin or owner of the org.",
				"tags": [
					"Imports"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/imports#imports.start"
				},
				"x-mailset-cli": "mailset imports start <mailbox> [--addresses <a,b,…>] [--org <id>]",
				"x-mailset-cli-example": "mailset imports start ana@example.com",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "The mailbox the mail is copied into.",
												"type": "string"
											},
											"addresses": {
												"description": "Which of the mailbox’s addresses. Leave out for all of them.",
												"maxItems": 100,
												"type": "array",
												"items": {
													"type": "string"
												}
											}
										},
										"required": [
											"mailbox"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string",
													"description": "The import’s id."
												},
												"url": {
													"type": "string",
													"description": "Google’s page to open, to connect the account."
												}
											},
											"required": [
												"id",
												"url"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/imports.list": {
			"post": {
				"operationId": "imports.list",
				"summary": "List Gmail imports",
				"description": "An admin or owner of the org.",
				"tags": [
					"Imports"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/imports#imports.list"
				},
				"x-mailset-cli": "mailset imports list [--org <id>]",
				"x-mailset-cli-example": "mailset imports list",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string",
														"description": "The import’s id."
													},
													"mailbox": {
														"type": "string",
														"description": "The mailbox the mail is copied into."
													},
													"addresses": {
														"type": "array",
														"items": {
															"type": "string"
														},
														"description": "The addresses whose mail is copied: the mailbox’s own and its aliases."
													},
													"account": {
														"description": "The Google account it copies from, once connected.",
														"type": [
															"string",
															"null"
														]
													},
													"state": {
														"type": "string",
														"enum": [
															"connecting",
															"listing",
															"copying",
															"done",
															"failed",
															"cancelled"
														],
														"description": "How far along it is."
													},
													"total": {
														"type": "number",
														"description": "Messages found so far."
													},
													"imported": {
														"type": "number",
														"description": "Messages copied so far."
													},
													"skipped": {
														"type": "number",
														"description": "Messages left out so far."
													},
													"reason": {
														"description": "Why it failed, when it did.",
														"type": [
															"string",
															"null"
														]
													},
													"paused": {
														"type": "boolean",
														"description": "It is waiting because the org’s plan ended. It carries on once the plan is live again."
													},
													"createdAt": {
														"type": "number",
														"description": "When it started, in milliseconds since 1970."
													},
													"finishedAt": {
														"description": "When it finished, in milliseconds since 1970, or null while it runs.",
														"type": [
															"number",
															"null"
														]
													}
												},
												"required": [
													"id",
													"mailbox",
													"addresses",
													"account",
													"state",
													"total",
													"imported",
													"skipped",
													"reason",
													"paused",
													"createdAt",
													"finishedAt"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/imports.cancel": {
			"post": {
				"operationId": "imports.cancel",
				"summary": "Stop an import and end its access to Google",
				"description": "An admin or owner of the org.",
				"tags": [
					"Imports"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/imports#imports.cancel"
				},
				"x-mailset-cli": "mailset imports cancel <id> [--org <id>]",
				"x-mailset-cli-example": "mailset imports cancel imp_8d3b7e1a5c9f2046b2e7a1c5",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The import’s id, from `imports list`."
											}
										},
										"required": [
											"id"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "imp_8d3b7e1a5c9f2046b2e7a1c5"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"cancelled": {
													"type": "boolean",
													"const": true
												}
											},
											"required": [
												"cancelled"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/threads.list": {
			"post": {
				"operationId": "threads.list",
				"summary": "List conversations",
				"description": "An app key with `read` on the mailbox. Or a person: any signed-in person, with an API token.",
				"tags": [
					"Conversations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#threads.list"
				},
				"x-mailset-cli": "mailset threads list [--mailbox <mailbox>] [--place inbox|archived|trash|junk] [--starred] [--important] [--sent] [--label <label>] [--snoozed] [--tab primary|updates|newsletters|promotions] [--limit <n>] [--before <before>]",
				"x-mailset-cli-example": "mailset threads list --mailbox ana@example.com --limit 20",
				"x-mailset-grant": "read",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "Only this mailbox. Left out: every mailbox you can open.",
												"type": "string"
											},
											"place": {
												"default": "inbox",
												"description": "Where to look: `inbox`, `archived`, `trash` or `junk`.",
												"type": "string",
												"enum": [
													"inbox",
													"archived",
													"trash",
													"junk"
												]
											},
											"starred": {
												"description": "Only conversations with a starred message.",
												"type": "boolean"
											},
											"important": {
												"description": "Conversations marked important, anywhere but Trash and Junk.",
												"type": "boolean"
											},
											"sent": {
												"description": "The Sent folder: conversations you’ve written in, wherever they are.",
												"type": "boolean"
											},
											"label": {
												"description": "Conversations with this label, anywhere but Trash and Junk.",
												"type": "string",
												"minLength": 1,
												"maxLength": 60
											},
											"snoozed": {
												"description": "Only what you’ve snoozed.",
												"type": "boolean"
											},
											"tab": {
												"description": "One tab of the inbox.",
												"type": "string",
												"enum": [
													"primary",
													"updates",
													"newsletters",
													"promotions"
												]
											},
											"limit": {
												"default": 50,
												"description": "How many conversations a page holds, 1 to 100.",
												"type": "integer",
												"minimum": 1,
												"maximum": 100
											},
											"before": {
												"description": "The `next` of the page before, for the page after it.",
												"type": "string"
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"limit": 20
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"threads": {
													"type": "array",
													"items": {
														"$ref": "#/components/schemas/Conversation"
													},
													"description": "One page of conversations, newest first."
												},
												"next": {
													"description": "Pass back as `before` for the next page. Null at the end.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"threads",
												"next"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/threads.get": {
			"post": {
				"operationId": "threads.get",
				"summary": "Read a conversation",
				"description": "An app key with `read` on the mailbox. Or a person: any signed-in person, with an API token.",
				"tags": [
					"Conversations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#threads.get"
				},
				"x-mailset-cli": "mailset threads get <id>",
				"x-mailset-cli-example": "mailset threads get t_5d2c8a1f9e3b47c6a0d1e2f3",
				"x-mailset-grant": "read",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The conversation’s id, from `threads list` or `threads search`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"summary": {
													"description": "The conversation as a list shows it.",
													"$ref": "#/components/schemas/Conversation"
												},
												"messages": {
													"type": "array",
													"items": {
														"$ref": "#/components/schemas/Message"
													},
													"description": "Its messages, oldest first."
												},
												"unreadFrom": {
													"description": "While unread: the id of the message it was marked unread from.",
													"type": [
														"string",
														"null"
													]
												},
												"notes": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string",
																"description": "The note’s id."
															},
															"author": {
																"anyOf": [
																	{
																		"type": "object",
																		"properties": {
																			"email": {
																				"type": "string",
																				"description": "Their address."
																			},
																			"name": {
																				"description": "Their name, or null when they have none.",
																				"type": [
																					"string",
																					"null"
																				]
																			},
																			"deactivated": {
																				"description": "Their org deactivated them. Present only when true.",
																				"type": "boolean",
																				"const": true
																			}
																		},
																		"required": [
																			"email",
																			"name"
																		],
																		"additionalProperties": false
																	},
																	{
																		"type": "null"
																	}
																],
																"description": "Who wrote it, or null when they are gone."
															},
															"text": {
																"type": "string",
																"description": "What it says."
															},
															"at": {
																"type": "number",
																"description": "When it was written, in milliseconds since 1970."
															}
														},
														"required": [
															"id",
															"author",
															"text",
															"at"
														],
														"additionalProperties": false
													},
													"description": "Notes only the mailbox’s members see. Never mail."
												},
												"events": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string",
																"description": "The event’s id."
															},
															"actor": {
																"anyOf": [
																	{
																		"type": "object",
																		"properties": {
																			"email": {
																				"type": "string",
																				"description": "Their address."
																			},
																			"name": {
																				"description": "Their name, or null when they have none.",
																				"type": [
																					"string",
																					"null"
																				]
																			},
																			"deactivated": {
																				"description": "Their org deactivated them. Present only when true.",
																				"type": "boolean",
																				"const": true
																			}
																		},
																		"required": [
																			"email",
																			"name"
																		],
																		"additionalProperties": false
																	},
																	{
																		"type": "null"
																	}
																],
																"description": "Who did it, or null when they are gone."
															},
															"assignee": {
																"anyOf": [
																	{
																		"type": "object",
																		"properties": {
																			"email": {
																				"type": "string",
																				"description": "Their address."
																			},
																			"name": {
																				"description": "Their name, or null when they have none.",
																				"type": [
																					"string",
																					"null"
																				]
																			},
																			"deactivated": {
																				"description": "Their org deactivated them. Present only when true.",
																				"type": "boolean",
																				"const": true
																			}
																		},
																		"required": [
																			"email",
																			"name"
																		],
																		"additionalProperties": false
																	},
																	{
																		"type": "null"
																	}
																],
																"description": "Who owns the conversation now. Null when it was unassigned."
															},
															"at": {
																"type": "number",
																"description": "When it happened, in milliseconds since 1970."
															}
														},
														"required": [
															"id",
															"actor",
															"assignee",
															"at"
														],
														"additionalProperties": false
													},
													"description": "Its owner changes, oldest first."
												}
											},
											"required": [
												"summary",
												"messages",
												"unreadFrom",
												"notes",
												"events"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/threads.update": {
			"post": {
				"operationId": "threads.update",
				"summary": "Mark, star, mark important, archive or move conversations",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Conversations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#threads.update"
				},
				"x-mailset-cli": "mailset threads update --ids <a,b,…> [--unread] [--starred] [--important] [--place inbox|archived|trash|junk]",
				"x-mailset-cli-example": "mailset threads update --ids t_5d2c8a1f9e3b47c6a0d1e2f3,t_b7e41c9a2f6d4083c5a9e1b2 --place archived",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"ids": {
												"minItems": 1,
												"maxItems": 200,
												"type": "array",
												"items": {
													"type": "string",
													"minLength": 1
												},
												"description": "The conversations’ ids, 1 to 200."
											},
											"unread": {
												"description": "Mark them unread, or read.",
												"type": "boolean"
											},
											"starred": {
												"description": "Star them, or take the star off.",
												"type": "boolean"
											},
											"important": {
												"description": "Sets the Important marker by hand, or clears it.",
												"type": "boolean"
											},
											"place": {
												"description": "Move them: `inbox`, `archived`, `trash` or `junk`.",
												"type": "string",
												"enum": [
													"inbox",
													"archived",
													"trash",
													"junk"
												]
											}
										},
										"required": [
											"ids"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"ids": [
										"t_5d2c8a1f9e3b47c6a0d1e2f3",
										"t_b7e41c9a2f6d4083c5a9e1b2"
									],
									"place": "archived"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"updated": {
													"type": "number",
													"description": "How many changed."
												}
											},
											"required": [
												"updated"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/threads.markAllRead": {
			"post": {
				"operationId": "threads.markAllRead",
				"summary": "Mark a whole list as read, not only what is loaded",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Conversations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#threads.markAllRead"
				},
				"x-mailset-cli": "mailset threads markAllRead [--mailbox <mailbox>] [--place inbox|archived|trash|junk] [--starred] [--important] [--sent] [--label <label>] [--snoozed] [--query <query>] [--except <a,b,…>] [--owner unassigned|mine] [--tab primary|updates|newsletters|promotions]",
				"x-mailset-cli-example": "mailset threads markAllRead --mailbox ana@example.com --tab promotions",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "Only this mailbox. Left out: every mailbox you can open.",
												"type": "string"
											},
											"place": {
												"default": "inbox",
												"description": "Where to look: `inbox`, `archived`, `trash` or `junk`.",
												"type": "string",
												"enum": [
													"inbox",
													"archived",
													"trash",
													"junk"
												]
											},
											"starred": {
												"description": "Only conversations with a starred message.",
												"type": "boolean"
											},
											"important": {
												"description": "Conversations marked important, anywhere but Trash and Junk.",
												"type": "boolean"
											},
											"sent": {
												"description": "Conversations you’ve written in, wherever they are.",
												"type": "boolean"
											},
											"label": {
												"description": "Conversations with this label, anywhere but Trash and Junk.",
												"type": "string",
												"minLength": 1,
												"maxLength": 60
											},
											"snoozed": {
												"description": "Only what you’ve snoozed.",
												"type": "boolean"
											},
											"query": {
												"description": "A search’s results, with the same words as `threads search`.",
												"type": "string",
												"minLength": 1,
												"maxLength": 500
											},
											"except": {
												"default": [],
												"description": "Mailboxes to leave alone: All inboxes hides these.",
												"maxItems": 200,
												"type": "array",
												"items": {
													"type": "string"
												}
											},
											"owner": {
												"description": "One tab of a shared mailbox.",
												"type": "string",
												"enum": [
													"unassigned",
													"mine"
												]
											},
											"tab": {
												"description": "One tab of a personal inbox.",
												"type": "string",
												"enum": [
													"primary",
													"updates",
													"newsletters",
													"promotions"
												]
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"tab": "promotions"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"updated": {
													"type": "number",
													"description": "How many were marked read."
												}
											},
											"required": [
												"updated"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/threads.count": {
			"post": {
				"operationId": "threads.count",
				"summary": "Count the conversations in a whole list; a search counts up to 1,000",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Conversations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#threads.count"
				},
				"x-mailset-cli": "mailset threads count [--mailbox <mailbox>] [--place inbox|archived|trash|junk] [--starred] [--important] [--sent] [--label <label>] [--snoozed] [--query <query>] [--except <a,b,…>] [--owner unassigned|mine] [--tab primary|updates|newsletters|promotions]",
				"x-mailset-cli-example": "mailset threads count --mailbox ana@example.com --tab primary",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "Only this mailbox. Left out: every mailbox you can open.",
												"type": "string"
											},
											"place": {
												"default": "inbox",
												"description": "Where to look: `inbox`, `archived`, `trash` or `junk`.",
												"type": "string",
												"enum": [
													"inbox",
													"archived",
													"trash",
													"junk"
												]
											},
											"starred": {
												"description": "Only conversations with a starred message.",
												"type": "boolean"
											},
											"important": {
												"description": "Conversations marked important, anywhere but Trash and Junk.",
												"type": "boolean"
											},
											"sent": {
												"description": "Conversations you’ve written in, wherever they are.",
												"type": "boolean"
											},
											"label": {
												"description": "Conversations with this label, anywhere but Trash and Junk.",
												"type": "string",
												"minLength": 1,
												"maxLength": 60
											},
											"snoozed": {
												"description": "Only what you’ve snoozed.",
												"type": "boolean"
											},
											"query": {
												"description": "A search’s results, with the same words as `threads search`.",
												"type": "string",
												"minLength": 1,
												"maxLength": 500
											},
											"except": {
												"default": [],
												"description": "Mailboxes to leave alone: All inboxes hides these.",
												"maxItems": 200,
												"type": "array",
												"items": {
													"type": "string"
												}
											},
											"owner": {
												"description": "One tab of a shared mailbox.",
												"type": "string",
												"enum": [
													"unassigned",
													"mine"
												]
											},
											"tab": {
												"description": "One tab of a personal inbox.",
												"type": "string",
												"enum": [
													"primary",
													"updates",
													"newsletters",
													"promotions"
												]
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"tab": "primary"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"count": {
													"type": "number",
													"description": "How many conversations the list holds."
												},
												"capped": {
													"type": "boolean",
													"description": "A search stopped counting at `count`: it found more."
												}
											},
											"required": [
												"count",
												"capped"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/threads.updateAll": {
			"post": {
				"operationId": "threads.updateAll",
				"summary": "Archive, move, mark, star or label a whole list, not only what is loaded",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Conversations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#threads.updateAll"
				},
				"x-mailset-cli": "mailset threads updateAll --change <json> [--mailbox <mailbox>] [--place inbox|archived|trash|junk] [--starred] [--important] [--sent] [--label <label>] [--snoozed] [--query <query>] [--except <a,b,…>] [--owner unassigned|mine] [--tab primary|updates|newsletters|promotions] [--after <after>]",
				"x-mailset-cli-example": "mailset threads updateAll --label Finance --change '{\"place\":\"archived\"}'",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "Only this mailbox. Left out: every mailbox you can open.",
												"type": "string"
											},
											"place": {
												"default": "inbox",
												"description": "Where to look: `inbox`, `archived`, `trash` or `junk`.",
												"type": "string",
												"enum": [
													"inbox",
													"archived",
													"trash",
													"junk"
												]
											},
											"starred": {
												"description": "Only conversations with a starred message.",
												"type": "boolean"
											},
											"important": {
												"description": "Conversations marked important, anywhere but Trash and Junk.",
												"type": "boolean"
											},
											"sent": {
												"description": "Conversations you’ve written in, wherever they are.",
												"type": "boolean"
											},
											"label": {
												"description": "Conversations with this label, anywhere but Trash and Junk.",
												"type": "string",
												"minLength": 1,
												"maxLength": 60
											},
											"snoozed": {
												"description": "Only what you’ve snoozed.",
												"type": "boolean"
											},
											"query": {
												"description": "A search’s results, with the same words as `threads search`.",
												"type": "string",
												"minLength": 1,
												"maxLength": 500
											},
											"except": {
												"default": [],
												"description": "Mailboxes to leave alone: All inboxes hides these.",
												"maxItems": 200,
												"type": "array",
												"items": {
													"type": "string"
												}
											},
											"owner": {
												"description": "One tab of a shared mailbox.",
												"type": "string",
												"enum": [
													"unassigned",
													"mine"
												]
											},
											"tab": {
												"description": "One tab of a personal inbox.",
												"type": "string",
												"enum": [
													"primary",
													"updates",
													"newsletters",
													"promotions"
												]
											},
											"change": {
												"type": "object",
												"properties": {
													"unread": {
														"description": "Mark them unread, or read.",
														"type": "boolean"
													},
													"starred": {
														"description": "Star them, or take the star off.",
														"type": "boolean"
													},
													"important": {
														"description": "Mark them important, or clear it.",
														"type": "boolean"
													},
													"place": {
														"description": "Where they go: Archive, the inbox, Junk or Trash.",
														"type": "string",
														"enum": [
															"inbox",
															"archived",
															"trash",
															"junk"
														]
													},
													"add": {
														"default": [],
														"description": "Labels to put on them, by name.",
														"maxItems": 50,
														"type": "array",
														"items": {
															"type": "string",
															"minLength": 1,
															"maxLength": 60
														}
													},
													"remove": {
														"default": [],
														"description": "Labels to take off them, by name.",
														"maxItems": 50,
														"type": "array",
														"items": {
															"type": "string",
															"minLength": 1,
															"maxLength": 60
														}
													}
												},
												"description": "What happens to each one: the fields of `threads update` and `threads label`."
											},
											"after": {
												"description": "Where the last call stopped: its `next`.",
												"type": "string"
											}
										},
										"required": [
											"change"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"label": "Finance",
									"change": {
										"place": "archived"
									}
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"updated": {
													"type": "number",
													"description": "How many changed in this call."
												},
												"next": {
													"description": "The list is longer than one call goes: call again with this as `after`. Null once done.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"updated",
												"next"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/threads.search": {
			"post": {
				"operationId": "threads.search",
				"summary": "Search mail, with from:, to:, subject:, has:attachment, larger:, smaller:, before:, after:, is:important, brackets, OR, and -word",
				"description": "An app key with `read` on the mailbox. Or a person: any signed-in person, with an API token.",
				"tags": [
					"Conversations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#threads.search"
				},
				"x-mailset-cli": "mailset threads search <query> [--limit <n>] [--before <before>] [--prefix]",
				"x-mailset-cli-example": "mailset threads search \"from:stripe.com has:attachment\" --limit 20",
				"x-mailset-grant": "read",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"query": {
												"type": "string",
												"minLength": 1,
												"maxLength": 500,
												"description": "What to find: words, and operators such as `from:`, `to:`, `subject:`, `has:attachment`, `larger:`, `before:`, `after:`, `is:important`, `OR` and `-word`. Up to 500 characters."
											},
											"limit": {
												"default": 50,
												"description": "How many conversations a page holds, 1 to 100.",
												"type": "integer",
												"minimum": 1,
												"maximum": 100
											},
											"before": {
												"description": "The `next` of the page before, for the page after it.",
												"type": "string"
											},
											"prefix": {
												"description": "The last word is still being typed: a bare word of two letters or more matches the start of a word.",
												"type": "boolean"
											}
										},
										"required": [
											"query"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"limit": 20,
									"query": "from:stripe.com has:attachment"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"threads": {
													"type": "array",
													"items": {
														"$ref": "#/components/schemas/Conversation"
													},
													"description": "One page of conversations, newest first."
												},
												"next": {
													"description": "Pass back as `before` for the next page. Null at the end.",
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"threads",
												"next"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/codes.latest": {
			"post": {
				"operationId": "codes.latest",
				"summary": "The newest one-time code mailed to an address you can read",
				"description": "An app key with `read` on the mailbox. Or a person: any signed-in person, with an API token.",
				"tags": [
					"Codes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/codes#codes.latest"
				},
				"x-mailset-cli": "mailset codes latest <to> [--from <from>] [--within <within>]",
				"x-mailset-cli-example": "mailset codes latest ana@example.com --from yahoo.com --within 10m",
				"x-mailset-grant": "read",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"to": {
												"description": "The address the code was mailed to: a mailbox you can read, or an alias, +tag, catch-all or group that delivers into one.",
												"type": "string"
											},
											"from": {
												"description": "Only mail from this sender: an address, or a domain with its subdomains (`yahoo.com`).",
												"type": "string"
											},
											"within": {
												"description": "How far back to look: `30m`, `2h`, `1d`, or minutes as a number. 30 minutes unless given, a day at most.",
												"anyOf": [
													{
														"type": "integer",
														"minimum": -9007199254740991,
														"maximum": 9007199254740991
													},
													{
														"type": "string",
														"pattern": "^\\d{1,5}\\s*(m|min|h|d)?$"
													}
												]
											}
										},
										"required": [
											"to"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"from": "yahoo.com",
									"within": "10m",
									"to": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"code": {
													"type": "string",
													"description": "The code, as it was mailed: 4 to 8 digits, or 6 to 8 capitals and digits."
												},
												"from": {
													"type": "string",
													"description": "The sender’s address."
												},
												"subject": {
													"type": "string",
													"description": "The subject of the message it came in."
												},
												"receivedAt": {
													"type": "number",
													"description": "When the message arrived, in ms since the epoch."
												},
												"mailboxAddress": {
													"type": "string",
													"description": "The mailbox the message is in."
												}
											},
											"required": [
												"code",
												"from",
												"subject",
												"receivedAt",
												"mailboxAddress"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/threads.label": {
			"post": {
				"operationId": "threads.label",
				"summary": "Put labels on conversations, or take them off",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Conversations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#threads.label"
				},
				"x-mailset-cli": "mailset threads label --ids <a,b,…> [--add <a,b,…>] [--remove <a,b,…>]",
				"x-mailset-cli-example": "mailset threads label --ids t_5d2c8a1f9e3b47c6a0d1e2f3,t_b7e41c9a2f6d4083c5a9e1b2 --add Finance",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"ids": {
												"minItems": 1,
												"maxItems": 200,
												"type": "array",
												"items": {
													"type": "string",
													"minLength": 1
												},
												"description": "The conversations’ ids, 1 to 200."
											},
											"add": {
												"default": [],
												"description": "Labels to put on them, by name.",
												"maxItems": 50,
												"type": "array",
												"items": {
													"type": "string",
													"minLength": 1,
													"maxLength": 60
												}
											},
											"remove": {
												"default": [],
												"description": "Labels to take off them, by name.",
												"maxItems": 50,
												"type": "array",
												"items": {
													"type": "string",
													"minLength": 1,
													"maxLength": 60
												}
											}
										},
										"required": [
											"ids"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"ids": [
										"t_5d2c8a1f9e3b47c6a0d1e2f3",
										"t_b7e41c9a2f6d4083c5a9e1b2"
									],
									"add": [
										"Finance"
									]
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"updated": {
													"type": "number",
													"description": "How many changed."
												}
											},
											"required": [
												"updated"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/threads.assign": {
			"post": {
				"operationId": "threads.assign",
				"summary": "Give a conversation in a shared mailbox an owner",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Conversations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#threads.assign"
				},
				"x-mailset-cli": "mailset threads assign <id> --assignee <assignee>",
				"x-mailset-cli-example": "mailset threads assign t_5d2c8a1f9e3b47c6a0d1e2f3 --assignee ben@example.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The conversation’s id."
											},
											"assignee": {
												"anyOf": [
													{
														"type": "string"
													},
													{
														"type": "string",
														"const": "nobody"
													}
												],
												"description": "Someone in the mailbox, or `nobody`."
											}
										},
										"required": [
											"id",
											"assignee"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"assignee": "ben@example.com",
									"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"assignee": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"email": {
																	"type": "string",
																	"description": "Their address."
																},
																"name": {
																	"description": "Their name, or null when they have none.",
																	"type": [
																		"string",
																		"null"
																	]
																},
																"deactivated": {
																	"description": "Their org deactivated them. Present only when true.",
																	"type": "boolean",
																	"const": true
																}
															},
															"required": [
																"email",
																"name"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													],
													"description": "Who owns it now. Null: nobody."
												}
											},
											"required": [
												"assignee"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/notes.add": {
			"post": {
				"operationId": "notes.add",
				"summary": "Leave a note in a shared conversation, for the team only",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Notes"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/notes#notes.add"
				},
				"x-mailset-cli": "mailset notes add <thread-id> --text <text>",
				"x-mailset-cli-example": "mailset notes add t_5d2c8a1f9e3b47c6a0d1e2f3 --text \"I called them. They pay on Friday.\"",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"threadId": {
												"type": "string",
												"minLength": 1,
												"description": "The conversation’s id."
											},
											"text": {
												"type": "string",
												"minLength": 1,
												"maxLength": 10000,
												"description": "The note, up to 10,000 characters."
											}
										},
										"required": [
											"threadId",
											"text"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"text": "I called them. They pay on Friday.",
									"threadId": "t_5d2c8a1f9e3b47c6a0d1e2f3"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string",
													"description": "The note’s id."
												},
												"author": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"email": {
																	"type": "string",
																	"description": "Their address."
																},
																"name": {
																	"description": "Their name, or null when they have none.",
																	"type": [
																		"string",
																		"null"
																	]
																},
																"deactivated": {
																	"description": "Their org deactivated them. Present only when true.",
																	"type": "boolean",
																	"const": true
																}
															},
															"required": [
																"email",
																"name"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													],
													"description": "Who wrote it, or null when they are gone."
												},
												"text": {
													"type": "string",
													"description": "What it says."
												},
												"at": {
													"type": "number",
													"description": "When it was written, in milliseconds since 1970."
												}
											},
											"required": [
												"id",
												"author",
												"text",
												"at"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/threads.snooze": {
			"post": {
				"operationId": "threads.snooze",
				"summary": "Hide conversations until a time",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Conversations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#threads.snooze"
				},
				"x-mailset-cli": "mailset threads snooze --ids <a,b,…> --until <until>",
				"x-mailset-cli-example": "mailset threads snooze --ids t_5d2c8a1f9e3b47c6a0d1e2f3 --until 2026-12-07T09:00:00Z",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"ids": {
												"minItems": 1,
												"maxItems": 200,
												"type": "array",
												"items": {
													"type": "string",
													"minLength": 1
												},
												"description": "The conversations’ ids, 1 to 200."
											},
											"until": {
												"anyOf": [
													{
														"type": "integer",
														"exclusiveMinimum": 0,
														"maximum": 9007199254740991
													},
													{
														"type": "string",
														"format": "date-time",
														"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
													}
												],
												"description": "When they come back: ms since the epoch, or an ISO date and time with its offset (`2026-12-07T09:00:00Z`)."
											}
										},
										"required": [
											"ids",
											"until"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"ids": [
										"t_5d2c8a1f9e3b47c6a0d1e2f3"
									],
									"until": "2026-12-07T09:00:00Z"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"updated": {
													"type": "number",
													"description": "How many were snoozed."
												}
											},
											"required": [
												"updated"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/threads.unsnooze": {
			"post": {
				"operationId": "threads.unsnooze",
				"summary": "Bring snoozed conversations back now",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Conversations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#threads.unsnooze"
				},
				"x-mailset-cli": "mailset threads unsnooze --ids <a,b,…>",
				"x-mailset-cli-example": "mailset threads unsnooze --ids t_5d2c8a1f9e3b47c6a0d1e2f3",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"ids": {
												"minItems": 1,
												"maxItems": 200,
												"type": "array",
												"items": {
													"type": "string",
													"minLength": 1
												},
												"description": "The conversations’ ids, 1 to 200."
											}
										},
										"required": [
											"ids"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"ids": [
										"t_5d2c8a1f9e3b47c6a0d1e2f3"
									]
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"updated": {
													"type": "number",
													"description": "How many came back."
												}
											},
											"required": [
												"updated"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/labels.list": {
			"post": {
				"operationId": "labels.list",
				"summary": "List your labels",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Labels"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/labels#labels.list"
				},
				"x-mailset-cli": "mailset labels list",
				"x-mailset-cli-example": "mailset labels list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Label"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/labels.create": {
			"post": {
				"operationId": "labels.create",
				"summary": "Create a label",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Labels"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/labels#labels.create"
				},
				"x-mailset-cli": "mailset labels create <name> [--color slate|amber|green|red|blue|violet]",
				"x-mailset-cli-example": "mailset labels create Finance --color green",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"type": "string",
												"minLength": 1,
												"maxLength": 60,
												"description": "The label’s name, up to 60 characters."
											},
											"color": {
												"default": "slate",
												"description": "Its colour.",
												"type": "string",
												"enum": [
													"slate",
													"amber",
													"green",
													"red",
													"blue",
													"violet"
												]
											}
										},
										"required": [
											"name"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"color": "green",
									"name": "Finance"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Label"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/labels.update": {
			"post": {
				"operationId": "labels.update",
				"summary": "Rename or recolour a label",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Labels"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/labels#labels.update"
				},
				"x-mailset-cli": "mailset labels update <name> [--rename <rename>] [--color slate|amber|green|red|blue|violet]",
				"x-mailset-cli-example": "mailset labels update Finance --rename Invoices --color blue",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"type": "string",
												"minLength": 1,
												"maxLength": 60,
												"description": "The label’s name as it is now."
											},
											"rename": {
												"description": "Its new name.",
												"type": "string",
												"minLength": 1,
												"maxLength": 60
											},
											"color": {
												"description": "Its new colour.",
												"type": "string",
												"enum": [
													"slate",
													"amber",
													"green",
													"red",
													"blue",
													"violet"
												]
											}
										},
										"required": [
											"name"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"rename": "Invoices",
									"color": "blue",
									"name": "Finance"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Label"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/labels.remove": {
			"post": {
				"operationId": "labels.remove",
				"summary": "Delete a label, and take it off every conversation",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Labels"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/labels#labels.remove"
				},
				"x-mailset-cli": "mailset labels remove <name>",
				"x-mailset-cli-example": "mailset labels remove Finance",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"type": "string",
												"minLength": 1,
												"maxLength": 60,
												"description": "The label’s name."
											}
										},
										"required": [
											"name"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "Finance"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean"
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/rules.list": {
			"post": {
				"operationId": "rules.list",
				"summary": "List the rules on your mailboxes, in the order they run",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Rules"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/rules#rules.list"
				},
				"x-mailset-cli": "mailset rules list [--mailbox <mailbox>]",
				"x-mailset-cli-example": "mailset rules list --mailbox ana@example.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "Only this mailbox’s rules.",
												"type": "string"
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Rule"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/rules.add": {
			"post": {
				"operationId": "rules.add",
				"summary": "Add a rule",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"Rules"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/rules#rules.add"
				},
				"x-mailset-cli": "mailset rules add --mailbox <mailbox> [--name <name>] [--from <from>] [--to <to>] [--subject <subject>] [--has-words <has-words>] [--doesnt-have <doesnt-have>] [--has-attachment] [--larger <larger>] [--smaller <smaller>] [--skip-inbox] [--mark-read] [--star] [--label <label>] [--forward <forward>] [--delete] [--never-junk] [--important] [--never-important] [--tab primary|updates|newsletters|promotions|] [--apply-existing]",
				"x-mailset-cli-example": "mailset rules add --mailbox ana@example.com --from stripe.com --label Finance --skip-inbox",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "The mailbox the rule runs on.",
												"type": "string"
											},
											"name": {
												"description": "A name for the rule, up to 120 characters.",
												"type": "string",
												"maxLength": 120
											},
											"from": {
												"description": "Mail from this sender: an address, a domain or a name.",
												"type": "string",
												"maxLength": 1500
											},
											"to": {
												"description": "Mail sent to this address.",
												"type": "string",
												"maxLength": 1500
											},
											"subject": {
												"description": "Mail with these words in its subject.",
												"type": "string",
												"maxLength": 1500
											},
											"hasWords": {
												"description": "Mail with these words anywhere in it.",
												"type": "string",
												"maxLength": 1500
											},
											"doesntHave": {
												"description": "Mail without these words.",
												"type": "string",
												"maxLength": 1500
											},
											"hasAttachment": {
												"description": "Mail that carries a file.",
												"type": "boolean"
											},
											"larger": {
												"description": "Mail larger than this: bytes, or `5M`, `500K`.",
												"anyOf": [
													{
														"type": "integer",
														"minimum": 0,
														"maximum": 9007199254740991
													},
													{
														"type": "string",
														"maxLength": 32
													}
												]
											},
											"smaller": {
												"description": "Mail smaller than this: bytes, or `5M`, `500K`.",
												"anyOf": [
													{
														"type": "integer",
														"minimum": 0,
														"maximum": 9007199254740991
													},
													{
														"type": "string",
														"maxLength": 32
													}
												]
											},
											"skipInbox": {
												"description": "Archive it as it arrives.",
												"type": "boolean"
											},
											"markRead": {
												"description": "Mark it read.",
												"type": "boolean"
											},
											"star": {
												"description": "Star it.",
												"type": "boolean"
											},
											"label": {
												"description": "Put this label on it, by name.",
												"anyOf": [
													{
														"type": "string",
														"minLength": 1,
														"maxLength": 60
													},
													{
														"type": "string",
														"const": ""
													}
												]
											},
											"forward": {
												"description": "Forward it to this address. Asks for a passkey.",
												"anyOf": [
													{
														"type": "string"
													},
													{
														"type": "string",
														"const": ""
													}
												]
											},
											"delete": {
												"description": "Move it to Trash.",
												"type": "boolean"
											},
											"neverJunk": {
												"description": "Never send it to Junk.",
												"type": "boolean"
											},
											"important": {
												"description": "Mark it important.",
												"type": "boolean"
											},
											"neverImportant": {
												"description": "Never mark it important. Beats `important`.",
												"type": "boolean"
											},
											"tab": {
												"description": "File it in this inbox tab.",
												"anyOf": [
													{
														"type": "string",
														"enum": [
															"primary",
															"updates",
															"newsletters",
															"promotions"
														]
													},
													{
														"type": "string",
														"const": ""
													}
												]
											},
											"applyExisting": {
												"description": "Also run it over the conversations already here.",
												"type": "boolean"
											}
										},
										"required": [
											"mailbox"
										]
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"from": "stripe.com",
									"label": "Finance",
									"skipInbox": true
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Rule"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/rules.update": {
			"post": {
				"operationId": "rules.update",
				"summary": "Change a rule",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"Rules"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/rules#rules.update"
				},
				"x-mailset-cli": "mailset rules update <id> [--name <name>] [--from <from>] [--to <to>] [--subject <subject>] [--has-words <has-words>] [--doesnt-have <doesnt-have>] [--has-attachment] [--larger <larger>] [--smaller <smaller>] [--skip-inbox] [--mark-read] [--star] [--label <label>] [--forward <forward>] [--delete] [--never-junk] [--important] [--never-important] [--tab primary|updates|newsletters|promotions|] [--apply-existing]",
				"x-mailset-cli-example": "mailset rules update rl_1c7e3a9f5b2d4068e4a9c2f1 --label Invoices --mark-read",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The rule’s id, from `rules list`."
											},
											"name": {
												"description": "A name for the rule, up to 120 characters.",
												"type": "string",
												"maxLength": 120
											},
											"from": {
												"description": "Mail from this sender: an address, a domain or a name.",
												"type": "string",
												"maxLength": 1500
											},
											"to": {
												"description": "Mail sent to this address.",
												"type": "string",
												"maxLength": 1500
											},
											"subject": {
												"description": "Mail with these words in its subject.",
												"type": "string",
												"maxLength": 1500
											},
											"hasWords": {
												"description": "Mail with these words anywhere in it.",
												"type": "string",
												"maxLength": 1500
											},
											"doesntHave": {
												"description": "Mail without these words.",
												"type": "string",
												"maxLength": 1500
											},
											"hasAttachment": {
												"description": "Mail that carries a file.",
												"type": "boolean"
											},
											"larger": {
												"description": "Mail larger than this: bytes, or `5M`, `500K`.",
												"anyOf": [
													{
														"type": "integer",
														"minimum": 0,
														"maximum": 9007199254740991
													},
													{
														"type": "string",
														"maxLength": 32
													}
												]
											},
											"smaller": {
												"description": "Mail smaller than this: bytes, or `5M`, `500K`.",
												"anyOf": [
													{
														"type": "integer",
														"minimum": 0,
														"maximum": 9007199254740991
													},
													{
														"type": "string",
														"maxLength": 32
													}
												]
											},
											"skipInbox": {
												"description": "Archive it as it arrives.",
												"type": "boolean"
											},
											"markRead": {
												"description": "Mark it read.",
												"type": "boolean"
											},
											"star": {
												"description": "Star it.",
												"type": "boolean"
											},
											"label": {
												"description": "Put this label on it, by name.",
												"anyOf": [
													{
														"type": "string",
														"minLength": 1,
														"maxLength": 60
													},
													{
														"type": "string",
														"const": ""
													}
												]
											},
											"forward": {
												"description": "Forward it to this address. Asks for a passkey.",
												"anyOf": [
													{
														"type": "string"
													},
													{
														"type": "string",
														"const": ""
													}
												]
											},
											"delete": {
												"description": "Move it to Trash.",
												"type": "boolean"
											},
											"neverJunk": {
												"description": "Never send it to Junk.",
												"type": "boolean"
											},
											"important": {
												"description": "Mark it important.",
												"type": "boolean"
											},
											"neverImportant": {
												"description": "Never mark it important. Beats `important`.",
												"type": "boolean"
											},
											"tab": {
												"description": "File it in this inbox tab.",
												"anyOf": [
													{
														"type": "string",
														"enum": [
															"primary",
															"updates",
															"newsletters",
															"promotions"
														]
													},
													{
														"type": "string",
														"const": ""
													}
												]
											},
											"applyExisting": {
												"description": "Also run it over the conversations already here.",
												"type": "boolean"
											}
										},
										"required": [
											"id"
										]
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"label": "Invoices",
									"markRead": true,
									"id": "rl_1c7e3a9f5b2d4068e4a9c2f1"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Rule"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/rules.remove": {
			"post": {
				"operationId": "rules.remove",
				"summary": "Delete a rule",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Rules"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/rules#rules.remove"
				},
				"x-mailset-cli": "mailset rules remove <id>",
				"x-mailset-cli-example": "mailset rules remove rl_1c7e3a9f5b2d4068e4a9c2f1",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The rule’s id, from `rules list`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "rl_1c7e3a9f5b2d4068e4a9c2f1"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean"
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/rules.reorder": {
			"post": {
				"operationId": "rules.reorder",
				"summary": "Set the order a mailbox’s rules run in",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Rules"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/rules#rules.reorder"
				},
				"x-mailset-cli": "mailset rules reorder --mailbox <mailbox> --ids <a,b,…>",
				"x-mailset-cli-example": "mailset rules reorder --mailbox ana@example.com --ids rl_9a2f6c1e8b4d3057c1e6a3b8,rl_1c7e3a9f5b2d4068e4a9c2f1",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "The mailbox whose rules these are.",
												"type": "string"
											},
											"ids": {
												"minItems": 1,
												"maxItems": 1000,
												"type": "array",
												"items": {
													"type": "string",
													"minLength": 1
												},
												"description": "Every rule’s id, in the order they should run."
											}
										},
										"required": [
											"mailbox",
											"ids"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"ids": [
										"rl_9a2f6c1e8b4d3057c1e6a3b8",
										"rl_1c7e3a9f5b2d4068e4a9c2f1"
									]
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Rule"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/rules.test": {
			"post": {
				"operationId": "rules.test",
				"summary": "Show what a rule would match, without doing anything",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Rules"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/rules#rules.test"
				},
				"x-mailset-cli": "mailset rules test [<id>] [--mailbox <mailbox>] [--name <name>] [--from <from>] [--to <to>] [--subject <subject>] [--has-words <has-words>] [--doesnt-have <doesnt-have>] [--has-attachment] [--larger <larger>] [--smaller <smaller>] [--skip-inbox] [--mark-read] [--star] [--label <label>] [--forward <forward>] [--delete] [--never-junk] [--important] [--never-important] [--tab primary|updates|newsletters|promotions|]",
				"x-mailset-cli-example": "mailset rules test --mailbox ana@example.com --from stripe.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"description": "A rule you have, by its id. Left out: the flags describe one.",
												"type": "string",
												"minLength": 1
											},
											"mailbox": {
												"description": "The mailbox to test against, for a rule described by flags.",
												"type": "string"
											},
											"name": {
												"description": "A name for the rule, up to 120 characters.",
												"type": "string",
												"maxLength": 120
											},
											"from": {
												"description": "Mail from this sender: an address, a domain or a name.",
												"type": "string",
												"maxLength": 1500
											},
											"to": {
												"description": "Mail sent to this address.",
												"type": "string",
												"maxLength": 1500
											},
											"subject": {
												"description": "Mail with these words in its subject.",
												"type": "string",
												"maxLength": 1500
											},
											"hasWords": {
												"description": "Mail with these words anywhere in it.",
												"type": "string",
												"maxLength": 1500
											},
											"doesntHave": {
												"description": "Mail without these words.",
												"type": "string",
												"maxLength": 1500
											},
											"hasAttachment": {
												"description": "Mail that carries a file.",
												"type": "boolean"
											},
											"larger": {
												"description": "Mail larger than this: bytes, or `5M`, `500K`.",
												"anyOf": [
													{
														"type": "integer",
														"minimum": 0,
														"maximum": 9007199254740991
													},
													{
														"type": "string",
														"maxLength": 32
													}
												]
											},
											"smaller": {
												"description": "Mail smaller than this: bytes, or `5M`, `500K`.",
												"anyOf": [
													{
														"type": "integer",
														"minimum": 0,
														"maximum": 9007199254740991
													},
													{
														"type": "string",
														"maxLength": 32
													}
												]
											},
											"skipInbox": {
												"description": "Archive it as it arrives.",
												"type": "boolean"
											},
											"markRead": {
												"description": "Mark it read.",
												"type": "boolean"
											},
											"star": {
												"description": "Star it.",
												"type": "boolean"
											},
											"label": {
												"description": "Put this label on it, by name.",
												"anyOf": [
													{
														"type": "string",
														"minLength": 1,
														"maxLength": 60
													},
													{
														"type": "string",
														"const": ""
													}
												]
											},
											"forward": {
												"description": "Forward it to this address. Asks for a passkey.",
												"anyOf": [
													{
														"type": "string"
													},
													{
														"type": "string",
														"const": ""
													}
												]
											},
											"delete": {
												"description": "Move it to Trash.",
												"type": "boolean"
											},
											"neverJunk": {
												"description": "Never send it to Junk.",
												"type": "boolean"
											},
											"important": {
												"description": "Mark it important.",
												"type": "boolean"
											},
											"neverImportant": {
												"description": "Never mark it important. Beats `important`.",
												"type": "boolean"
											},
											"tab": {
												"description": "File it in this inbox tab.",
												"anyOf": [
													{
														"type": "string",
														"enum": [
															"primary",
															"updates",
															"newsletters",
															"promotions"
														]
													},
													{
														"type": "string",
														"const": ""
													}
												]
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"from": "stripe.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"matched": {
													"type": "number"
												},
												"sample": {
													"type": "array",
													"items": {
														"$ref": "#/components/schemas/Conversation"
													},
													"description": "The newest few, to check by eye."
												},
												"capped": {
													"type": "boolean",
													"description": "The count stopped at the scan limit, so there may be more."
												}
											},
											"required": [
												"matched",
												"sample",
												"capped"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/rules.apply": {
			"post": {
				"operationId": "rules.apply",
				"summary": "Run a rule over the conversations already here, in the background",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Rules"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/rules#rules.apply"
				},
				"x-mailset-cli": "mailset rules apply <id>",
				"x-mailset-cli-example": "mailset rules apply rl_1c7e3a9f5b2d4068e4a9c2f1",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The rule’s id, from `rules list`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "rl_1c7e3a9f5b2d4068e4a9c2f1"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string",
													"description": "The run’s id."
												},
												"state": {
													"type": "string",
													"enum": [
														"running",
														"done",
														"failed"
													],
													"description": "`running`, `done` or `failed`."
												},
												"scanned": {
													"type": "number",
													"description": "Conversations looked at so far."
												},
												"changed": {
													"type": "number",
													"description": "Of those, how many the rule changed."
												},
												"reason": {
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"id",
												"state",
												"scanned",
												"changed",
												"reason"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/rules.import": {
			"post": {
				"operationId": "rules.import",
				"summary": "Turn a Gmail mailFilters.xml export into rules",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"Rules"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/rules#rules.import"
				},
				"x-mailset-cli": "mailset rules import <mailbox> --file <path>",
				"x-mailset-cli-example": "mailset rules import ana@example.com --file mailFilters.xml",
				"x-mailset-passkey": true,
				"x-mailset-max-body-bytes": 8388608,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "The mailbox the rules go on.",
												"type": "string"
											},
											"name": {
												"type": "string",
												"minLength": 1,
												"maxLength": 255,
												"description": "The file’s name."
											},
											"data": {
												"type": "string",
												"minLength": 1,
												"description": "The file, base64."
											}
										},
										"required": [
											"mailbox",
											"name",
											"data"
										]
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"name": "mailFilters.xml",
									"data": "<base64 of the file>"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"imported": {
													"type": "number"
												},
												"skipped": {
													"type": "number"
												},
												"items": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"filter": {
																"type": "string",
																"description": "The filter in the file’s own words: `from:a subject:b`."
															},
															"rule": {
																"description": "Null when it wasn’t imported.",
																"type": [
																	"string",
																	"null"
																]
															},
															"notes": {
																"type": "array",
																"items": {
																	"type": "string"
																},
																"description": "Why it, or a part of it, was left out."
															}
														},
														"required": [
															"filter",
															"rule",
															"notes"
														],
														"additionalProperties": false
													}
												}
											},
											"required": [
												"imported",
												"skipped",
												"items"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/messages.send": {
			"post": {
				"operationId": "messages.send",
				"summary": "Send mail from one of your addresses. A reply (threadId) carries the message it answers under your text, as Gmail quotes it; quote false sends it bare",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Messages"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#messages.send"
				},
				"x-mailset-cli": "mailset messages send --from <from> --text <text> [--to <a,b,…>] [--cc <a,b,…>] [--bcc <a,b,…>] [--subject <subject>] [--thread-id <thread-id>] [--delay-seconds <n>] [--send-at <n>] [--draft-id <draft-id>] [--markdown] [--quote] [--answering <answering>]",
				"x-mailset-cli-example": "mailset messages send --from ana@example.com --to maria@example.com --subject \"Quote for March\" --text \"Hi Maria, the quote is attached.\"",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"from": {
												"description": "One of your addresses.",
												"type": "string"
											},
											"to": {
												"default": [],
												"description": "Who it goes to, up to 100 addresses.",
												"maxItems": 100,
												"type": "array",
												"items": {
													"type": "string"
												}
											},
											"cc": {
												"default": [],
												"description": "Who gets a copy, up to 100 addresses.",
												"maxItems": 100,
												"type": "array",
												"items": {
													"type": "string"
												}
											},
											"bcc": {
												"default": [],
												"description": "Who gets a copy the others don’t see, up to 100 addresses.",
												"maxItems": 100,
												"type": "array",
												"items": {
													"type": "string"
												}
											},
											"subject": {
												"default": "",
												"description": "The subject, on one line.",
												"type": "string",
												"maxLength": 998
											},
											"text": {
												"type": "string",
												"maxLength": 5000000,
												"description": "The message’s text."
											},
											"threadId": {
												"description": "Answering this conversation.",
												"type": "string",
												"minLength": 1
											},
											"delaySeconds": {
												"default": 0,
												"description": "Seconds to hold it so it can be taken back, 0 to 120.",
												"type": "integer",
												"minimum": 0,
												"maximum": 120
											},
											"sendAt": {
												"description": "Scheduled send: when, in ms since the epoch.",
												"type": "integer",
												"exclusiveMinimum": 0,
												"maximum": 9007199254740991
											},
											"draftId": {
												"description": "The draft this came from. It goes once the mail has.",
												"type": "string",
												"minLength": 1
											},
											"markdown": {
												"default": false,
												"description": "`text` has **bold**, *italic*, lists, quotes or links to send as formatting.",
												"type": "boolean"
											},
											"quote": {
												"default": true,
												"description": "A reply carries the message it answers under the new text, added here at send time. False sends the new text alone.",
												"type": "boolean"
											},
											"answering": {
												"description": "The conversation’s message this answers, for that quote: the newest that arrived unless given.",
												"type": "string",
												"minLength": 1
											}
										},
										"required": [
											"from",
											"text"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"from": "ana@example.com",
									"to": [
										"maria@example.com"
									],
									"subject": "Quote for March",
									"text": "Hi Maria, the quote is attached."
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string",
													"description": "Mailset’s id for this send."
												},
												"messageId": {
													"description": "The id its message will have in the conversation once it goes.",
													"type": "string"
												},
												"sendAt": {
													"type": "number",
													"description": "When it goes out, in milliseconds since 1970: the time asked, or later when a limit holds it."
												},
												"held": {
													"description": "Why it waits past the time asked: a sending limit that clears by waiting.",
													"type": "string"
												},
												"raisable": {
													"description": "True when what holds it is one of the plan’s sending limits, which Mailset support can raise.",
													"type": "boolean"
												}
											},
											"required": [
												"id",
												"sendAt"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/messages.markUnread": {
			"post": {
				"operationId": "messages.markUnread",
				"summary": "Mark a conversation unread from this message on",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Messages"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#messages.markUnread"
				},
				"x-mailset-cli": "mailset messages markUnread <id>",
				"x-mailset-cli-example": "mailset messages markUnread msg_91b7e4c2a6f03d58b1c4e7a9",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The message’s id, from `threads get`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "msg_91b7e4c2a6f03d58b1c4e7a9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"threadId": {
													"type": "string",
													"description": "The conversation it’s in."
												}
											},
											"required": [
												"threadId"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/messages.original": {
			"post": {
				"operationId": "messages.original",
				"summary": "Get a message as it arrived, as an .eml file",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Messages"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#messages.original"
				},
				"x-mailset-cli": "mailset messages original <id>",
				"x-mailset-cli-example": "mailset messages original msg_91b7e4c2a6f03d58b1c4e7a9",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The message’s id, from `threads get`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "msg_91b7e4c2a6f03d58b1c4e7a9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string",
													"description": "A file name for it, ending in `.eml`."
												},
												"data": {
													"type": "string",
													"description": "The raw message, base64."
												}
											},
											"required": [
												"name",
												"data"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/messages.star": {
			"post": {
				"operationId": "messages.star",
				"summary": "Star one message, or take its star off",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Messages"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#messages.star"
				},
				"x-mailset-cli": "mailset messages star <id> [--starred]",
				"x-mailset-cli-example": "mailset messages star msg_91b7e4c2a6f03d58b1c4e7a9",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The message’s id, from `threads get`."
											},
											"starred": {
												"default": true,
												"description": "True to star it, false to take the star off.",
												"type": "boolean"
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "msg_91b7e4c2a6f03d58b1c4e7a9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"threadId": {
													"type": "string",
													"description": "The conversation it’s in."
												},
												"starred": {
													"type": "boolean",
													"description": "Whether the conversation is still starred."
												}
											},
											"required": [
												"threadId",
												"starred"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/messages.delete": {
			"post": {
				"operationId": "messages.delete",
				"summary": "Delete one message for good, with its files",
				"description": "Any signed-in person, with an API token. It can stop for a passkey approval.",
				"tags": [
					"Messages"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#messages.delete"
				},
				"x-mailset-cli": "mailset messages delete <id>",
				"x-mailset-cli-example": "mailset messages delete msg_91b7e4c2a6f03d58b1c4e7a9",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The message’s id, from `threads get`."
											}
										},
										"required": [
											"id"
										]
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "msg_91b7e4c2a6f03d58b1c4e7a9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"threadId": {
													"type": "string",
													"description": "The conversation it was in."
												},
												"threadRemoved": {
													"type": "boolean",
													"description": "True when it was the conversation’s last message, so the conversation went too."
												}
											},
											"required": [
												"threadId",
												"threadRemoved"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/messages.report": {
			"post": {
				"operationId": "messages.report",
				"summary": "Report one message as junk or phishing, and move it to Junk",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Messages"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#messages.report"
				},
				"x-mailset-cli": "mailset messages report <id> [--kind junk|phishing]",
				"x-mailset-cli-example": "mailset messages report msg_91b7e4c2a6f03d58b1c4e7a9 --kind phishing",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The message’s id, from `threads get`."
											},
											"kind": {
												"default": "junk",
												"description": "`junk` or `phishing`.",
												"type": "string",
												"enum": [
													"junk",
													"phishing"
												]
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"kind": "phishing",
									"id": "msg_91b7e4c2a6f03d58b1c4e7a9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"threadId": {
													"type": "string",
													"description": "The conversation it’s in."
												}
											},
											"required": [
												"threadId"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/blocks.list": {
			"post": {
				"operationId": "blocks.list",
				"summary": "List the senders blocked in your mailboxes",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Blocked senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/blocks#blocks.list"
				},
				"x-mailset-cli": "mailset blocks list",
				"x-mailset-cli-example": "mailset blocks list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"mailbox": {
														"type": "string",
														"description": "The mailbox the block is on."
													},
													"address": {
														"type": "string",
														"description": "The blocked sender."
													},
													"createdAt": {
														"type": "number",
														"description": "When they were blocked, in milliseconds since 1970."
													},
													"discarded": {
														"type": "number",
														"description": "How many of their messages were discarded since."
													},
													"unsubscribe": {
														"anyOf": [
															{
																"type": "string",
																"enum": [
																	"pending",
																	"sent",
																	"failed",
																	"none"
																]
															},
															{
																"type": "null"
															}
														],
														"description": "Whether they were asked to stop sending, too. Null for an older block."
													}
												},
												"required": [
													"mailbox",
													"address",
													"createdAt",
													"discarded",
													"unsubscribe"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/blocks.add": {
			"post": {
				"operationId": "blocks.add",
				"summary": "Discard a sender’s new mail in one mailbox",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Blocked senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/blocks#blocks.add"
				},
				"x-mailset-cli": "mailset blocks add <address> --mailbox <mailbox> [--everywhere]",
				"x-mailset-cli-example": "mailset blocks add offers@example.net --mailbox ana@example.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "One of your mailboxes, by address.",
												"type": "string"
											},
											"address": {
												"description": "The sender’s address.",
												"type": "string"
											},
											"everywhere": {
												"description": "In every mailbox you can open, not only this one.",
												"type": "boolean"
											}
										},
										"required": [
											"mailbox",
											"address"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"address": "offers@example.net"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"mailbox": {
														"type": "string",
														"description": "The mailbox the block is on."
													},
													"address": {
														"type": "string",
														"description": "The blocked sender."
													},
													"createdAt": {
														"type": "number",
														"description": "When they were blocked, in milliseconds since 1970."
													},
													"discarded": {
														"type": "number",
														"description": "How many of their messages were discarded since."
													},
													"unsubscribe": {
														"anyOf": [
															{
																"type": "string",
																"enum": [
																	"pending",
																	"sent",
																	"failed",
																	"none"
																]
															},
															{
																"type": "null"
															}
														],
														"description": "Whether they were asked to stop sending, too. Null for an older block."
													}
												},
												"required": [
													"mailbox",
													"address",
													"createdAt",
													"discarded",
													"unsubscribe"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/blocks.addMany": {
			"post": {
				"operationId": "blocks.addMany",
				"summary": "Block several senders at once, each in its own mailbox",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Blocked senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/blocks#blocks.addMany"
				},
				"x-mailset-cli": "mailset blocks addMany --senders <json>",
				"x-mailset-cli-example": "mailset blocks addMany --senders @senders.json",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"senders": {
												"minItems": 1,
												"maxItems": 100,
												"type": "array",
												"items": {
													"type": "object",
													"properties": {
														"mailbox": {
															"description": "One of your mailboxes, by address.",
															"type": "string"
														},
														"address": {
															"description": "The sender’s address.",
															"type": "string"
														}
													},
													"required": [
														"mailbox",
														"address"
													]
												},
												"description": "The senders to block, each with the mailbox to block it in. Up to 100."
											}
										},
										"required": [
											"senders"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"senders": [
										{
											"mailbox": "ana@example.com",
											"address": "offers@example.net"
										},
										{
											"mailbox": "ana@example.com",
											"address": "deals@example.org"
										}
									]
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"mailbox": {
														"type": "string",
														"description": "The mailbox the block is on."
													},
													"address": {
														"type": "string",
														"description": "The blocked sender."
													},
													"createdAt": {
														"type": "number",
														"description": "When they were blocked, in milliseconds since 1970."
													},
													"discarded": {
														"type": "number",
														"description": "How many of their messages were discarded since."
													},
													"unsubscribe": {
														"anyOf": [
															{
																"type": "string",
																"enum": [
																	"pending",
																	"sent",
																	"failed",
																	"none"
																]
															},
															{
																"type": "null"
															}
														],
														"description": "Whether they were asked to stop sending, too. Null for an older block."
													}
												},
												"required": [
													"mailbox",
													"address",
													"createdAt",
													"discarded",
													"unsubscribe"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/blocks.remove": {
			"post": {
				"operationId": "blocks.remove",
				"summary": "Stop blocking a sender",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Blocked senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/blocks#blocks.remove"
				},
				"x-mailset-cli": "mailset blocks remove <address> --mailbox <mailbox> [--everywhere]",
				"x-mailset-cli-example": "mailset blocks remove offers@example.net --mailbox ana@example.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "One of your mailboxes, by address.",
												"type": "string"
											},
											"address": {
												"description": "The sender’s address.",
												"type": "string"
											},
											"everywhere": {
												"description": "In every mailbox you can open, not only this one.",
												"type": "boolean"
											}
										},
										"required": [
											"mailbox",
											"address"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"address": "offers@example.net"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean",
													"description": "True when there was a block to remove."
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/senders.list": {
			"post": {
				"operationId": "senders.list",
				"summary": "List who writes to your mailboxes, and how much of it you open",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/senders#senders.list"
				},
				"x-mailset-cli": "mailset senders list [--mailbox <mailbox>] [--query <query>]",
				"x-mailset-cli-example": "mailset senders list --mailbox ana@example.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "Only this mailbox’s senders.",
												"type": "string"
											},
											"query": {
												"description": "Only senders whose name or address has this in it.",
												"type": "string",
												"minLength": 1,
												"maxLength": 100
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"mailbox": {
														"type": "string",
														"description": "The mailbox they write to."
													},
													"address": {
														"type": "string",
														"description": "Their address."
													},
													"name": {
														"description": "Their name, or null when their mail gave none.",
														"type": [
															"string",
															"null"
														]
													},
													"state": {
														"type": "string",
														"enum": [
															"new",
															"allowed",
															"blocked"
														],
														"description": "`new` until you decide, then `allowed` or `blocked`."
													},
													"count": {
														"type": "number",
														"description": "How many messages of theirs are kept, outside Junk and Trash."
													},
													"opened": {
														"type": "number",
														"description": "How many of those were opened."
													},
													"recent": {
														"type": "number",
														"description": "How many arrived in the last 90 days."
													},
													"recentOpened": {
														"type": "number",
														"description": "How many of the recent ones were opened."
													},
													"firstAt": {
														"description": "When their first message came, in milliseconds since 1970. Null when nothing of theirs is kept.",
														"type": [
															"number",
															"null"
														]
													},
													"lastAt": {
														"description": "When their newest message came, in milliseconds since 1970. Null when nothing of theirs is kept.",
														"type": [
															"number",
															"null"
														]
													},
													"tab": {
														"anyOf": [
															{
																"type": "string",
																"enum": [
																	"primary",
																	"updates",
																	"newsletters",
																	"promotions"
																]
															},
															{
																"type": "null"
															}
														],
														"description": "The tab their latest conversation is in."
													},
													"subject": {
														"description": "What their latest message is about, for a sender still to decide on.",
														"type": [
															"string",
															"null"
														]
													},
													"blockedAt": {
														"description": "When they were blocked, in milliseconds since 1970, or null.",
														"type": [
															"number",
															"null"
														]
													},
													"discarded": {
														"type": "number",
														"description": "How many of their messages were discarded since the block."
													},
													"unsubscribe": {
														"anyOf": [
															{
																"type": "string",
																"enum": [
																	"pending",
																	"sent",
																	"failed",
																	"none"
																]
															},
															{
																"type": "null"
															}
														],
														"description": "A blocked sender: whether they were asked to stop sending, too."
													},
													"picture": {
														"anyOf": [
															{
																"type": "object",
																"properties": {
																	"url": {
																		"type": "string",
																		"description": "A short-lived URL of the picture."
																	},
																	"icon": {
																		"type": "boolean",
																		"description": "It is a site’s icon, drawn smaller on a neutral tile."
																	}
																},
																"required": [
																	"url",
																	"icon"
																],
																"additionalProperties": false
															},
															{
																"type": "null"
															}
														],
														"description": "Their picture, or null for initials."
													},
													"mailset": {
														"description": "Mailset’s own sign-in, security and billing mail: never new, and it can’t be blocked. Present only when true.",
														"type": "boolean",
														"const": true
													}
												},
												"required": [
													"mailbox",
													"address",
													"name",
													"state",
													"count",
													"opened",
													"recent",
													"recentOpened",
													"firstAt",
													"lastAt",
													"tab",
													"subject",
													"blockedAt",
													"discarded",
													"unsubscribe",
													"picture"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/senders.keep": {
			"post": {
				"operationId": "senders.keep",
				"summary": "Say yes to a new sender, so they stop showing as new",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/senders#senders.keep"
				},
				"x-mailset-cli": "mailset senders keep <address> --mailbox <mailbox>",
				"x-mailset-cli-example": "mailset senders keep news@example.org --mailbox ana@example.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "One of your mailboxes, by address.",
												"type": "string"
											},
											"address": {
												"description": "The sender’s address.",
												"type": "string"
											}
										},
										"required": [
											"mailbox",
											"address"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"address": "news@example.org"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"kept": {
													"type": "boolean",
													"description": "True when the sender was new and is now allowed."
												}
											},
											"required": [
												"kept"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/senders.get": {
			"post": {
				"operationId": "senders.get",
				"summary": "Show how one sender’s mail arrived and what they wrote lately",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/senders#senders.get"
				},
				"x-mailset-cli": "mailset senders get <address> --mailbox <mailbox>",
				"x-mailset-cli-example": "mailset senders get news@example.org --mailbox ana@example.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "One of your mailboxes, by address.",
												"type": "string"
											},
											"address": {
												"description": "The sender’s address.",
												"type": "string"
											}
										},
										"required": [
											"mailbox",
											"address"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"address": "news@example.org"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"mailbox": {
													"type": "string",
													"description": "The mailbox they write to."
												},
												"address": {
													"type": "string",
													"description": "Their address."
												},
												"auth": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"tls": {
																	"type": "boolean",
																	"description": "It arrived over an encrypted connection."
																},
																"spf": {
																	"type": "boolean",
																	"description": "SPF passed."
																},
																"dkim": {
																	"type": "boolean",
																	"description": "DKIM passed."
																},
																"dmarc": {
																	"type": "boolean",
																	"description": "DMARC passed."
																},
																"forged": {
																	"description": "The sender’s domain says this From is not theirs: DMARC ran and failed.",
																	"type": "boolean"
																}
															},
															"required": [
																"tls",
																"spf",
																"dkim",
																"dmarc"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													],
													"description": "How their newest message arrived. Null when nothing of theirs is kept, or it was imported."
												},
												"imported": {
													"description": "Their newest message was imported: whether Google, where it arrived, said it is really from their domain.",
													"type": "boolean"
												},
												"byMailset": {
													"description": "Their newest message was filed here by Mailset itself. Present only when true.",
													"type": "boolean",
													"const": true
												},
												"answered": {
													"type": "boolean",
													"description": "You have written in one of their conversations."
												},
												"threads": {
													"type": "array",
													"items": {
														"$ref": "#/components/schemas/Conversation"
													},
													"description": "Their newest conversations, newest first."
												}
											},
											"required": [
												"mailbox",
												"address",
												"auth",
												"answered",
												"threads"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/senders.unsubscribe": {
			"post": {
				"operationId": "senders.unsubscribe",
				"summary": "Ask a sender to stop writing to one mailbox, by the newest mail they sent it",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/senders#senders.unsubscribe"
				},
				"x-mailset-cli": "mailset senders unsubscribe <address> --mailbox <mailbox>",
				"x-mailset-cli-example": "mailset senders unsubscribe news@example.org --mailbox ana@example.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "One of your mailboxes, by address.",
												"type": "string"
											},
											"address": {
												"description": "The sender’s address.",
												"type": "string"
											}
										},
										"required": [
											"mailbox",
											"address"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"address": "news@example.org"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"state": {
													"type": "string",
													"enum": [
														"sent",
														"failed",
														"link",
														"none"
													]
												},
												"url": {
													"type": "string"
												}
											},
											"required": [
												"state"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/messages.unsubscribe": {
			"post": {
				"operationId": "messages.unsubscribe",
				"summary": "Unsubscribe from whoever sent a message: asked for you, or their page to open",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Messages"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#messages.unsubscribe"
				},
				"x-mailset-cli": "mailset messages unsubscribe <id>",
				"x-mailset-cli-example": "mailset messages unsubscribe msg_91b7e4c2a6f03d58b1c4e7a9",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The message’s id, from `threads get`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "msg_91b7e4c2a6f03d58b1c4e7a9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"state": {
													"type": "string",
													"enum": [
														"sent",
														"failed",
														"link",
														"none"
													]
												},
												"url": {
													"type": "string"
												}
											},
											"required": [
												"state"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/senders.trash": {
			"post": {
				"operationId": "senders.trash",
				"summary": "Move what a sender sent to one mailbox into Trash",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Senders"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/senders#senders.trash"
				},
				"x-mailset-cli": "mailset senders trash <address> --mailbox <mailbox>",
				"x-mailset-cli-example": "mailset senders trash offers@example.net --mailbox ana@example.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"mailbox": {
												"description": "One of your mailboxes, by address.",
												"type": "string"
											},
											"address": {
												"description": "The sender’s address.",
												"type": "string"
											}
										},
										"required": [
											"mailbox",
											"address"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"mailbox": "ana@example.com",
									"address": "offers@example.net"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"threads": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string",
																"description": "The conversation’s id."
															},
															"from": {
																"type": "string",
																"enum": [
																	"inbox",
																	"archived"
																],
																"description": "Where it was, so the move can be undone."
															}
														},
														"required": [
															"id",
															"from"
														],
														"additionalProperties": false
													},
													"description": "The conversations moved, and where each was."
												}
											},
											"required": [
												"threads"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/messages.submit": {
			"post": {
				"operationId": "messages.submit",
				"summary": "Send a whole RFC 5322 message as written",
				"description": "An app key that may send as the mailbox, or as the addresses it names on the domain. Or a person: any signed-in person, with an API token.",
				"tags": [
					"Messages"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#messages.submit"
				},
				"x-mailset-cli": "mailset messages submit --file <path> [--transactional] [--mode transactional|promotional] [--deliver-by <n>]",
				"x-mailset-cli-example": "mailset messages submit --file receipt.eml --transactional",
				"x-mailset-grant": "send",
				"x-mailset-max-body-bytes": 27966123,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"data": {
												"type": "string",
												"minLength": 1,
												"description": "The whole RFC 5322 message, in base64, up to 20 MB."
											},
											"transactional": {
												"default": false,
												"description": "A product’s own mail: no copy in Sent, nobody added to contacts, and only the delivery log remembers it.",
												"type": "boolean"
											},
											"mode": {
												"description": "The kind of product mail. `transactional`: a code or a receipt, which can’t carry List-Unsubscribe or Precedence: bulk. `promotional`: a newsletter or an offer, to one address in To; with no List-Unsubscribe of its own, Mailset adds a one-click one and puts the link at `{{mailset_unsubscribe}}` in the body, or on a last line.",
												"type": "string",
												"enum": [
													"transactional",
													"promotional"
												]
											},
											"deliverBy": {
												"description": "The latest it may go out, in milliseconds since 1970. Held past it at submit, it is refused with `retryAt`; still waiting when it comes, it is dropped unsent.",
												"type": "integer",
												"exclusiveMinimum": 0,
												"maximum": 9007199254740991
											}
										},
										"required": [
											"data"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"transactional": true,
									"name": "receipt.eml",
									"data": "<the message as base64>"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Receipt"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/messages.submitMany": {
			"post": {
				"operationId": "messages.submitMany",
				"summary": "Send up to 100 whole messages, each with its own answer",
				"description": "An app key that may send as the mailbox, or as the addresses it names on the domain. Or a person: any signed-in person, with an API token.",
				"tags": [
					"Messages"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#messages.submitMany"
				},
				"x-mailset-cli": "mailset messages submitMany --messages <json>",
				"x-mailset-cli-example": "mailset messages submitMany --messages @messages.json",
				"x-mailset-grant": "send",
				"x-mailset-max-body-bytes": 67211264,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"messages": {
												"minItems": 1,
												"maxItems": 100,
												"type": "array",
												"items": {
													"type": "object",
													"properties": {
														"data": {
															"type": "string",
															"minLength": 1,
															"description": "The whole RFC 5322 message, in base64, up to 20 MB."
														},
														"transactional": {
															"default": false,
															"description": "A product’s own mail: no copy in Sent, nobody added to contacts, and only the delivery log remembers it.",
															"type": "boolean"
														},
														"mode": {
															"description": "The kind of product mail. `transactional`: a code or a receipt, which can’t carry List-Unsubscribe or Precedence: bulk. `promotional`: a newsletter or an offer, to one address in To; with no List-Unsubscribe of its own, Mailset adds a one-click one and puts the link at `{{mailset_unsubscribe}}` in the body, or on a last line.",
															"type": "string",
															"enum": [
																"transactional",
																"promotional"
															]
														},
														"deliverBy": {
															"description": "The latest it may go out, in milliseconds since 1970. Held past it at submit, it is refused with `retryAt`; still waiting when it comes, it is dropped unsent.",
															"type": "integer",
															"exclusiveMinimum": 0,
															"maximum": 9007199254740991
														}
													},
													"required": [
														"data"
													]
												},
												"description": "The messages, 1 to 100, each as `messages submit` takes one. 48 MB together, before base64."
											}
										},
										"required": [
											"messages"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"messages": [
										{
											"data": "<the message as base64>",
											"transactional": true
										}
									]
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"results": {
													"type": "array",
													"items": {
														"anyOf": [
															{
																"type": "object",
																"properties": {
																	"id": {
																		"type": "string",
																		"description": "Mailset’s id for this send."
																	},
																	"messageId": {
																		"description": "The id its message will have in the conversation once it goes.",
																		"type": "string"
																	},
																	"sendAt": {
																		"type": "number",
																		"description": "When it goes out, in milliseconds since 1970: the time asked, or later when a limit holds it."
																	},
																	"held": {
																		"description": "Why it waits past the time asked: a sending limit that clears by waiting.",
																		"type": "string"
																	},
																	"raisable": {
																		"description": "True when what holds it is one of the plan’s sending limits, which Mailset support can raise.",
																		"type": "boolean"
																	},
																	"state": {
																		"type": "string",
																		"enum": [
																			"sent",
																			"queued"
																		],
																		"description": "`sent`: it went, or every recipient was skipped and nothing is left to do. `queued`: Mailset holds it and sends it at `sendAt`."
																	},
																	"skipped": {
																		"description": "Recipients Mailset left out. They never get it, the others do, and there is nothing to retry. Absent when nobody was skipped.",
																		"type": "array",
																		"items": {
																			"type": "object",
																			"properties": {
																				"address": {
																					"type": "string",
																					"description": "The address that was left out."
																				},
																				"reason": {
																					"type": "string",
																					"enum": [
																						"private_relay",
																						"disposable",
																						"unsubscribed"
																					],
																					"description": "`private_relay`: an Apple Hide My Email address. `disposable`: a temporary inbox. `unsubscribed`: it unsubscribed from this mailbox’s promotional mail."
																				}
																			},
																			"required": [
																				"address",
																				"reason"
																			],
																			"additionalProperties": false
																		}
																	},
																	"ok": {
																		"type": "boolean",
																		"const": true,
																		"description": "Mailset took this message."
																	}
																},
																"required": [
																	"id",
																	"sendAt",
																	"state",
																	"ok"
																],
																"additionalProperties": false
															},
															{
																"type": "object",
																"properties": {
																	"ok": {
																		"type": "boolean",
																		"const": false,
																		"description": "Mailset refused this message."
																	},
																	"error": {
																		"type": "object",
																		"properties": {
																			"code": {
																				"type": "string",
																				"enum": [
																					"invalid_input",
																					"unauthorized",
																					"step_up_required",
																					"forbidden",
																					"not_found",
																					"conflict",
																					"expired",
																					"limit_reached",
																					"unavailable",
																					"internal"
																				],
																				"description": "What kind of refusal it is. The HTTP status follows from it."
																			},
																			"message": {
																				"type": "string",
																				"description": "The refusal in words, fit to show a person."
																			},
																			"issues": {
																				"description": "On `invalid_input`: each field that was wrong.",
																				"type": "array",
																				"items": {
																					"type": "object",
																					"properties": {
																						"path": {
																							"type": "array",
																							"items": {
																								"type": [
																									"string",
																									"number"
																								]
																							},
																							"description": "Which input field is wrong: its name, then any keys inside it."
																						},
																						"message": {
																							"type": "string",
																							"description": "What’s wrong with it, in words."
																						}
																					},
																					"required": [
																						"path",
																						"message"
																					],
																					"additionalProperties": false
																				}
																			},
																			"purpose": {
																				"description": "On `step_up_required`: the action a passkey has to approve.",
																				"type": "object",
																				"properties": {
																					"kind": {
																						"type": "string",
																						"enum": [
																							"device",
																							"member",
																							"passkey",
																							"domain",
																							"mailbox",
																							"token",
																							"approval",
																							"rule",
																							"forward",
																							"message",
																							"group",
																							"policy",
																							"export",
																							"account",
																							"recovery",
																							"paperkey",
																							"dns",
																							"google",
																							"ai"
																						],
																						"description": "What the action is about: a `domain`, a `mailbox`, a `member` and so on."
																					},
																					"id": {
																						"type": "string",
																						"pattern": "^[\\x21-\\x7e]{1,200}$",
																						"description": "The action itself, as text a passkey check is made for."
																					},
																					"org": {
																						"anyOf": [
																							{
																								"type": "string",
																								"minLength": 1
																							},
																							{
																								"type": "null"
																							}
																						],
																						"description": "The org it’s in. Null for an action on your own account."
																					}
																				},
																				"required": [
																					"kind",
																					"id",
																					"org"
																				],
																				"additionalProperties": false
																			},
																			"refusal": {
																				"description": "When mail was refused: why, as a short code.",
																				"type": "string",
																				"enum": [
																					"domain_pending",
																					"domain_blocked",
																					"provider_refused",
																					"recipient",
																					"mail_domain",
																					"seat_charge"
																				]
																			},
																			"retryAt": {
																				"description": "On `limit_reached` for mail with a deadline: the soonest it could go, in ms since the epoch. Send it again then, or with a later deadline.",
																				"type": "number"
																			},
																			"docs": {
																				"description": "When a sending limit refused it: the page that lists every plan’s limits, as a URL.",
																				"type": "string"
																			},
																			"support": {
																				"description": "When Mailset support can raise the limit that refused it: where to ask, as a URL.",
																				"type": "string"
																			},
																			"revoked": {
																				"description": "On `unauthorized`: this device was signed out for good, not just out of time.",
																				"type": "boolean",
																				"const": true
																			},
																			"suggestion": {
																				"description": "On a refused address: the one it likely meant, for the person to pick or ignore.",
																				"type": "string"
																			}
																		},
																		"required": [
																			"code",
																			"message"
																		],
																		"additionalProperties": false,
																		"description": "Why, as any refused call says it: a stable `code` and a `message` for people."
																	}
																},
																"required": [
																	"ok",
																	"error"
																],
																"additionalProperties": false
															}
														]
													},
													"description": "One answer per message, in the order they came: `ok: true` with its receipt, or `ok: false` with the refusal."
												}
											},
											"required": [
												"results"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/attachments.get": {
			"post": {
				"operationId": "attachments.get",
				"summary": "Download an attachment",
				"description": "An app key with `read` on the mailbox. Or a person: any signed-in person, with an API token.",
				"tags": [
					"Attachments"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/attachments#attachments.get"
				},
				"x-mailset-cli": "mailset attachments get <id>",
				"x-mailset-cli-example": "mailset attachments get att_3c9e1f7a5b2d4086c7e1a9f2 --out invoice.pdf",
				"x-mailset-grant": "read",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The attachment’s id, from the message it came on in `threads get`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "att_3c9e1f7a5b2d4086c7e1a9f2"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"name": {
													"type": "string",
													"description": "The file’s name."
												},
												"contentType": {
													"type": "string",
													"description": "Its media type, as the message declared it."
												},
												"size": {
													"type": "number",
													"description": "Its size in bytes."
												},
												"data": {
													"type": "string",
													"description": "The file, base64."
												}
											},
											"required": [
												"name",
												"contentType",
												"size",
												"data"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/messages.cancel": {
			"post": {
				"operationId": "messages.cancel",
				"summary": "Take back a message that hasn’t gone yet",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Messages"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#messages.cancel"
				},
				"x-mailset-cli": "mailset messages cancel <id>",
				"x-mailset-cli-example": "mailset messages cancel out_2e8b6d1f4a9c3075d6b1e8a4",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The waiting message’s id, from `messages send` or `messages scheduled`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "out_2e8b6d1f4a9c3075d6b1e8a4"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"cancelled": {
													"type": "boolean",
													"description": "True when it was still waiting and won’t go."
												}
											},
											"required": [
												"cancelled"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/messages.sendNow": {
			"post": {
				"operationId": "messages.sendNow",
				"summary": "Send a message held for Undo now, without waiting out its time",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Messages"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#messages.sendNow"
				},
				"x-mailset-cli": "mailset messages sendNow <id>",
				"x-mailset-cli-example": "mailset messages sendNow out_2e8b6d1f4a9c3075d6b1e8a4",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The waiting message’s id, from `messages send`."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "out_2e8b6d1f4a9c3075d6b1e8a4"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Receipt"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/messages.scheduled": {
			"post": {
				"operationId": "messages.scheduled",
				"summary": "List mail waiting for its time",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Messages"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#messages.scheduled"
				},
				"x-mailset-cli": "mailset messages scheduled",
				"x-mailset-cli-example": "mailset messages scheduled",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"id": {
														"type": "string",
														"description": "The id to cancel it or send it now by."
													},
													"mailbox": {
														"type": "string",
														"description": "The mailbox it goes out from."
													},
													"from": {
														"type": "string",
														"description": "Its From address."
													},
													"to": {
														"type": "array",
														"items": {
															"type": "string"
														},
														"description": "Who it goes to."
													},
													"subject": {
														"type": "string",
														"description": "Its subject."
													},
													"snippet": {
														"type": "string",
														"description": "The start of its text."
													},
													"sendAt": {
														"type": "number",
														"description": "When it goes out, in milliseconds since 1970."
													},
													"hasDraft": {
														"type": "boolean",
														"description": "Cancelling puts it back in Drafts."
													},
													"held": {
														"description": "Why it hasn’t gone yet when its time has come, such as a sending limit. It goes out at `sendAt`.",
														"type": "string"
													},
													"raisable": {
														"description": "True when what holds it is one of the plan’s sending limits, which Mailset support can raise.",
														"type": "boolean"
													}
												},
												"required": [
													"id",
													"mailbox",
													"from",
													"to",
													"subject",
													"snippet",
													"sendAt",
													"hasDraft"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/drafts.save": {
			"post": {
				"operationId": "drafts.save",
				"summary": "Save a draft, new or by id",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Drafts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/drafts#drafts.save"
				},
				"x-mailset-cli": "mailset drafts save --from <from> [--id <id>] [--to <to>] [--cc <cc>] [--bcc <bcc>] [--subject <subject>] [--text <text>] [--thread-id <thread-id>] [--markdown]",
				"x-mailset-cli-example": "mailset drafts save --from ana@example.com --to maria@example.com --subject \"Quote for March\" --text \"Hi Maria, the quote is attached.\"",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"description": "The draft to change. Left out: a new draft.",
												"type": "string",
												"minLength": 1
											},
											"from": {
												"description": "One of your addresses.",
												"type": "string"
											},
											"to": {
												"default": "",
												"description": "Who it goes to, as typed: addresses with commas between them.",
												"type": "string",
												"maxLength": 10000
											},
											"cc": {
												"default": "",
												"description": "Who gets a copy, as typed.",
												"type": "string",
												"maxLength": 10000
											},
											"bcc": {
												"default": "",
												"description": "Who gets a hidden copy, as typed.",
												"type": "string",
												"maxLength": 10000
											},
											"subject": {
												"default": "",
												"description": "The subject, on one line.",
												"type": "string",
												"maxLength": 998
											},
											"text": {
												"default": "",
												"description": "The draft’s text.",
												"type": "string",
												"maxLength": 1000000
											},
											"threadId": {
												"description": "The conversation it answers.",
												"type": "string",
												"minLength": 1
											},
											"markdown": {
												"default": false,
												"description": "`text` has Markdown to send as formatting.",
												"type": "boolean"
											}
										},
										"required": [
											"from"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"from": "ana@example.com",
									"to": "maria@example.com",
									"subject": "Quote for March",
									"text": "Hi Maria, the quote is attached."
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Draft"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/drafts.list": {
			"post": {
				"operationId": "drafts.list",
				"summary": "List your drafts",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Drafts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/drafts#drafts.list"
				},
				"x-mailset-cli": "mailset drafts list",
				"x-mailset-cli-example": "mailset drafts list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"$ref": "#/components/schemas/Draft"
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/drafts.remove": {
			"post": {
				"operationId": "drafts.remove",
				"summary": "Throw a draft away",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Drafts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/drafts#drafts.remove"
				},
				"x-mailset-cli": "mailset drafts remove <id>",
				"x-mailset-cli-example": "mailset drafts remove dr_7a4f2e9c1b6d3058e2c9a4f1",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The draft’s id."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "dr_7a4f2e9c1b6d3058e2c9a4f1"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean"
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/drafts.attach": {
			"post": {
				"operationId": "drafts.attach",
				"summary": "Attach a file to a draft",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Drafts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/drafts#drafts.attach"
				},
				"x-mailset-cli": "mailset drafts attach <id> --file <path> [--content-type <content-type>]",
				"x-mailset-cli-example": "mailset drafts attach dr_7a4f2e9c1b6d3058e2c9a4f1 --file quote.pdf --content-type application/pdf",
				"x-mailset-max-body-bytes": 19577515,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The draft’s id."
											},
											"name": {
												"type": "string",
												"minLength": 1,
												"maxLength": 255,
												"description": "The file’s name."
											},
											"contentType": {
												"default": "application/octet-stream",
												"description": "Its media type.",
												"type": "string",
												"maxLength": 120
											},
											"data": {
												"type": "string",
												"minLength": 1,
												"description": "The file, base64."
											}
										},
										"required": [
											"id",
											"name",
											"data"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"contentType": "application/pdf",
									"id": "dr_7a4f2e9c1b6d3058e2c9a4f1",
									"name": "quote.pdf",
									"data": "<base64 of the file>"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string",
													"description": "The file’s id."
												},
												"name": {
													"type": "string",
													"description": "Its file name."
												},
												"contentType": {
													"type": "string",
													"description": "Its media type."
												},
												"size": {
													"type": "number",
													"description": "Its size in bytes."
												},
												"scan": {
													"type": "string",
													"enum": [
														"clean",
														"infected",
														"unscanned"
													],
													"description": "What the virus scan said."
												}
											},
											"required": [
												"id",
												"name",
												"contentType",
												"size",
												"scan"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/drafts.detach": {
			"post": {
				"operationId": "drafts.detach",
				"summary": "Take a file off a draft",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Drafts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/drafts#drafts.detach"
				},
				"x-mailset-cli": "mailset drafts detach <file>",
				"x-mailset-cli-example": "mailset drafts detach att_3c9e1f7a5b2d4086c7e1a9f2",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"file": {
												"type": "string",
												"minLength": 1,
												"description": "The attached file’s id, from the draft’s `files`."
											}
										},
										"required": [
											"file"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"file": "att_3c9e1f7a5b2d4086c7e1a9f2"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean"
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/drafts.forward": {
			"post": {
				"operationId": "drafts.forward",
				"summary": "Copy a message’s attachments onto a draft",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Drafts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/drafts#drafts.forward"
				},
				"x-mailset-cli": "mailset drafts forward <id> --message-id <message-id>",
				"x-mailset-cli-example": "mailset drafts forward dr_7a4f2e9c1b6d3058e2c9a4f1 --message-id msg_91b7e4c2a6f03d58b1c4e7a9",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The draft’s id."
											},
											"messageId": {
												"type": "string",
												"minLength": 1,
												"description": "The message whose attachments are copied."
											}
										},
										"required": [
											"id",
											"messageId"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"messageId": "msg_91b7e4c2a6f03d58b1c4e7a9",
									"id": "dr_7a4f2e9c1b6d3058e2c9a4f1"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"files": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string",
																"description": "The file’s id."
															},
															"name": {
																"type": "string",
																"description": "Its file name."
															},
															"contentType": {
																"type": "string",
																"description": "Its media type."
															},
															"size": {
																"type": "number",
																"description": "Its size in bytes."
															},
															"scan": {
																"type": "string",
																"enum": [
																	"clean",
																	"infected",
																	"unscanned"
																],
																"description": "What the virus scan said."
															}
														},
														"required": [
															"id",
															"name",
															"contentType",
															"size",
															"scan"
														],
														"additionalProperties": false
													},
													"description": "The files now on the draft from that message."
												},
												"skipped": {
													"type": "number",
													"description": "How many didn’t fit, or can’t be sent on."
												}
											},
											"required": [
												"files",
												"skipped"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.status": {
			"post": {
				"operationId": "ai.status",
				"summary": "Show what runs AI in each of your orgs, anything that stopped it, and this month’s AI credit",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.status"
				},
				"x-mailset-cli": "mailset ai status",
				"x-mailset-cli-example": "mailset ai status",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"configured": {
													"type": "boolean",
													"description": "Whether Mailset’s own key is there to run AI on."
												},
												"limits": {
													"type": "object",
													"properties": {
														"calls": {
															"type": "number"
														},
														"usd": {
															"type": "number"
														}
													},
													"required": [
														"calls",
														"usd"
													],
													"additionalProperties": false,
													"description": "What each org may spend a day on Mailset’s key."
												},
												"today": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"org": {
																"type": "string"
															},
															"calls": {
																"type": "number"
															},
															"usd": {
																"type": "number"
															}
														},
														"required": [
															"org",
															"calls",
															"usd"
														],
														"additionalProperties": false
													},
													"description": "Today on Mailset’s key, per org."
												},
												"banner": {
													"anyOf": [
														{
															"type": "string",
															"enum": [
																"no_ai",
																"credit_used",
																"key_failing"
															]
														},
														{
															"type": "null"
														}
													],
													"description": "The most pressing banner among this person’s orgs: a failing key first."
												},
												"orgs": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string",
																"description": "The org’s id."
															},
															"name": {
																"type": "string",
																"description": "The org’s name."
															},
															"role": {
																"type": "string",
																"enum": [
																	"owner",
																	"admin",
																	"member"
																]
															},
															"source": {
																"type": "string",
																"enum": [
																	"mailset",
																	"own",
																	"off"
																],
																"description": "What the org chose to run AI on. `mailset`: Mailset’s key. `own`: the org’s own key. `off`: no AI."
															},
															"using": {
																"anyOf": [
																	{
																		"type": "string",
																		"enum": [
																			"mailset",
																			"own"
																		]
																	},
																	{
																		"type": "null"
																	}
																],
																"description": "What calls go to right now; null when nothing does."
															},
															"mailsetAllowed": {
																"type": "boolean",
																"description": "Mailset’s key is open to this org."
															},
															"banner": {
																"anyOf": [
																	{
																		"type": "string",
																		"enum": [
																			"no_ai",
																			"credit_used",
																			"key_failing"
																		]
																	},
																	{
																		"type": "null"
																	}
																],
																"description": "What to tell people about the org’s AI right now, if anything."
															},
															"key": {
																"anyOf": [
																	{
																		"type": "object",
																		"properties": {
																			"provider": {
																				"type": "string",
																				"enum": [
																					"anthropic"
																				],
																				"description": "Whose key it is."
																			},
																			"last4": {
																				"type": "string",
																				"description": "The key’s last four characters. The rest is never shown."
																			},
																			"state": {
																				"type": "string",
																				"enum": [
																					"ok",
																					"failing"
																				],
																				"description": "failing: the provider refused it, and the org’s AI is paused until it’s fixed."
																			},
																			"failure": {
																				"anyOf": [
																					{
																						"type": "string",
																						"enum": [
																							"invalid",
																							"no_credit"
																						]
																					},
																					{
																						"type": "null"
																					}
																				],
																				"description": "Why the key stopped working: `invalid`, or `no_credit` left on it. Null while it works."
																			},
																			"problem": {
																				"description": "What went wrong and what to do, in words. Null while it works.",
																				"type": [
																					"string",
																					"null"
																				]
																			},
																			"addedAt": {
																				"type": "number",
																				"description": "When the key was saved, in ms since the epoch."
																			},
																			"checkedAt": {
																				"type": "number",
																				"description": "When it was last tried, in ms since the epoch."
																			},
																			"limitedUntil": {
																				"description": "Until when the provider asked to slow down; null when it hasn’t.",
																				"type": [
																					"number",
																					"null"
																				]
																			}
																		},
																		"required": [
																			"provider",
																			"last4",
																			"state",
																			"failure",
																			"problem",
																			"addedAt",
																			"checkedAt",
																			"limitedUntil"
																		],
																		"additionalProperties": false
																	},
																	{
																		"type": "null"
																	}
																],
																"description": "The org’s own key. Owners and admins only."
															},
															"credit": {
																"anyOf": [
																	{
																		"type": "object",
																		"properties": {
																			"from": {
																				"type": "string",
																				"description": "The first day of this month, UTC."
																			},
																			"usd": {
																				"description": "Null: no credit limits it.",
																				"type": [
																					"number",
																					"null"
																				]
																			},
																			"usedUsd": {
																				"type": "number",
																				"description": "What calls on Mailset’s key were worth this month, at the price list."
																			},
																			"units": {
																				"type": "array",
																				"items": {
																					"type": "object",
																					"properties": {
																						"job": {
																							"type": "string",
																							"enum": [
																								"triage",
																								"phishing",
																								"summary",
																								"replies",
																								"draft",
																								"followup",
																								"search",
																								"chat"
																							]
																						},
																						"units": {
																							"type": "number"
																						}
																					},
																					"required": [
																						"job",
																						"units"
																					],
																					"additionalProperties": false
																				}
																			},
																			"usedWords": {
																				"type": "string",
																				"description": "The same in plain words: \"about 4,200 sorted emails, 37 drafts\"."
																			},
																			"display": {
																				"type": "string",
																				"enum": [
																					"bar",
																					"earlier",
																					"none"
																				]
																			}
																		},
																		"required": [
																			"from",
																			"usd",
																			"usedUsd",
																			"units",
																			"usedWords",
																			"display"
																		],
																		"additionalProperties": false
																	},
																	{
																		"type": "null"
																	}
																],
																"description": "The month’s AI credit. Owners and admins only."
															},
															"own": {
																"anyOf": [
																	{
																		"type": "object",
																		"properties": {
																			"calls": {
																				"type": "number"
																			},
																			"usd": {
																				"type": "number"
																			}
																		},
																		"required": [
																			"calls",
																			"usd"
																		],
																		"additionalProperties": false
																	},
																	{
																		"type": "null"
																	}
																],
																"description": "This month on the org’s own key, at the provider’s list prices. Owners and admins only."
															}
														},
														"required": [
															"id",
															"name",
															"role",
															"source",
															"using",
															"mailsetAllowed",
															"banner",
															"key",
															"credit",
															"own"
														],
														"additionalProperties": false
													},
													"description": "Each org you’re in, and what runs its AI."
												}
											},
											"required": [
												"configured",
												"limits",
												"today",
												"banner",
												"orgs"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.source": {
			"post": {
				"operationId": "ai.source",
				"summary": "Run the org’s AI on Mailset’s key (mailset), its own key (own), or not at all (off)",
				"description": "An admin or owner of the org.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.source"
				},
				"x-mailset-cli": "mailset ai source <source> [--org <id>]",
				"x-mailset-cli-example": "mailset ai source own",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"source": {
												"type": "string",
												"enum": [
													"mailset",
													"own",
													"off"
												],
												"description": "`mailset`: Mailset’s key. `own`: the org’s own key. `off`: no AI."
											}
										},
										"required": [
											"source"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"source": "own"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/AiSettings"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.key.set": {
			"post": {
				"operationId": "ai.key.set",
				"summary": "Check and keep the org’s own AI key, and run its AI on it. The CLI reads the key from stdin or a hidden prompt",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.key.set"
				},
				"x-mailset-cli": "mailset ai key set <provider> [--org <id>]",
				"x-mailset-cli-example": "mailset ai key set anthropic",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"provider": {
												"type": "string",
												"enum": [
													"anthropic"
												],
												"description": "Whose key it is: `anthropic`."
											},
											"key": {
												"type": "string",
												"minLength": 20,
												"maxLength": 400,
												"pattern": "^[\\x21-\\x7e]+$",
												"description": "The key itself. The CLI reads it from stdin or a hidden prompt, never from a flag."
											}
										},
										"required": [
											"provider",
											"key"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"provider": "anthropic",
									"key": "<key>"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/AiSettings"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.key.remove": {
			"post": {
				"operationId": "ai.key.remove",
				"summary": "Remove the org’s own AI key",
				"description": "An admin or owner of the org. It can stop for a passkey approval.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.key.remove"
				},
				"x-mailset-cli": "mailset ai key remove [<provider>] [--org <id>]",
				"x-mailset-cli-example": "mailset ai key remove anthropic",
				"x-mailset-role": "admin",
				"x-mailset-passkey": true,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"provider": {
												"default": "anthropic",
												"description": "Whose key it is: `anthropic`.",
												"type": "string",
												"enum": [
													"anthropic"
												]
											}
										}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									},
									"approval": {
										"type": "string",
										"description": "An approval’s id, once someone approved it with their passkey. Without one, the answer is `step_up_required` and names what to approve."
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"provider": "anthropic"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/AiSettings"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.key.check": {
			"post": {
				"operationId": "ai.key.check",
				"summary": "Try the org’s own AI key again: one that works resumes its AI, one that doesn’t pauses it",
				"description": "An admin or owner of the org.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.key.check"
				},
				"x-mailset-cli": "mailset ai key check [<provider>] [--org <id>]",
				"x-mailset-cli-example": "mailset ai key check anthropic",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"provider": {
												"default": "anthropic",
												"description": "Whose key it is: `anthropic`.",
												"type": "string",
												"enum": [
													"anthropic"
												]
											}
										}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"provider": "anthropic"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/AiSettings"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.models": {
			"post": {
				"operationId": "ai.models",
				"summary": "Show the model each AI feature uses, a month of each at your volume, and this month’s credit",
				"description": "An admin or owner of the org.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.models"
				},
				"x-mailset-cli": "mailset ai models [--org <id>]",
				"x-mailset-cli-example": "mailset ai models",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/AiSettings"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.models.set": {
			"post": {
				"operationId": "ai.models.set",
				"summary": "Pick the model one AI feature uses on the org’s own key (model default goes back to Mailset’s pick)",
				"description": "An admin or owner of the org.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.models.set"
				},
				"x-mailset-cli": "mailset ai models set <feature> --model <model> [--org <id>]",
				"x-mailset-cli-example": "mailset ai models set summaries --model claude-haiku-5-5",
				"x-mailset-role": "admin",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"feature": {
												"type": "string",
												"minLength": 1,
												"maxLength": 40,
												"description": "The feature: `sorting`, `phishing`, `summaries`, `replies`, `drafts`, `followups`, `ask` or `chat`."
											},
											"model": {
												"type": "string",
												"minLength": 1,
												"maxLength": 100,
												"description": "The model’s id, from `ai models`, or `default` for Mailset’s pick."
											}
										},
										"required": [
											"feature",
											"model"
										]
									},
									"org": {
										"type": "string",
										"description": "The org this is about. Needed when the caller is in more than one."
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"model": "claude-haiku-5-5",
									"feature": "summaries"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/AiSettings"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.summarize": {
			"post": {
				"operationId": "ai.summarize",
				"summary": "Summarize a conversation",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.summarize"
				},
				"x-mailset-cli": "mailset ai summarize <id>",
				"x-mailset-cli-example": "mailset ai summarize t_5d2c8a1f9e3b47c6a0d1e2f3",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The conversation’s id."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"text": {
													"type": [
														"string",
														"null"
													]
												},
												"reason": {
													"anyOf": [
														{
															"type": "string",
															"enum": [
																"off",
																"no_ai",
																"not_configured",
																"credit_used",
																"key_failing",
																"rate_limited",
																"limit",
																"failed"
															]
														},
														{
															"type": "null"
														}
													]
												},
												"meter": {
													"type": "object",
													"properties": {
														"id": {
															"description": "The chat message’s own record; null for every other job.",
															"type": [
																"string",
																"null"
															]
														},
														"model": {
															"type": "string"
														},
														"source": {
															"type": "string",
															"enum": [
																"mailset",
																"own"
															],
															"description": "Whose key paid: an org’s own key is worth nothing to Mailset."
														},
														"tokens": {
															"type": "object",
															"properties": {
																"input": {
																	"type": "number"
																},
																"output": {
																	"type": "number"
																},
																"cacheRead": {
																	"type": "number"
																},
																"cacheWrite": {
																	"type": "number"
																}
															},
															"required": [
																"input",
																"output",
																"cacheRead",
																"cacheWrite"
															],
															"additionalProperties": false
														},
														"usd": {
															"type": "number",
															"description": "At Mailset’s price list on its key; zero on the org’s own."
														}
													},
													"required": [
														"id",
														"model",
														"source",
														"tokens",
														"usd"
													],
													"additionalProperties": false
												}
											},
											"required": [
												"text",
												"reason"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.replies": {
			"post": {
				"operationId": "ai.replies",
				"summary": "Suggest short replies to a conversation. Nothing is sent",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.replies"
				},
				"x-mailset-cli": "mailset ai replies <id>",
				"x-mailset-cli-example": "mailset ai replies t_5d2c8a1f9e3b47c6a0d1e2f3",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The conversation’s id."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"replies": {
													"type": "array",
													"items": {
														"type": "string"
													}
												},
												"reason": {
													"anyOf": [
														{
															"type": "string",
															"enum": [
																"off",
																"no_ai",
																"not_configured",
																"credit_used",
																"key_failing",
																"rate_limited",
																"limit",
																"failed"
															]
														},
														{
															"type": "null"
														}
													]
												},
												"meter": {
													"type": "object",
													"properties": {
														"id": {
															"description": "The chat message’s own record; null for every other job.",
															"type": [
																"string",
																"null"
															]
														},
														"model": {
															"type": "string"
														},
														"source": {
															"type": "string",
															"enum": [
																"mailset",
																"own"
															],
															"description": "Whose key paid: an org’s own key is worth nothing to Mailset."
														},
														"tokens": {
															"type": "object",
															"properties": {
																"input": {
																	"type": "number"
																},
																"output": {
																	"type": "number"
																},
																"cacheRead": {
																	"type": "number"
																},
																"cacheWrite": {
																	"type": "number"
																}
															},
															"required": [
																"input",
																"output",
																"cacheRead",
																"cacheWrite"
															],
															"additionalProperties": false
														},
														"usd": {
															"type": "number",
															"description": "At Mailset’s price list on its key; zero on the org’s own."
														}
													},
													"required": [
														"id",
														"model",
														"source",
														"tokens",
														"usd"
													],
													"additionalProperties": false
												}
											},
											"required": [
												"replies",
												"reason"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.draft": {
			"post": {
				"operationId": "ai.draft",
				"summary": "Write a draft reply to a conversation. Nothing is sent",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.draft"
				},
				"x-mailset-cli": "mailset ai draft <id> [--instructions <instructions>]",
				"x-mailset-cli-example": "mailset ai draft t_5d2c8a1f9e3b47c6a0d1e2f3 --instructions \"Say yes, and ask to move it to Thursday\"",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The conversation’s id."
											},
											"instructions": {
												"description": "What you want the reply to do, in your own words.",
												"type": "string",
												"maxLength": 2000
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"instructions": "Say yes, and ask to move it to Thursday",
									"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"text": {
													"type": [
														"string",
														"null"
													]
												},
												"reason": {
													"anyOf": [
														{
															"type": "string",
															"enum": [
																"off",
																"no_ai",
																"not_configured",
																"credit_used",
																"key_failing",
																"rate_limited",
																"limit",
																"failed"
															]
														},
														{
															"type": "null"
														}
													]
												},
												"meter": {
													"type": "object",
													"properties": {
														"id": {
															"description": "The chat message’s own record; null for every other job.",
															"type": [
																"string",
																"null"
															]
														},
														"model": {
															"type": "string"
														},
														"source": {
															"type": "string",
															"enum": [
																"mailset",
																"own"
															],
															"description": "Whose key paid: an org’s own key is worth nothing to Mailset."
														},
														"tokens": {
															"type": "object",
															"properties": {
																"input": {
																	"type": "number"
																},
																"output": {
																	"type": "number"
																},
																"cacheRead": {
																	"type": "number"
																},
																"cacheWrite": {
																	"type": "number"
																}
															},
															"required": [
																"input",
																"output",
																"cacheRead",
																"cacheWrite"
															],
															"additionalProperties": false
														},
														"usd": {
															"type": "number",
															"description": "At Mailset’s price list on its key; zero on the org’s own."
														}
													},
													"required": [
														"id",
														"model",
														"source",
														"tokens",
														"usd"
													],
													"additionalProperties": false
												}
											},
											"required": [
												"text",
												"reason"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.triage": {
			"post": {
				"operationId": "ai.triage",
				"summary": "Sort a conversation and check it for phishing, now",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.triage"
				},
				"x-mailset-cli": "mailset ai triage <id>",
				"x-mailset-cli-example": "mailset ai triage t_5d2c8a1f9e3b47c6a0d1e2f3",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The conversation’s id."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"tab": {
													"type": "string",
													"enum": [
														"primary",
														"updates",
														"newsletters",
														"promotions"
													]
												},
												"needsReply": {
													"type": "boolean"
												},
												"phishing": {
													"anyOf": [
														{
															"type": "object",
															"properties": {
																"domain": {
																	"type": "string",
																	"description": "The domain the mail really came from."
																},
																"imitates": {
																	"description": "The domain or name it passes itself off as. Null when it imitates nobody known.",
																	"type": [
																		"string",
																		"null"
																	]
																},
																"failed": {
																	"description": "The check it failed, such as DMARC. Null when none did.",
																	"type": [
																		"string",
																		"null"
																	]
																},
																"reason": {
																	"description": "What it does that looks like fraud: a `lookalike` domain, a `payment` ask, a request for `credentials`, or a risky `attachment`.",
																	"type": "string",
																	"enum": [
																		"lookalike",
																		"payment",
																		"credentials",
																		"attachment"
																	]
																}
															},
															"required": [
																"domain",
																"imitates",
																"failed"
															],
															"additionalProperties": false
														},
														{
															"type": "null"
														}
													]
												},
												"reason": {
													"anyOf": [
														{
															"type": "string",
															"enum": [
																"off",
																"no_ai",
																"not_configured",
																"credit_used",
																"key_failing",
																"rate_limited",
																"limit",
																"failed"
															]
														},
														{
															"type": "null"
														}
													]
												}
											},
											"required": [
												"tab",
												"needsReply",
												"phishing",
												"reason"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.safe": {
			"post": {
				"operationId": "ai.safe",
				"summary": "Take a phishing warning off a conversation",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.safe"
				},
				"x-mailset-cli": "mailset ai safe <id>",
				"x-mailset-cli-example": "mailset ai safe t_5d2c8a1f9e3b47c6a0d1e2f3",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The conversation’s id."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"safe": {
													"type": "boolean",
													"const": true
												}
											},
											"required": [
												"safe"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.search": {
			"post": {
				"operationId": "ai.search",
				"summary": "Turn a question into search operators",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.search"
				},
				"x-mailset-cli": "mailset ai search <question>",
				"x-mailset-cli-example": "mailset ai search \"invoices from Stripe since March\"",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"question": {
												"type": "string",
												"minLength": 1,
												"maxLength": 500,
												"description": "What you’re looking for, in your own words. Up to 500 characters."
											}
										},
										"required": [
											"question"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"question": "invoices from Stripe since March"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"query": {
													"description": "The question as search operators, or null to search the words as typed.",
													"type": [
														"string",
														"null"
													]
												},
												"reason": {
													"anyOf": [
														{
															"type": "string",
															"enum": [
																"off",
																"no_ai",
																"not_configured",
																"credit_used",
																"key_failing",
																"rate_limited",
																"limit",
																"failed"
															]
														},
														{
															"type": "null"
														}
													]
												},
												"meter": {
													"type": "object",
													"properties": {
														"id": {
															"description": "The chat message’s own record; null for every other job.",
															"type": [
																"string",
																"null"
															]
														},
														"model": {
															"type": "string"
														},
														"source": {
															"type": "string",
															"enum": [
																"mailset",
																"own"
															],
															"description": "Whose key paid: an org’s own key is worth nothing to Mailset."
														},
														"tokens": {
															"type": "object",
															"properties": {
																"input": {
																	"type": "number"
																},
																"output": {
																	"type": "number"
																},
																"cacheRead": {
																	"type": "number"
																},
																"cacheWrite": {
																	"type": "number"
																}
															},
															"required": [
																"input",
																"output",
																"cacheRead",
																"cacheWrite"
															],
															"additionalProperties": false
														},
														"usd": {
															"type": "number",
															"description": "At Mailset’s price list on its key; zero on the org’s own."
														}
													},
													"required": [
														"id",
														"model",
														"source",
														"tokens",
														"usd"
													],
													"additionalProperties": false
												}
											},
											"required": [
												"query",
												"reason"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/followups.list": {
			"post": {
				"operationId": "followups.list",
				"summary": "List mail you sent that is waiting for an answer",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Follow-ups"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/followups#followups.list"
				},
				"x-mailset-cli": "mailset followups list",
				"x-mailset-cli-example": "mailset followups list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"threadId": {
														"type": "string"
													},
													"mailbox": {
														"type": "string"
													},
													"subject": {
														"type": "string"
													},
													"sentAt": {
														"type": "number"
													},
													"remindedAt": {
														"description": "Null while it’s waiting.",
														"type": [
															"number",
															"null"
														]
													}
												},
												"required": [
													"threadId",
													"mailbox",
													"subject",
													"sentAt",
													"remindedAt"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/followups.dismiss": {
			"post": {
				"operationId": "followups.dismiss",
				"summary": "Stop reminding you about a conversation",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Follow-ups"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/followups#followups.dismiss"
				},
				"x-mailset-cli": "mailset followups dismiss <id>",
				"x-mailset-cli-example": "mailset followups dismiss t_5d2c8a1f9e3b47c6a0d1e2f3",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The conversation’s id."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"dismissed": {
													"type": "boolean",
													"const": true
												}
											},
											"required": [
												"dismissed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.explain": {
			"post": {
				"operationId": "ai.explain",
				"summary": "Say why a conversation is in its tab",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.explain"
				},
				"x-mailset-cli": "mailset ai explain <id>",
				"x-mailset-cli-example": "mailset ai explain t_5d2c8a1f9e3b47c6a0d1e2f3",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The conversation’s id."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "t_5d2c8a1f9e3b47c6a0d1e2f3"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"tab": {
													"type": "string",
													"enum": [
														"primary",
														"updates",
														"newsletters",
														"promotions"
													]
												},
												"decidedBy": {
													"type": "string",
													"description": "In words: your choice, headers, cached, sender pattern, shared sender, model."
												},
												"why": {
													"type": [
														"string",
														"null"
													]
												}
											},
											"required": [
												"tab",
												"decidedBy",
												"why"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/ai.report": {
			"post": {
				"operationId": "ai.report",
				"summary": "Show what sorted your mail and how much reached a model",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"AI"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai.report"
				},
				"x-mailset-cli": "mailset ai report",
				"x-mailset-cli-example": "mailset ai report",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"byLayer": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"layer": {
																"type": "string"
															},
															"threads": {
																"type": "number"
															}
														},
														"required": [
															"layer",
															"threads"
														],
														"additionalProperties": false
													},
													"description": "Conversations in your mailboxes by what placed them."
												},
												"threads": {
													"type": "number"
												},
												"reachedModel": {
													"type": "number",
													"description": "Conversations a model actually had to read to place."
												},
												"modelShare": {
													"type": "number"
												},
												"calls": {
													"type": "number",
													"description": "Model calls paid for, and answers reused instead, in your orgs."
												},
												"hits": {
													"type": "number"
												},
												"callsAvoided": {
													"type": "number"
												},
												"usd": {
													"type": "number"
												}
											},
											"required": [
												"byLayer",
												"threads",
												"reachedModel",
												"modelShare",
												"calls",
												"hits",
												"callsAvoided",
												"usd"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/threads.classify": {
			"post": {
				"operationId": "threads.classify",
				"summary": "Move conversations to a tab, and keep them there",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Conversations"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#threads.classify"
				},
				"x-mailset-cli": "mailset threads classify --ids <a,b,…> --tab primary|updates|newsletters|promotions",
				"x-mailset-cli-example": "mailset threads classify --ids t_5d2c8a1f9e3b47c6a0d1e2f3,t_b7e41c9a2f6d4083c5a9e1b2 --tab newsletters",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"ids": {
												"minItems": 1,
												"maxItems": 200,
												"type": "array",
												"items": {
													"type": "string",
													"minLength": 1
												},
												"description": "The conversations’ ids, 1 to 200."
											},
											"tab": {
												"type": "string",
												"enum": [
													"primary",
													"updates",
													"newsletters",
													"promotions"
												],
												"description": "The tab they go to."
											}
										},
										"required": [
											"ids",
											"tab"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"ids": [
										"t_5d2c8a1f9e3b47c6a0d1e2f3",
										"t_b7e41c9a2f6d4083c5a9e1b2"
									],
									"tab": "newsletters"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"updated": {
													"type": "number",
													"description": "How many moved."
												},
												"senders": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Who each one is from, so the app can offer to remember it."
												}
											},
											"required": [
												"updated",
												"senders"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/tabrules.list": {
			"post": {
				"operationId": "tabrules.list",
				"summary": "List the senders and domains you always file in a tab",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Tab rules"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/tabrules#tabrules.list"
				},
				"x-mailset-cli": "mailset tabrules list",
				"x-mailset-cli-example": "mailset tabrules list",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"match": {
														"type": "string"
													},
													"kind": {
														"type": "string",
														"enum": [
															"sender",
															"domain"
														]
													},
													"tab": {
														"type": "string",
														"enum": [
															"primary",
															"updates",
															"newsletters",
															"promotions"
														]
													}
												},
												"required": [
													"match",
													"kind",
													"tab"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/tabrules.add": {
			"post": {
				"operationId": "tabrules.add",
				"summary": "Always file a sender or domain in a tab",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Tab rules"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/tabrules#tabrules.add"
				},
				"x-mailset-cli": "mailset tabrules add <match> --tab primary|updates|newsletters|promotions",
				"x-mailset-cli-example": "mailset tabrules add stripe.com --tab updates",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"match": {
												"type": "string",
												"minLength": 1,
												"maxLength": 254,
												"description": "A sender’s address, or a domain."
											},
											"tab": {
												"type": "string",
												"enum": [
													"primary",
													"updates",
													"newsletters",
													"promotions"
												],
												"description": "The tab their mail goes to."
											}
										},
										"required": [
											"match",
											"tab"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"tab": "updates",
									"match": "stripe.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"match": {
													"type": "string"
												},
												"kind": {
													"type": "string",
													"enum": [
														"sender",
														"domain"
													]
												},
												"tab": {
													"type": "string",
													"enum": [
														"primary",
														"updates",
														"newsletters",
														"promotions"
													]
												}
											},
											"required": [
												"match",
												"kind",
												"tab"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/tabrules.remove": {
			"post": {
				"operationId": "tabrules.remove",
				"summary": "Stop always filing a sender or domain in a tab",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Tab rules"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/tabrules#tabrules.remove"
				},
				"x-mailset-cli": "mailset tabrules remove <match>",
				"x-mailset-cli-example": "mailset tabrules remove stripe.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"match": {
												"type": "string",
												"minLength": 1,
												"maxLength": 254,
												"description": "The sender’s address or domain, as it was added."
											}
										},
										"required": [
											"match"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"match": "stripe.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean",
													"const": true
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.list": {
			"post": {
				"operationId": "contacts.list",
				"summary": "List your contacts, by name",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.list"
				},
				"x-mailset-cli": "mailset contacts list [--limit <n>] [--after <after>] [--label <label>]",
				"x-mailset-cli-example": "mailset contacts list --label Customers --limit 100",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"limit": {
												"default": 50,
												"description": "How many contacts a page holds, 1 to 200.",
												"type": "integer",
												"minimum": 1,
												"maximum": 200
											},
											"after": {
												"description": "The `next` of the page before, for the page after it.",
												"type": "string"
											},
											"label": {
												"description": "Only contacts with this label.",
												"type": "string",
												"minLength": 1,
												"maxLength": 64
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"label": "Customers",
									"limit": 100
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"contacts": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string"
															},
															"name": {
																"type": "string"
															},
															"emails": {
																"type": "array",
																"items": {
																	"type": "string"
																}
															},
															"phones": {
																"type": "array",
																"items": {
																	"type": "string"
																}
															},
															"company": {
																"type": "string"
															},
															"title": {
																"type": "string"
															},
															"labels": {
																"type": "array",
																"items": {
																	"type": "string"
																}
															},
															"picture": {
																"type": [
																	"string",
																	"null"
																]
															}
														},
														"required": [
															"id",
															"name",
															"emails",
															"phones",
															"company",
															"title",
															"labels",
															"picture"
														],
														"additionalProperties": false
													}
												},
												"next": {
													"description": "Pass as `after` for the next page. Null at the end.",
													"type": [
														"string",
														"null"
													]
												},
												"total": {
													"type": "number"
												},
												"revision": {
													"type": "number",
													"description": "Rises with every change to the address book."
												}
											},
											"required": [
												"contacts",
												"next",
												"total",
												"revision"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.search": {
			"post": {
				"operationId": "contacts.search",
				"summary": "Search your contacts: name, address, phone, company, notes, labels",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.search"
				},
				"x-mailset-cli": "mailset contacts search <query> [--limit <n>] [--after <after>]",
				"x-mailset-cli-example": "mailset contacts search maria",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"query": {
												"type": "string",
												"minLength": 1,
												"maxLength": 200,
												"description": "What to find, in a name, address, phone, company, note or label."
											},
											"limit": {
												"default": 50,
												"description": "How many contacts a page holds, 1 to 200.",
												"type": "integer",
												"minimum": 1,
												"maximum": 200
											},
											"after": {
												"description": "The `next` of the page before, for the page after it.",
												"type": "string"
											}
										},
										"required": [
											"query"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"query": "maria"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"contacts": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"id": {
																"type": "string"
															},
															"name": {
																"type": "string"
															},
															"emails": {
																"type": "array",
																"items": {
																	"type": "string"
																}
															},
															"phones": {
																"type": "array",
																"items": {
																	"type": "string"
																}
															},
															"company": {
																"type": "string"
															},
															"title": {
																"type": "string"
															},
															"labels": {
																"type": "array",
																"items": {
																	"type": "string"
																}
															},
															"picture": {
																"type": [
																	"string",
																	"null"
																]
															}
														},
														"required": [
															"id",
															"name",
															"emails",
															"phones",
															"company",
															"title",
															"labels",
															"picture"
														],
														"additionalProperties": false
													}
												},
												"next": {
													"description": "Pass as `after` for the next page. Null at the end.",
													"type": [
														"string",
														"null"
													]
												},
												"total": {
													"type": "number"
												},
												"revision": {
													"type": "number",
													"description": "Rises with every change to the address book."
												}
											},
											"required": [
												"contacts",
												"next",
												"total",
												"revision"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.get": {
			"post": {
				"operationId": "contacts.get",
				"summary": "Show one contact",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.get"
				},
				"x-mailset-cli": "mailset contacts get <id>",
				"x-mailset-cli-example": "mailset contacts get con_4e9a2c7f1b6d3058a3c7e1b9",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The contact’s id."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "con_4e9a2c7f1b6d3058a3c7e1b9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Contact"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.add": {
			"post": {
				"operationId": "contacts.add",
				"summary": "Save someone",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.add"
				},
				"x-mailset-cli": "mailset contacts add [<name>] [--first-name <first-name>] [--middle-name <middle-name>] [--last-name <last-name>] [--prefix <prefix>] [--suffix <suffix>] [--nickname <nickname>] [--company <company>] [--title <title>] [--department <department>] [--emails <a,b,…>] [--phones <a,b,…>] [--addresses <a,b,…>] [--websites <a,b,…>] [--birthday <birthday>] [--notes <notes>] [--labels <a,b,…>] [--other <a,b,…>]",
				"x-mailset-cli-example": "mailset contacts add \"Maria Lopez\" --emails maria@example.com --phones \"+1 555 0100\" --company \"Example Inc\"",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"type": "string",
												"maxLength": 200,
												"description": "The full name as shown. Left empty, it is put together from the parts."
											},
											"firstName": {
												"type": "string",
												"maxLength": 200,
												"description": "Their first name."
											},
											"middleName": {
												"type": "string",
												"maxLength": 200,
												"description": "Their middle name."
											},
											"lastName": {
												"type": "string",
												"maxLength": 200,
												"description": "Their last name."
											},
											"prefix": {
												"type": "string",
												"maxLength": 200,
												"description": "What goes before the name: Dr."
											},
											"suffix": {
												"type": "string",
												"maxLength": 200,
												"description": "What goes after it: Jr."
											},
											"nickname": {
												"type": "string",
												"maxLength": 200,
												"description": "What you call them."
											},
											"company": {
												"type": "string",
												"maxLength": 200,
												"description": "Where they work."
											},
											"title": {
												"type": "string",
												"maxLength": 200,
												"description": "Their job title."
											},
											"department": {
												"type": "string",
												"maxLength": 200,
												"description": "Their department."
											},
											"emails": {
												"maxItems": 20,
												"type": "array",
												"items": {
													"anyOf": [
														{
															"type": "string"
														},
														{
															"type": "object",
															"properties": {
																"value": {
																	"description": "The address, number, URL or text.",
																	"type": "string"
																},
																"label": {
																	"default": "",
																	"description": "What it’s for: `work`, `home`.",
																	"type": "string",
																	"maxLength": 64
																}
															},
															"required": [
																"value"
															]
														}
													]
												},
												"description": "Addresses, the first is primary. Each is an address, or `{ value, label }`. Up to 20."
											},
											"phones": {
												"maxItems": 20,
												"type": "array",
												"items": {
													"anyOf": [
														{
															"type": "string",
															"minLength": 1,
															"maxLength": 64,
															"pattern": "\\d"
														},
														{
															"type": "object",
															"properties": {
																"value": {
																	"type": "string",
																	"minLength": 1,
																	"maxLength": 64,
																	"pattern": "\\d",
																	"description": "The address, number, URL or text."
																},
																"label": {
																	"default": "",
																	"description": "What it’s for: `work`, `home`.",
																	"type": "string",
																	"maxLength": 64
																}
															},
															"required": [
																"value"
															]
														}
													]
												},
												"description": "Phone numbers, each a number or `{ value, label }`. Up to 20."
											},
											"addresses": {
												"maxItems": 10,
												"type": "array",
												"items": {
													"anyOf": [
														{
															"type": "string",
															"minLength": 1,
															"maxLength": 1000
														},
														{
															"type": "object",
															"properties": {
																"value": {
																	"type": "string",
																	"minLength": 1,
																	"maxLength": 1000,
																	"description": "The address, number, URL or text."
																},
																"label": {
																	"default": "",
																	"description": "What it’s for: `work`, `home`.",
																	"type": "string",
																	"maxLength": 64
																}
															},
															"required": [
																"value"
															]
														}
													]
												},
												"description": "Postal addresses, each as text or `{ value, label }`. Up to 10."
											},
											"websites": {
												"maxItems": 10,
												"type": "array",
												"items": {
													"anyOf": [
														{
															"type": "string",
															"minLength": 1,
															"maxLength": 1000
														},
														{
															"type": "object",
															"properties": {
																"value": {
																	"type": "string",
																	"minLength": 1,
																	"maxLength": 1000,
																	"description": "The address, number, URL or text."
																},
																"label": {
																	"default": "",
																	"description": "What it’s for: `work`, `home`.",
																	"type": "string",
																	"maxLength": 64
																}
															},
															"required": [
																"value"
															]
														}
													]
												},
												"description": "Websites, each a URL or `{ value, label }`. Up to 10."
											},
											"birthday": {
												"type": "string",
												"maxLength": 32,
												"description": "Their birthday, as written: `1990-04-12`."
											},
											"notes": {
												"type": "string",
												"maxLength": 20000,
												"description": "Your own notes about them."
											},
											"labels": {
												"maxItems": 50,
												"type": "array",
												"items": {
													"type": "string",
													"minLength": 1,
													"maxLength": 64
												},
												"description": "The labels on the contact, by name. Up to 50."
											},
											"other": {
												"maxItems": 50,
												"type": "array",
												"items": {
													"anyOf": [
														{
															"type": "string",
															"minLength": 1,
															"maxLength": 1000
														},
														{
															"type": "object",
															"properties": {
																"value": {
																	"type": "string",
																	"minLength": 1,
																	"maxLength": 1000,
																	"description": "The address, number, URL or text."
																},
																"label": {
																	"default": "",
																	"description": "What it’s for: `work`, `home`.",
																	"type": "string",
																	"maxLength": 64
																}
															},
															"required": [
																"value"
															]
														}
													]
												},
												"description": "Anything else a contact came with: events, relations, custom fields."
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"emails": [
										"maria@example.com"
									],
									"phones": [
										"+1 555 0100"
									],
									"company": "Example Inc",
									"name": "Maria Lopez"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Contact"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.update": {
			"post": {
				"operationId": "contacts.update",
				"summary": "Change a contact. Only the fields you pass change",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.update"
				},
				"x-mailset-cli": "mailset contacts update <id> [--name <name>] [--first-name <first-name>] [--middle-name <middle-name>] [--last-name <last-name>] [--prefix <prefix>] [--suffix <suffix>] [--nickname <nickname>] [--company <company>] [--title <title>] [--department <department>] [--emails <a,b,…>] [--phones <a,b,…>] [--addresses <a,b,…>] [--websites <a,b,…>] [--birthday <birthday>] [--notes <notes>] [--labels <a,b,…>] [--other <a,b,…>]",
				"x-mailset-cli-example": "mailset contacts update con_4e9a2c7f1b6d3058a3c7e1b9 --company \"Example Inc\" --title \"Head of Finance\"",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"type": "string",
												"maxLength": 200,
												"description": "The full name as shown. Left empty, it is put together from the parts."
											},
											"firstName": {
												"type": "string",
												"maxLength": 200,
												"description": "Their first name."
											},
											"middleName": {
												"type": "string",
												"maxLength": 200,
												"description": "Their middle name."
											},
											"lastName": {
												"type": "string",
												"maxLength": 200,
												"description": "Their last name."
											},
											"prefix": {
												"type": "string",
												"maxLength": 200,
												"description": "What goes before the name: Dr."
											},
											"suffix": {
												"type": "string",
												"maxLength": 200,
												"description": "What goes after it: Jr."
											},
											"nickname": {
												"type": "string",
												"maxLength": 200,
												"description": "What you call them."
											},
											"company": {
												"type": "string",
												"maxLength": 200,
												"description": "Where they work."
											},
											"title": {
												"type": "string",
												"maxLength": 200,
												"description": "Their job title."
											},
											"department": {
												"type": "string",
												"maxLength": 200,
												"description": "Their department."
											},
											"emails": {
												"maxItems": 20,
												"type": "array",
												"items": {
													"anyOf": [
														{
															"type": "string"
														},
														{
															"type": "object",
															"properties": {
																"value": {
																	"description": "The address, number, URL or text.",
																	"type": "string"
																},
																"label": {
																	"default": "",
																	"description": "What it’s for: `work`, `home`.",
																	"type": "string",
																	"maxLength": 64
																}
															},
															"required": [
																"value"
															]
														}
													]
												},
												"description": "Addresses, the first is primary. Each is an address, or `{ value, label }`. Up to 20."
											},
											"phones": {
												"maxItems": 20,
												"type": "array",
												"items": {
													"anyOf": [
														{
															"type": "string",
															"minLength": 1,
															"maxLength": 64,
															"pattern": "\\d"
														},
														{
															"type": "object",
															"properties": {
																"value": {
																	"type": "string",
																	"minLength": 1,
																	"maxLength": 64,
																	"pattern": "\\d",
																	"description": "The address, number, URL or text."
																},
																"label": {
																	"default": "",
																	"description": "What it’s for: `work`, `home`.",
																	"type": "string",
																	"maxLength": 64
																}
															},
															"required": [
																"value"
															]
														}
													]
												},
												"description": "Phone numbers, each a number or `{ value, label }`. Up to 20."
											},
											"addresses": {
												"maxItems": 10,
												"type": "array",
												"items": {
													"anyOf": [
														{
															"type": "string",
															"minLength": 1,
															"maxLength": 1000
														},
														{
															"type": "object",
															"properties": {
																"value": {
																	"type": "string",
																	"minLength": 1,
																	"maxLength": 1000,
																	"description": "The address, number, URL or text."
																},
																"label": {
																	"default": "",
																	"description": "What it’s for: `work`, `home`.",
																	"type": "string",
																	"maxLength": 64
																}
															},
															"required": [
																"value"
															]
														}
													]
												},
												"description": "Postal addresses, each as text or `{ value, label }`. Up to 10."
											},
											"websites": {
												"maxItems": 10,
												"type": "array",
												"items": {
													"anyOf": [
														{
															"type": "string",
															"minLength": 1,
															"maxLength": 1000
														},
														{
															"type": "object",
															"properties": {
																"value": {
																	"type": "string",
																	"minLength": 1,
																	"maxLength": 1000,
																	"description": "The address, number, URL or text."
																},
																"label": {
																	"default": "",
																	"description": "What it’s for: `work`, `home`.",
																	"type": "string",
																	"maxLength": 64
																}
															},
															"required": [
																"value"
															]
														}
													]
												},
												"description": "Websites, each a URL or `{ value, label }`. Up to 10."
											},
											"birthday": {
												"type": "string",
												"maxLength": 32,
												"description": "Their birthday, as written: `1990-04-12`."
											},
											"notes": {
												"type": "string",
												"maxLength": 20000,
												"description": "Your own notes about them."
											},
											"labels": {
												"maxItems": 50,
												"type": "array",
												"items": {
													"type": "string",
													"minLength": 1,
													"maxLength": 64
												},
												"description": "The labels on the contact, by name. Up to 50."
											},
											"other": {
												"maxItems": 50,
												"type": "array",
												"items": {
													"anyOf": [
														{
															"type": "string",
															"minLength": 1,
															"maxLength": 1000
														},
														{
															"type": "object",
															"properties": {
																"value": {
																	"type": "string",
																	"minLength": 1,
																	"maxLength": 1000,
																	"description": "The address, number, URL or text."
																},
																"label": {
																	"default": "",
																	"description": "What it’s for: `work`, `home`.",
																	"type": "string",
																	"maxLength": 64
																}
															},
															"required": [
																"value"
															]
														}
													]
												},
												"description": "Anything else a contact came with: events, relations, custom fields."
											},
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The contact’s id."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"company": "Example Inc",
									"title": "Head of Finance",
									"id": "con_4e9a2c7f1b6d3058a3c7e1b9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"$ref": "#/components/schemas/Contact"
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.remove": {
			"post": {
				"operationId": "contacts.remove",
				"summary": "Delete contacts and their photos",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.remove"
				},
				"x-mailset-cli": "mailset contacts remove <ids>",
				"x-mailset-cli-example": "mailset contacts remove con_4e9a2c7f1b6d3058a3c7e1b9",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"ids": {
												"description": "One contact’s id, or a list of up to 200.",
												"minItems": 1,
												"maxItems": 200,
												"type": "array",
												"items": {
													"type": "string",
													"minLength": 1
												}
											}
										},
										"required": [
											"ids"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"ids": "con_4e9a2c7f1b6d3058a3c7e1b9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "number",
													"description": "How many were deleted."
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.duplicates": {
			"post": {
				"operationId": "contacts.duplicates",
				"summary": "Find contacts that look like the same person",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.duplicates"
				},
				"x-mailset-cli": "mailset contacts duplicates",
				"x-mailset-cli-example": "mailset contacts duplicates",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {}
									}
								},
								"required": []
							},
							"example": {
								"input": {}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "array",
											"items": {
												"type": "object",
												"properties": {
													"reason": {
														"type": "string",
														"enum": [
															"email",
															"phone",
															"name"
														]
													},
													"contacts": {
														"type": "array",
														"items": {
															"type": "object",
															"properties": {
																"id": {
																	"type": "string"
																},
																"name": {
																	"type": "string"
																},
																"emails": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	}
																},
																"phones": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	}
																},
																"company": {
																	"type": "string"
																},
																"title": {
																	"type": "string"
																},
																"labels": {
																	"type": "array",
																	"items": {
																		"type": "string"
																	}
																},
																"picture": {
																	"type": [
																		"string",
																		"null"
																	]
																}
															},
															"required": [
																"id",
																"name",
																"emails",
																"phones",
																"company",
																"title",
																"labels",
																"picture"
															],
															"additionalProperties": false
														}
													}
												},
												"required": [
													"reason",
													"contacts"
												],
												"additionalProperties": false
											}
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.merge": {
			"post": {
				"operationId": "contacts.merge",
				"summary": "Merge duplicates",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.merge"
				},
				"x-mailset-cli": "mailset contacts merge [--ids <a,b,…>] [--all]",
				"x-mailset-cli-example": "mailset contacts merge --ids con_4e9a2c7f1b6d3058a3c7e1b9,con_a1c6e3b9f2d74058b6e2a9c4",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"ids": {
												"description": "The contacts to merge, 2 to 50. The first is kept.",
												"minItems": 2,
												"maxItems": 50,
												"type": "array",
												"items": {
													"type": "string",
													"minLength": 1
												}
											},
											"all": {
												"description": "Merge every group `contacts duplicates` finds.",
												"type": "boolean"
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"ids": [
										"con_4e9a2c7f1b6d3058a3c7e1b9",
										"con_a1c6e3b9f2d74058b6e2a9c4"
									]
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "number",
													"description": "Contacts folded into another and gone."
												},
												"kept": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Who was left standing."
												}
											},
											"required": [
												"removed",
												"kept"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.import": {
			"post": {
				"operationId": "contacts.import",
				"summary": "Import a Google Contacts CSV or a vCard file",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.import"
				},
				"x-mailset-cli": "mailset contacts import --file <path>",
				"x-mailset-cli-example": "mailset contacts import --file contacts.vcf",
				"x-mailset-max-body-bytes": 44743339,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"name": {
												"type": "string",
												"minLength": 1,
												"maxLength": 255,
												"description": "The file’s name."
											},
											"data": {
												"type": "string",
												"minLength": 1,
												"description": "The file, base64."
											}
										},
										"required": [
											"name",
											"data"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"name": "contacts.vcf",
									"data": "<base64 of the file>"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"format": {
													"type": "string",
													"enum": [
														"csv",
														"vcard"
													]
												},
												"read": {
													"type": "number",
													"description": "Rows or cards found in the file."
												},
												"added": {
													"type": "number"
												},
												"merged": {
													"type": "number",
													"description": "Already saved: anything new in the file was added to them."
												},
												"unchanged": {
													"type": "number",
													"description": "Already saved, with nothing new to add."
												},
												"skipped": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"at": {
																"type": "number",
																"description": "The row or card it was, counting from 1."
															},
															"who": {
																"type": "string",
																"description": "What’s known of it, so you can find it in your file."
															},
															"reason": {
																"type": "string"
															}
														},
														"required": [
															"at",
															"who",
															"reason"
														],
														"additionalProperties": false
													},
													"description": "Rows or cards left out, and why. Up to 200 are listed; `skippedTotal` counts them all."
												},
												"skippedTotal": {
													"type": "number"
												},
												"photos": {
													"type": "object",
													"properties": {
														"added": {
															"type": "number",
															"description": "Every photo kept, inline or fetched."
														},
														"refused": {
															"type": "number",
															"description": "Inline photos refused for their type or size."
														},
														"remote": {
															"type": "number",
															"description": "Links anywhere but Google’s photo hosts: Mailset doesn’t fetch them."
														},
														"fetched": {
															"type": "number",
															"description": "Links on Google’s photo hosts, fetched and kept. Counted in `added` too."
														},
														"failed": {
															"type": "number",
															"description": "Links on Google’s photo hosts that gave no usable photo."
														},
														"remaining": {
															"type": "number",
															"description": "Links on Google’s photo hosts this import had no room or time for. Importing the file again fetches them."
														}
													},
													"required": [
														"added",
														"refused",
														"remote",
														"fetched",
														"failed",
														"remaining"
													],
													"additionalProperties": false
												},
												"ignored": {
													"type": "array",
													"items": {
														"type": "string"
													},
													"description": "Columns or properties with data that Mailset has no field for."
												}
											},
											"required": [
												"format",
												"read",
												"added",
												"merged",
												"unchanged",
												"skipped",
												"skippedTotal",
												"photos",
												"ignored"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.export": {
			"post": {
				"operationId": "contacts.export",
				"summary": "Print your contacts as vCard or CSV",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.export"
				},
				"x-mailset-cli": "mailset contacts export [--format vcard|csv] [--photos]",
				"x-mailset-cli-example": "mailset contacts export --format csv",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"format": {
												"default": "vcard",
												"description": "`vcard` or `csv`.",
												"type": "string",
												"enum": [
													"vcard",
													"csv"
												]
											},
											"photos": {
												"default": true,
												"description": "Inline each photo in a vCard.",
												"type": "boolean"
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"format": "csv"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"format": {
													"type": "string",
													"enum": [
														"vcard",
														"csv"
													]
												},
												"filename": {
													"type": "string"
												},
												"contentType": {
													"type": "string"
												},
												"count": {
													"type": "number"
												},
												"photosOmitted": {
													"type": "number",
													"description": "Photos left out of the vCard to keep the file a sensible size."
												},
												"text": {
													"type": "string"
												}
											},
											"required": [
												"format",
												"filename",
												"contentType",
												"count",
												"photosOmitted",
												"text"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.others": {
			"post": {
				"operationId": "contacts.others",
				"summary": "People you’ve exchanged mail with and haven’t saved",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.others"
				},
				"x-mailset-cli": "mailset contacts others [--limit <n>] [--after <after>] [--query <query>]",
				"x-mailset-cli-example": "mailset contacts others --query example.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"limit": {
												"default": 50,
												"description": "How many people a page holds, 1 to 200.",
												"type": "integer",
												"minimum": 1,
												"maximum": 200
											},
											"after": {
												"description": "The `next` of the page before, for the page after it.",
												"type": "string"
											},
											"query": {
												"description": "Only people whose name or address has this in it.",
												"type": "string",
												"maxLength": 200
											}
										}
									}
								},
								"required": []
							},
							"example": {
								"input": {
									"query": "example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"people": {
													"type": "array",
													"items": {
														"type": "object",
														"properties": {
															"email": {
																"type": "string"
															},
															"name": {
																"type": "string"
															},
															"count": {
																"type": "number",
																"description": "How many times you’ve exchanged mail with them."
															},
															"lastAt": {
																"type": "number"
															}
														},
														"required": [
															"email",
															"name",
															"count",
															"lastAt"
														],
														"additionalProperties": false
													}
												},
												"next": {
													"type": [
														"string",
														"null"
													]
												},
												"total": {
													"type": "number"
												}
											},
											"required": [
												"people",
												"next",
												"total"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.forget": {
			"post": {
				"operationId": "contacts.forget",
				"summary": "Take someone off your other contacts",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.forget"
				},
				"x-mailset-cli": "mailset contacts forget <address>",
				"x-mailset-cli-example": "mailset contacts forget maria@example.com",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"address": {
												"description": "The person’s address.",
												"type": "string"
											}
										},
										"required": [
											"address"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"address": "maria@example.com"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean"
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.photo.set": {
			"post": {
				"operationId": "contacts.photo.set",
				"summary": "Set a contact’s photo from a PNG, JPEG or WebP file",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.photo.set"
				},
				"x-mailset-cli": "mailset contacts photo set <id> --file <path>",
				"x-mailset-cli-example": "mailset contacts photo set con_4e9a2c7f1b6d3058a3c7e1b9 --file maria.jpg",
				"x-mailset-max-body-bytes": 6994603,
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The contact’s id."
											},
											"name": {
												"type": "string",
												"minLength": 1,
												"maxLength": 255,
												"description": "The photo file’s name."
											},
											"data": {
												"type": "string",
												"minLength": 1,
												"description": "The file, base64."
											}
										},
										"required": [
											"id",
											"name",
											"data"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "con_4e9a2c7f1b6d3058a3c7e1b9",
									"name": "maria.jpg",
									"data": "<base64 of the file>"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"id": {
													"type": "string",
													"description": "The contact’s id."
												},
												"picture": {
													"type": "string",
													"description": "A short-lived URL for the photo."
												}
											},
											"required": [
												"id",
												"picture"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		},
		"/v1/contacts.photo.remove": {
			"post": {
				"operationId": "contacts.photo.remove",
				"summary": "Remove a contact’s photo",
				"description": "Any signed-in person, with an API token.",
				"tags": [
					"Contacts"
				],
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contacts.photo.remove"
				},
				"x-mailset-cli": "mailset contacts photo remove <id>",
				"x-mailset-cli-example": "mailset contacts photo remove con_4e9a2c7f1b6d3058a3c7e1b9",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"input": {
										"type": "object",
										"properties": {
											"id": {
												"type": "string",
												"minLength": 1,
												"description": "The contact’s id."
											}
										},
										"required": [
											"id"
										]
									}
								},
								"required": [
									"input"
								]
							},
							"example": {
								"input": {
									"id": "con_4e9a2c7f1b6d3058a3c7e1b9"
								}
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "The command ran.",
						"content": {
							"application/json": {
								"schema": {
									"type": "object",
									"properties": {
										"ok": {
											"type": "boolean",
											"const": true
										},
										"data": {
											"type": "object",
											"properties": {
												"removed": {
													"type": "boolean"
												}
											},
											"required": [
												"removed"
											],
											"additionalProperties": false
										}
									},
									"required": [
										"ok",
										"data"
									]
								}
							}
						}
					},
					"default": {
						"$ref": "#/components/responses/Error"
					}
				}
			}
		}
	},
	"webhooks": {
		"productEvents": {
			"post": {
				"operationId": "productEvents",
				"summary": "What became of your product’s email",
				"description": "Mailset posts this to your org’s hook (`hooks.set`): up to 100 events, one per recipient. Check `Mailset-Signature` before reading the body, and answer 2xx once the events are kept. https://mailset.app/docs/webhooks",
				"parameters": [
					{
						"name": "Mailset-Signature",
						"in": "header",
						"required": true,
						"description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`, with the hook’s secret.",
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "Mailset-Delivery",
						"in": "header",
						"required": true,
						"description": "This batch’s id. The same on every retry of the batch.",
						"schema": {
							"type": "string"
						}
					}
				],
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"type": "object",
								"properties": {
									"events": {
										"type": "array",
										"items": {
											"$ref": "#/components/schemas/Event"
										},
										"description": "Up to 100 events."
									}
								},
								"required": [
									"events"
								],
								"additionalProperties": false
							}
						}
					}
				},
				"responses": {
					"2XX": {
						"description": "Kept. Mailset won’t post this batch again."
					}
				}
			}
		}
	},
	"components": {
		"securitySchemes": {
			"token": {
				"type": "http",
				"scheme": "bearer",
				"description": "The session token inside a `MAILSET_KEY` (`msk1_…`) or an API token (`mst_…`). Never enough alone: `ms-time` and `ms-proof` go with it. Making and keeping a key: https://mailset.app/docs/authentication"
			},
			"time": {
				"type": "apiKey",
				"in": "header",
				"name": "ms-time",
				"description": "When the request was signed, in milliseconds since the epoch. Within 2 minutes of Mailset’s clock. https://mailset.app/docs/authentication/http"
			},
			"proof": {
				"type": "apiKey",
				"in": "header",
				"name": "ms-proof",
				"description": "base64url of an ECDSA P-256 SHA-256 signature, as raw r||s (64 bytes), over `ms-proof-v1\\n<METHOD>\\n<path and query>\\n<ms-time>\\n<base64url(sha256(body))>`. The steps, a test vector and a client in six languages: https://mailset.app/docs/authentication/http"
			}
		},
		"schemas": {
			"Error": {
				"type": "object",
				"properties": {
					"code": {
						"type": "string",
						"enum": [
							"invalid_input",
							"unauthorized",
							"step_up_required",
							"forbidden",
							"not_found",
							"conflict",
							"expired",
							"limit_reached",
							"unavailable",
							"internal"
						],
						"description": "What kind of refusal it is. The HTTP status follows from it."
					},
					"message": {
						"type": "string",
						"description": "The refusal in words, fit to show a person."
					},
					"issues": {
						"description": "On `invalid_input`: each field that was wrong.",
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"path": {
									"type": "array",
									"items": {
										"type": [
											"string",
											"number"
										]
									},
									"description": "Which input field is wrong: its name, then any keys inside it."
								},
								"message": {
									"type": "string",
									"description": "What’s wrong with it, in words."
								}
							},
							"required": [
								"path",
								"message"
							],
							"additionalProperties": false
						}
					},
					"purpose": {
						"description": "On `step_up_required`: the action a passkey has to approve.",
						"type": "object",
						"properties": {
							"kind": {
								"type": "string",
								"enum": [
									"device",
									"member",
									"passkey",
									"domain",
									"mailbox",
									"token",
									"approval",
									"rule",
									"forward",
									"message",
									"group",
									"policy",
									"export",
									"account",
									"recovery",
									"paperkey",
									"dns",
									"google",
									"ai"
								],
								"description": "What the action is about: a `domain`, a `mailbox`, a `member` and so on."
							},
							"id": {
								"type": "string",
								"pattern": "^[\\x21-\\x7e]{1,200}$",
								"description": "The action itself, as text a passkey check is made for."
							},
							"org": {
								"anyOf": [
									{
										"type": "string",
										"minLength": 1
									},
									{
										"type": "null"
									}
								],
								"description": "The org it’s in. Null for an action on your own account."
							}
						},
						"required": [
							"kind",
							"id",
							"org"
						],
						"additionalProperties": false
					},
					"refusal": {
						"description": "When mail was refused: why, as a short code.",
						"type": "string",
						"enum": [
							"domain_pending",
							"domain_blocked",
							"provider_refused",
							"recipient",
							"mail_domain",
							"seat_charge"
						]
					},
					"retryAt": {
						"description": "On `limit_reached` for mail with a deadline: the soonest it could go, in ms since the epoch. Send it again then, or with a later deadline.",
						"type": "number"
					},
					"docs": {
						"description": "When a sending limit refused it: the page that lists every plan’s limits, as a URL.",
						"type": "string"
					},
					"support": {
						"description": "When Mailset support can raise the limit that refused it: where to ask, as a URL.",
						"type": "string"
					},
					"revoked": {
						"description": "On `unauthorized`: this device was signed out for good, not just out of time.",
						"type": "boolean",
						"const": true
					},
					"suggestion": {
						"description": "On a refused address: the one it likely meant, for the person to pick or ignore.",
						"type": "string"
					}
				},
				"required": [
					"code",
					"message"
				],
				"additionalProperties": false
			},
			"Receipt": {
				"title": "The Receipt object",
				"description": "What a send answers: the message’s id, whether it went or waits, and who was left out.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/messages#receipt"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "Mailset’s id for this send."
					},
					"messageId": {
						"description": "The id its message will have in the conversation once it goes.",
						"type": "string"
					},
					"sendAt": {
						"type": "number",
						"description": "When it goes out, in milliseconds since 1970: the time asked, or later when a limit holds it."
					},
					"held": {
						"description": "Why it waits past the time asked: a sending limit that clears by waiting.",
						"type": "string"
					},
					"raisable": {
						"description": "True when what holds it is one of the plan’s sending limits, which Mailset support can raise.",
						"type": "boolean"
					},
					"state": {
						"type": "string",
						"enum": [
							"sent",
							"queued"
						],
						"description": "`sent`: it went, or every recipient was skipped and nothing is left to do. `queued`: Mailset holds it and sends it at `sendAt`."
					},
					"skipped": {
						"description": "Recipients Mailset left out. They never get it, the others do, and there is nothing to retry. Absent when nobody was skipped.",
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"address": {
									"type": "string",
									"description": "The address that was left out."
								},
								"reason": {
									"type": "string",
									"enum": [
										"private_relay",
										"disposable",
										"unsubscribed"
									],
									"description": "`private_relay`: an Apple Hide My Email address. `disposable`: a temporary inbox. `unsubscribed`: it unsubscribed from this mailbox’s promotional mail."
								}
							},
							"required": [
								"address",
								"reason"
							],
							"additionalProperties": false
						}
					}
				},
				"required": [
					"id",
					"sendAt",
					"state"
				],
				"additionalProperties": false,
				"example": {
					"id": "out_3f9a1c0e7b2d",
					"messageId": "3f9a1c0e7b2d4a58@example.com",
					"sendAt": 1796048940000,
					"state": "sent"
				}
			},
			"DeliveryLine": {
				"title": "The Delivery line object",
				"description": "One recipient’s line in the delivery log: who sent it, where it went and what became of it.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/delivery#delivery-line"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "The line’s id."
					},
					"at": {
						"type": "number",
						"description": "When it happened, in milliseconds since 1970."
					},
					"direction": {
						"type": "string",
						"enum": [
							"inbound",
							"outbound"
						],
						"description": "`outbound` for mail that left, `inbound` for mail that came."
					},
					"sender": {
						"description": "Who sent it. For mail that left, the mailbox it left from, whichever of its addresses was in From. For a domain key’s mail, the address it went as.",
						"type": [
							"string",
							"null"
						]
					},
					"recipient": {
						"type": "string",
						"description": "The address it went to."
					},
					"via": {
						"description": "The group address it reached this mailbox through, if any.",
						"type": [
							"string",
							"null"
						]
					},
					"status": {
						"type": "string",
						"enum": [
							"sent",
							"delivered",
							"delayed",
							"bounced",
							"complained",
							"rejected",
							"expired",
							"skipped",
							"received",
							"junk",
							"blocked"
						],
						"description": "What became of it for this recipient."
					},
					"reason": {
						"description": "Why, in words, when the status needs saying why.",
						"type": [
							"string",
							"null"
						]
					},
					"message": {
						"description": "Mailset’s id for the send this line is about: the `id` its send answered. Present on every line of mail that left.",
						"type": "string"
					},
					"messageId": {
						"description": "The message’s Message-ID header, without the angle brackets. Present whenever `message` is.",
						"type": "string"
					},
					"client": {
						"default": null,
						"description": "Which client submitted the message, from the `Mailset-Client` header it sent: one of Mailset’s SDKs, the CLI, the web app or the iPhone app. Null for mail that came in, and for a send whose request named no client.",
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"name": {
										"type": "string",
										"enum": [
											"typescript",
											"python",
											"go",
											"ruby",
											"php",
											"java",
											"rust",
											"cli",
											"web",
											"ios",
											"other"
										],
										"description": "Which client sent it: one of Mailset’s SDKs by its language (`typescript`, `python`, `go`, `ruby`, `php`, `java`, `rust`), `cli`, `web`, `ios`, or `other`."
									},
									"version": {
										"description": "Its version, as it said. Null for `other`.",
										"type": [
											"string",
											"null"
										]
									}
								},
								"required": [
									"name",
									"version"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						]
					},
					"duplicateOf": {
						"description": "Present when the same content went to this recipient from the same address less than 10 minutes before, under another Message-ID: the `message` of that earlier send. Both were sent. Give the send an idempotency key to stop it.",
						"type": "string"
					}
				},
				"required": [
					"id",
					"at",
					"direction",
					"sender",
					"recipient",
					"via",
					"status",
					"reason",
					"client"
				],
				"additionalProperties": false,
				"example": {
					"id": "dlv_8d2k4m1p9q7x",
					"at": 1796048940000,
					"direction": "outbound",
					"sender": "hello@example.com",
					"recipient": "ana@example.org",
					"via": null,
					"status": "bounced",
					"reason": "smtp; 550 5.1.1 The email account that you tried to reach does not exist.",
					"message": "out_3f9a1c0e7b2d",
					"messageId": "3f9a1c0e7b2d4a58@example.com",
					"client": {
						"name": "typescript",
						"version": "0.7.0"
					}
				}
			},
			"Event": {
				"title": "The Event object",
				"description": "One thing that happened to one message for one recipient, as your hook receives it.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/hooks#event"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "Stable for this message, recipient and happening, so dedupe on it. For `unsubscribed`, stable for that opt-out: someone let back in who leaves again has a new one."
					},
					"type": {
						"type": "string",
						"enum": [
							"queued",
							"sent",
							"delivered",
							"bounced",
							"complained",
							"failed",
							"expired",
							"unsubscribed",
							"test"
						],
						"description": "What happened."
					},
					"at": {
						"type": "number",
						"description": "When it happened, in milliseconds since 1970."
					},
					"message": {
						"description": "Mailset’s id for the message: the `id` its send answered. On every event about a message, and on `unsubscribed` when the message the link was in is known.",
						"type": "string"
					},
					"messageId": {
						"description": "The message’s Message-ID header, without the angle brackets. Present whenever `message` is.",
						"type": "string"
					},
					"recipient": {
						"description": "The one address this event is about. Absent only on `test`.",
						"type": "string"
					},
					"app": {
						"description": "The app key that sent the mail, by the name it was approved with.",
						"type": "string"
					},
					"duplicateOf": {
						"description": "Present when the same content went to this recipient from the same address less than 10 minutes before, under another Message-ID: the `message` of that earlier send. Both were sent. Give the send an idempotency key to stop it.",
						"type": "string"
					},
					"sendsAt": {
						"description": "`queued`: when it should go out, in milliseconds since 1970.",
						"type": "number"
					},
					"reason": {
						"description": "`queued`, `failed`, `expired`: why, in words.",
						"type": "string"
					},
					"bounce": {
						"description": "`bounced`: what kind of bounce it was.",
						"type": "object",
						"properties": {
							"kind": {
								"type": "string",
								"enum": [
									"hard",
									"soft"
								],
								"description": "`hard` won’t change. `soft` may go on a later try."
							},
							"class": {
								"type": "string",
								"enum": [
									"mailbox",
									"domain",
									"full",
									"too_large",
									"policy",
									"suppressed",
									"other"
								],
								"description": "What the bounce says about the address: `mailbox` and `domain` mean it can’t get mail."
							},
							"reason": {
								"type": "string",
								"description": "What the receiving server replied, with its SMTP code. For `suppressed`, why Mailset didn’t send it."
							}
						},
						"required": [
							"kind",
							"class",
							"reason"
						],
						"additionalProperties": false
					}
				},
				"required": [
					"id",
					"type",
					"at"
				],
				"additionalProperties": false,
				"example": {
					"id": "evt_5b1f0c9a7e3d",
					"type": "bounced",
					"at": 1796048940000,
					"message": "out_3f9a1c0e7b2d",
					"messageId": "3f9a1c0e7b2d4a58@example.com",
					"recipient": "ana@example.org",
					"app": "Acme API",
					"bounce": {
						"kind": "hard",
						"class": "mailbox",
						"reason": "smtp; 550 5.1.1 The email account that you tried to reach does not exist."
					}
				}
			},
			"Unsubscribe": {
				"title": "The Unsubscribe object",
				"description": "One address that opted out of a mailbox’s or sending domain’s promotional email, and when.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/unsubscribes#unsubscribe"
				},
				"type": "object",
				"properties": {
					"address": {
						"type": "string",
						"description": "The address that unsubscribed, in lowercase."
					},
					"at": {
						"type": "number",
						"description": "When, in milliseconds since 1970."
					},
					"app": {
						"description": "The app key whose mail the link was in, by the name it was approved with. Null when a person sent that mail.",
						"type": [
							"string",
							"null"
						]
					}
				},
				"required": [
					"address",
					"at",
					"app"
				],
				"additionalProperties": false,
				"example": {
					"address": "ana@example.org",
					"at": 1796048940000,
					"app": "Acme News"
				}
			},
			"KeyStatus": {
				"title": "The Key status object",
				"description": "An app key as Mailset sees it: its name, what it reaches, and when it stops.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/grants#key-status"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "The app’s id: what `grants revoke`, `grants renew` and `grants resume` take."
					},
					"name": {
						"type": "string",
						"description": "The name it was approved with."
					},
					"createdAt": {
						"type": "number",
						"description": "When it was connected, in ms since the epoch."
					},
					"lastSeenAt": {
						"type": "number",
						"description": "When it last made a call, in ms since the epoch."
					},
					"expiresAt": {
						"type": "number",
						"description": "When its key stops working, in ms since the epoch: 90 days after its last call. Moves forward whenever the app uses it."
					},
					"paused": {
						"default": null,
						"description": "Why its own brake stopped its mail, or null while it may send.",
						"type": [
							"string",
							"null"
						]
					},
					"mailboxes": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"address": {
									"type": "string",
									"description": "The mailbox’s address."
								},
								"access": {
									"type": "array",
									"items": {
										"type": "string",
										"enum": [
											"read",
											"send"
										]
									},
									"description": "What the app may do with it: `read`, `send` or both."
								},
								"sendAs": {
									"type": "array",
									"items": {
										"type": "string"
									},
									"description": "The addresses it may send as. Empty without send access."
								},
								"sending": {
									"type": "string",
									"enum": [
										"pending",
										"ready",
										"blocked"
									],
									"description": "Whether the mailbox’s domain can send: `pending`, `ready` or `blocked`."
								}
							},
							"required": [
								"address",
								"access",
								"sendAs",
								"sending"
							],
							"additionalProperties": false
						},
						"description": "The mailboxes it reaches, and what it may do with each."
					},
					"domains": {
						"default": [],
						"description": "For a domain key: the sending-only domain it sends from, with no mailbox, and the addresses it sends as there. Empty for any other key.",
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"name": {
									"type": "string",
									"description": "The domain’s name."
								},
								"sending": {
									"type": "string",
									"enum": [
										"pending",
										"ready",
										"blocked"
									],
									"description": "Whether the domain can send: `pending`, `ready` or `blocked`."
								},
								"from": {
									"default": null,
									"description": "The addresses it sends as, on that domain. Null: any address there, the opt-in for a domain where nobody has an address of their own.",
									"anyOf": [
										{
											"type": "array",
											"items": {
												"type": "string"
											}
										},
										{
											"type": "null"
										}
									]
								}
							},
							"required": [
								"name",
								"sending",
								"from"
							],
							"additionalProperties": false
						}
					},
					"campaigns": {
						"default": null,
						"description": "The org whose campaigns it runs, for a campaigns key. Null for any other.",
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"org": {
										"type": "string",
										"description": "The org’s id."
									},
									"name": {
										"type": "string",
										"description": "The org’s name."
									}
								},
								"required": [
									"org",
									"name"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						]
					}
				},
				"required": [
					"id",
					"name",
					"createdAt",
					"lastSeenAt",
					"expiresAt",
					"paused",
					"mailboxes",
					"domains",
					"campaigns"
				],
				"additionalProperties": false,
				"example": {
					"id": "grant_3f9a1c0e7b2d",
					"name": "Acme API",
					"createdAt": 1793456940000,
					"lastSeenAt": 1796048940000,
					"expiresAt": 1803824940000,
					"paused": null,
					"mailboxes": [
						{
							"address": "hello@example.com",
							"access": [
								"send"
							],
							"sendAs": [
								"hello@example.com"
							],
							"sending": "ready"
						}
					],
					"domains": [],
					"campaigns": null
				}
			},
			"Token": {
				"title": "The API token object",
				"description": "A person’s own login for scripts: its name and when it was used.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/tokens#token"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "The token’s id: what `tokens revoke` takes."
					},
					"name": {
						"type": "string",
						"description": "The name it was given."
					},
					"createdAt": {
						"type": "number",
						"description": "When it was made, in ms since the epoch."
					},
					"lastSeenAt": {
						"type": "number",
						"description": "When it last made a call, in ms since the epoch."
					},
					"expiresAt": {
						"type": "number",
						"description": "When it stops working, in ms since the epoch."
					}
				},
				"required": [
					"id",
					"name",
					"createdAt",
					"lastSeenAt",
					"expiresAt"
				],
				"additionalProperties": false,
				"example": {
					"id": "out_3f9a1c0e7b2d",
					"name": "Acme API",
					"createdAt": 1796048940000,
					"lastSeenAt": 1796048940000,
					"expiresAt": 1796048940000
				}
			},
			"SendingDomain": {
				"title": "The Sending domain object",
				"description": "A subdomain that only sends: its DNS records and whether it can send.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/sending#sending-domain"
				},
				"type": "object",
				"properties": {
					"domain": {
						"type": "string",
						"description": "The sending domain."
					},
					"trackingDomain": {
						"description": "Where its links and opens go. Null: its mail is never tracked.",
						"type": [
							"string",
							"null"
						]
					},
					"state": {
						"type": "string",
						"enum": [
							"pending",
							"ready",
							"failing",
							"paused"
						],
						"description": "`pending`: not ready yet. `ready`: it can send. `failing`: it was ready and a check stopped passing. `paused`: its brake stopped its mail."
					},
					"checks": {
						"type": "object",
						"properties": {
							"dkim": {
								"type": "boolean",
								"description": "Its DKIM records are in place."
							},
							"bounce": {
								"type": "boolean",
								"description": "Its bounce record is in place."
							},
							"tracking": {
								"type": "boolean",
								"description": "The tracking domain points at Mailset. False with no tracking domain."
							},
							"trackingTls": {
								"type": "boolean",
								"description": "The tracking domain’s certificate is issued. False with no tracking domain."
							}
						},
						"required": [
							"dkim",
							"bounce",
							"tracking",
							"trackingTls"
						],
						"additionalProperties": false,
						"description": "What the last check found."
					},
					"records": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"purpose": {
									"type": "string",
									"enum": [
										"dkim",
										"dkim2",
										"bounce",
										"tracking",
										"mx"
									],
									"description": "What the record is for: `dkim` and `dkim2` sign its mail, `bounce` takes its bounces, `tracking` points the tracking domain at Mailset, `mx` takes mail for its aliases or route."
								},
								"type": {
									"type": "string",
									"enum": [
										"CNAME",
										"TXT",
										"MX"
									],
									"description": "The record’s type."
								},
								"host": {
									"type": "string",
									"description": "The record’s name, in full."
								},
								"value": {
									"type": "string",
									"description": "What the record has to hold."
								},
								"priority": {
									"description": "The MX’s priority. No other record has one.",
									"type": "number"
								},
								"ok": {
									"type": "boolean",
									"description": "Whether DNS answered with it at the last check."
								}
							},
							"required": [
								"purpose",
								"type",
								"host",
								"value",
								"ok"
							],
							"additionalProperties": false
						},
						"description": "The DNS records it needs, and whether each is in place."
					},
					"paused": {
						"description": "Why its brake stopped its mail. Null while it may send.",
						"type": [
							"string",
							"null"
						]
					},
					"route": {
						"description": "The hook every message to the domain goes to (`sending domains route`). Null without one.",
						"type": [
							"string",
							"null"
						]
					},
					"createdAt": {
						"type": "number",
						"description": "When it was added, in ms since the epoch."
					},
					"connect": {
						"description": "One-click setup (Domain Connect): links to the DNS host’s own page that add the records still missing, where the host has Mailset’s templates. Only on `add` and `check`. Open one in a browser to approve it there.",
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"service": {
									"type": "string",
									"enum": [
										"mail",
										"sending",
										"tracking",
										"park",
										"logo"
									],
									"description": "Which of Mailset’s templates the page applies: `mail`, `sending`, `tracking`, `park` or `logo`."
								},
								"url": {
									"type": "string",
									"description": "The DNS host’s page where the domain’s owner approves the records."
								},
								"records": {
									"type": "array",
									"items": {
										"type": "object",
										"properties": {
											"type": {
												"type": "string",
												"description": "The record’s type: CNAME, TXT or MX."
											},
											"host": {
												"type": "string",
												"description": "The record’s name, in full."
											},
											"value": {
												"type": "string",
												"description": "What the record holds."
											},
											"priority": {
												"description": "An MX’s priority. Null on any other record.",
												"type": [
													"number",
													"null"
												]
											}
										},
										"required": [
											"type",
											"host",
											"value",
											"priority"
										],
										"additionalProperties": false
									},
									"description": "What the page adds, as `domains check` lists them."
								}
							},
							"required": [
								"service",
								"url",
								"records"
							],
							"additionalProperties": false
						}
					}
				},
				"required": [
					"domain",
					"trackingDomain",
					"state",
					"checks",
					"records",
					"paused",
					"route",
					"createdAt"
				],
				"additionalProperties": false,
				"example": {
					"domain": "example.com",
					"trackingDomain": "example.com",
					"state": "pending",
					"checks": {
						"dkim": true,
						"bounce": true,
						"tracking": true,
						"trackingTls": true
					},
					"records": [
						{
							"purpose": "dkim",
							"type": "CNAME",
							"host": "text",
							"value": "text",
							"priority": 1,
							"ok": true
						}
					],
					"paused": "text",
					"route": "text",
					"createdAt": 1796048940000,
					"connect": [
						{
							"service": "mail",
							"url": "https://hooks.example.com/mailset",
							"records": [
								{
									"type": "text",
									"host": "text",
									"value": "text",
									"priority": 1
								}
							]
						}
					]
				}
			},
			"Suppression": {
				"title": "The Suppression object",
				"description": "An address a sending domain no longer writes to, and why.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/sending#suppression"
				},
				"type": "object",
				"properties": {
					"address": {
						"type": "string",
						"description": "The address the domain won’t write to."
					},
					"reason": {
						"type": "string",
						"description": "`bounced` (a hard bounce of class `mailbox`, `domain` or `suppressed`) or `complained` (a spam report)."
					},
					"at": {
						"type": "number",
						"description": "When it was suppressed, in ms since the epoch."
					}
				},
				"required": [
					"address",
					"reason",
					"at"
				],
				"additionalProperties": false,
				"example": {
					"address": "hello@example.com",
					"reason": "The day’s sending limit is reached.",
					"at": 1796048940000
				}
			},
			"Route": {
				"title": "The Inbound route object",
				"description": "A subdomain whose incoming email is posted to your webhook.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/routes#route"
				},
				"type": "object",
				"properties": {
					"domain": {
						"type": "string",
						"description": "The domain whose mail goes to the hook."
					},
					"url": {
						"type": "string",
						"description": "The hook’s URL: each message is POSTed there."
					},
					"mx": {
						"type": "string",
						"enum": [
							"ok",
							"missing",
							"elsewhere"
						],
						"description": "Where its MX stands: `ok` points at Mailset, `missing` has none, `elsewhere` points somewhere else."
					},
					"mxFound": {
						"type": "array",
						"items": {
							"type": "string"
						},
						"description": "What its MX answered at the last check, when it doesn’t point at Mailset."
					},
					"waiting": {
						"type": "number",
						"description": "Messages waiting for the hook."
					},
					"delivered": {
						"type": "number",
						"description": "Messages the hook took in the last day."
					},
					"failed": {
						"type": "number",
						"description": "Messages Mailset gave up on in the last day."
					},
					"lastError": {
						"description": "Why the last try failed, while one is waiting.",
						"type": [
							"string",
							"null"
						]
					},
					"createdAt": {
						"type": "number",
						"description": "When the route was added, in ms since the epoch."
					}
				},
				"required": [
					"domain",
					"url",
					"mx",
					"mxFound",
					"waiting",
					"delivered",
					"failed",
					"lastError",
					"createdAt"
				],
				"additionalProperties": false,
				"example": {
					"domain": "example.com",
					"url": "https://hooks.example.com/mailset",
					"mx": "ok",
					"mxFound": [
						"text"
					],
					"waiting": 12,
					"delivered": 1,
					"failed": 1,
					"lastError": "text",
					"createdAt": 1796048940000
				}
			},
			"Domain": {
				"title": "The Domain object",
				"description": "A domain on Mailset: its DNS records, what works, and its policies.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/domains#domain"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "The domain’s id."
					},
					"name": {
						"type": "string",
						"description": "The domain’s name."
					},
					"kind": {
						"type": "string",
						"enum": [
							"mail",
							"sending",
							"parked"
						],
						"description": "`mail`: Mailset sends and receives for it. `sending`: Mailset only sends. `parked`: no mail to or from it."
					},
					"status": {
						"type": "string",
						"enum": [
							"pending",
							"receiving",
							"ready",
							"parked"
						],
						"description": "`pending`: not receiving yet. `receiving`: its mailboxes work. `ready`: sending works too. `parked`: a parked domain’s records are right."
					},
					"sending": {
						"type": "string",
						"enum": [
							"pending",
							"ready",
							"blocked"
						],
						"description": "Whether it can send: `pending`, `ready` or `blocked`."
					},
					"provider": {
						"description": "Which provider sends for it. Null on a parked domain.",
						"type": [
							"string",
							"null"
						]
					},
					"records": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"purpose": {
									"type": "string",
									"enum": [
										"mx",
										"dkim",
										"dkim2",
										"dkim3",
										"bounce",
										"bounce_spf",
										"spf",
										"dmarc",
										"mta_sts",
										"mta_sts_host",
										"tls_rpt",
										"bimi"
									],
									"description": "What the record is for: `mx`, `spf`, `dkim`, `dmarc`, `bounce` and the like."
								},
								"type": {
									"type": "string",
									"enum": [
										"MX",
										"TXT",
										"CNAME"
									],
									"description": "The record’s type: MX, TXT or CNAME."
								},
								"host": {
									"type": "string",
									"description": "The record’s name, in full."
								},
								"value": {
									"type": "string",
									"description": "What the record has to hold."
								},
								"priority": {
									"description": "An MX’s priority. Null on any other record.",
									"type": [
										"number",
										"null"
									]
								},
								"state": {
									"type": "string",
									"enum": [
										"ok",
										"missing",
										"wrong"
									],
									"description": "`ok`: DNS answers with it. `missing`: nothing is there. `wrong`: something else is."
								},
								"found": {
									"description": "What DNS answered instead, when it isn’t what the record should hold.",
									"type": [
										"string",
										"null"
									]
								}
							},
							"required": [
								"purpose",
								"type",
								"host",
								"value",
								"priority",
								"state",
								"found"
							],
							"additionalProperties": false
						},
						"description": "The DNS records it needs, and whether each is in place."
					},
					"sts": {
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"mode": {
										"type": "string",
										"enum": [
											"testing",
											"enforce"
										]
									},
									"state": {
										"type": "string",
										"enum": [
											"pending",
											"testing",
											"enforcing",
											"broken"
										]
									},
									"detail": {
										"description": "What’s wrong or what it’s waiting for. Null when there’s nothing to say.",
										"type": [
											"string",
											"null"
										]
									},
									"reports": {
										"type": "object",
										"properties": {
											"windowDays": {
												"type": "number"
											},
											"reports": {
												"type": "number"
											},
											"successes": {
												"type": "number"
											},
											"failures": {
												"type": "number"
											},
											"failureTypes": {
												"type": "array",
												"items": {
													"type": "string"
												},
												"description": "Kinds of failure, most sessions first: `certificate-expired`."
											},
											"failureReporters": {
												"type": "array",
												"items": {
													"type": "string"
												},
												"description": "The DKIM-verified domains that reported failures."
											},
											"lastAt": {
												"type": [
													"number",
													"null"
												]
											}
										},
										"required": [
											"windowDays",
											"reports",
											"successes",
											"failures",
											"failureTypes",
											"failureReporters",
											"lastAt"
										],
										"additionalProperties": false
									},
									"mxCertificate": {
										"type": "object",
										"properties": {
											"state": {
												"type": "string",
												"enum": [
													"ok",
													"expiring",
													"failing",
													"unknown"
												]
											},
											"detail": {
												"description": "What’s wrong, in a sentence. Null when nothing is.",
												"type": [
													"string",
													"null"
												]
											},
											"daysLeft": {
												"type": [
													"number",
													"null"
												]
											},
											"checkedAt": {
												"type": [
													"number",
													"null"
												]
											}
										},
										"required": [
											"state",
											"detail",
											"daysLeft",
											"checkedAt"
										],
										"additionalProperties": false
									},
									"enforceBlockers": {
										"type": "array",
										"items": {
											"type": "string"
										},
										"description": "Why `enforce` would be refused, as of the last check. Empty: it’s allowed."
									}
								},
								"required": [
									"mode",
									"state",
									"detail",
									"reports",
									"mxCertificate",
									"enforceBlockers"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						],
						"description": "Its MTA-STS policy and TLS reports. Null on a parked domain."
					},
					"dmarc": {
						"description": "Its DMARC record and reports. Null on a parked domain.",
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"problems": {
										"type": "array",
										"items": {
											"type": "string"
										},
										"description": "What’s wrong with the record for mail Mailset sends, one sentence each. Empty: nothing."
									},
									"fix": {
										"description": "The record to publish instead, the owner’s policy kept. Null when nothing needs changing.",
										"type": [
											"string",
											"null"
										]
									},
									"reportsAuthorized": {
										"type": "boolean",
										"description": "Whether Mailset’s zone lets receivers send this domain’s reports to Mailset."
									},
									"reports": {
										"type": "object",
										"properties": {
											"windowDays": {
												"type": "number"
											},
											"reports": {
												"type": "number"
											},
											"messages": {
												"type": "number"
											},
											"passed": {
												"type": "number",
												"description": "Messages that passed DMARC."
											},
											"reporters": {
												"type": "array",
												"items": {
													"type": "string"
												},
												"description": "The DKIM-verified domains that sent reports: `google.com`."
											},
											"failing": {
												"type": "array",
												"items": {
													"type": "object",
													"properties": {
														"ip": {
															"type": "string"
														},
														"messages": {
															"type": "number"
														},
														"disposition": {
															"type": "string",
															"description": "What receivers mostly did with it: none, quarantine or reject."
														},
														"dkim": {
															"type": "string",
															"description": "DKIM’s and SPF’s own results, before alignment: `pass`, `fail`, `none`."
														},
														"spf": {
															"type": "string"
														}
													},
													"required": [
														"ip",
														"messages",
														"disposition",
														"dkim",
														"spf"
													],
													"additionalProperties": false
												},
												"description": "The sources that failed, most messages first."
											},
											"lastAt": {
												"type": [
													"number",
													"null"
												]
											}
										},
										"required": [
											"windowDays",
											"reports",
											"messages",
											"passed",
											"reporters",
											"failing",
											"lastAt"
										],
										"additionalProperties": false
									}
								},
								"required": [
									"problems",
									"fix",
									"reportsAuthorized",
									"reports"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						]
					},
					"checkedAt": {
						"description": "When its records were last checked, in ms since the epoch. Null: never.",
						"type": [
							"number",
							"null"
						]
					},
					"createdAt": {
						"type": "number",
						"description": "When it was added, in ms since the epoch."
					}
				},
				"required": [
					"id",
					"name",
					"kind",
					"status",
					"sending",
					"records",
					"sts",
					"checkedAt",
					"createdAt"
				],
				"additionalProperties": false,
				"example": {
					"id": "out_3f9a1c0e7b2d",
					"name": "Acme API",
					"kind": "mail",
					"status": "pending",
					"sending": "pending",
					"provider": "text",
					"records": [
						{
							"purpose": "mx",
							"type": "MX",
							"host": "text",
							"value": "text",
							"priority": 1,
							"state": "ok",
							"found": "text"
						}
					],
					"sts": {
						"mode": "testing",
						"state": "pending",
						"detail": "text",
						"reports": {
							"windowDays": 1,
							"reports": 1,
							"successes": 1,
							"failures": 1,
							"failureTypes": [
								"text"
							],
							"failureReporters": [
								"text"
							],
							"lastAt": 1796048940000
						},
						"mxCertificate": {
							"state": "ok",
							"detail": "text",
							"daysLeft": 1,
							"checkedAt": 1796048940000
						},
						"enforceBlockers": [
							"text"
						]
					},
					"dmarc": {
						"problems": [
							"text"
						],
						"fix": "text",
						"reportsAuthorized": true,
						"reports": {
							"windowDays": 1,
							"reports": 1,
							"messages": 1,
							"passed": 1,
							"reporters": [
								"text"
							],
							"failing": [
								{
									"ip": "text",
									"messages": 1,
									"disposition": "text",
									"dkim": "text",
									"spf": "text"
								}
							],
							"lastAt": 1796048940000
						}
					},
					"checkedAt": 1796048940000,
					"createdAt": 1796048940000
				}
			},
			"Mailbox": {
				"title": "The Mailbox object",
				"description": "A mailbox you can open: its address, its kind and its people.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/mailboxes#mailbox"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "The mailbox’s id."
					},
					"address": {
						"type": "string",
						"description": "Its address."
					},
					"kind": {
						"type": "string",
						"enum": [
							"person",
							"shared"
						],
						"description": "`person` for one person’s mailbox, `shared` for a team’s."
					},
					"members": {
						"type": "array",
						"items": {
							"type": "string"
						},
						"description": "The addresses of the people who can open it."
					},
					"deactivated": {
						"default": [],
						"description": "People who held it and are deactivated. They can’t open it, and aren’t in `members`.",
						"type": "array",
						"items": {
							"type": "string"
						}
					},
					"names": {
						"description": "What to call the people in `members` and `deactivated`, by address, for those who have a name.",
						"type": "object",
						"propertyNames": {
							"type": "string"
						},
						"additionalProperties": {
							"type": "string"
						}
					},
					"unread": {
						"type": "number",
						"description": "Unread conversations in it."
					},
					"junk": {
						"type": "number",
						"description": "Conversations in its Junk."
					},
					"snoozed": {
						"type": "number",
						"description": "Conversations you have snoozed here."
					},
					"picture": {
						"description": "A short-lived URL of its picture, or null when it has none.",
						"type": [
							"string",
							"null"
						]
					},
					"name": {
						"default": null,
						"description": "The name its mail goes out under. Null sends with the address alone.",
						"type": [
							"string",
							"null"
						]
					},
					"org": {
						"description": "The id of the org it belongs to.",
						"type": "string"
					}
				},
				"required": [
					"id",
					"address",
					"kind",
					"members",
					"deactivated",
					"unread",
					"junk",
					"snoozed",
					"picture",
					"name"
				],
				"additionalProperties": false,
				"example": {
					"id": "out_3f9a1c0e7b2d",
					"address": "hello@example.com",
					"kind": "person",
					"members": [
						"text"
					],
					"deactivated": [
						"text"
					],
					"names": {},
					"unread": 1,
					"junk": 1,
					"snoozed": 1,
					"picture": "text",
					"name": "Acme API",
					"org": "text"
				}
			},
			"Alias": {
				"title": "The Alias object",
				"description": "One more address whose email lands in a mailbox.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/aliases#alias"
				},
				"type": "object",
				"properties": {
					"address": {
						"type": "string",
						"description": "The alias, or `*@domain` for a catch-all."
					},
					"mailbox": {
						"type": "string",
						"description": "The mailbox its mail goes to."
					}
				},
				"required": [
					"address",
					"mailbox"
				],
				"additionalProperties": false,
				"example": {
					"address": "hello@example.com",
					"mailbox": "text"
				}
			},
			"Group": {
				"title": "The Group object",
				"description": "An address that hands its email on to each of its members.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/groups#group"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string"
					},
					"address": {
						"type": "string"
					},
					"name": {
						"type": "string"
					},
					"senders": {
						"type": "string",
						"enum": [
							"anyone",
							"org",
							"members"
						]
					},
					"members": {
						"type": "array",
						"items": {
							"type": "string"
						},
						"description": "Mailboxes and other groups, by address."
					}
				},
				"required": [
					"id",
					"address",
					"name",
					"senders",
					"members"
				],
				"additionalProperties": false,
				"example": {
					"id": "out_3f9a1c0e7b2d",
					"address": "hello@example.com",
					"name": "Acme API",
					"senders": "anyone",
					"members": [
						"text"
					]
				}
			},
			"Forward": {
				"title": "The Forward object",
				"description": "Where a mailbox’s email is forwarded, and how that stands.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/forwarding#forward"
				},
				"type": "object",
				"properties": {
					"mailbox": {
						"type": "string"
					},
					"destination": {
						"type": [
							"string",
							"null"
						]
					},
					"state": {
						"type": "string",
						"enum": [
							"none",
							"pending",
							"active",
							"failing",
							"held",
							"blocked"
						]
					},
					"note": {
						"description": "What this state means for this mailbox, in words.",
						"type": [
							"string",
							"null"
						]
					},
					"failures": {
						"type": "number",
						"description": "Forwards that failed since one last went through."
					},
					"policy": {
						"type": "string",
						"enum": [
							"passkey",
							"never"
						],
						"description": "`never` wins if anyone in the mailbox, or any org admin or owner, chose it."
					},
					"manageable": {
						"type": "boolean",
						"description": "Admins and owners add and change it. Everyone in the mailbox can read it."
					},
					"route": {
						"type": "boolean",
						"description": "The destination is one of the org’s own inbound routes (a product’s hook)."
					},
					"sent": {
						"type": "boolean",
						"description": "What the mailbox sends goes there too. Only a route takes it."
					}
				},
				"required": [
					"mailbox",
					"destination",
					"state",
					"note",
					"failures",
					"policy",
					"manageable",
					"route",
					"sent"
				],
				"additionalProperties": false,
				"example": {
					"mailbox": "text",
					"destination": "text",
					"state": "none",
					"note": "text",
					"failures": 1,
					"policy": "passkey",
					"manageable": true,
					"route": true,
					"sent": true
				}
			},
			"Conversation": {
				"title": "The Conversation object",
				"description": "A conversation as a list shows it: who, what, where it is and its marks.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#conversation"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "The conversation’s id."
					},
					"mailbox": {
						"type": "string",
						"description": "The address of the mailbox it is in."
					},
					"from": {
						"type": "string",
						"description": "Who it is from, as a list shows them."
					},
					"fromAddress": {
						"description": "The address its newest incoming message is from. Absent when nothing in it came in.",
						"type": "string"
					},
					"subject": {
						"type": "string",
						"description": "Its subject."
					},
					"snippet": {
						"type": "string",
						"description": "The start of its newest message."
					},
					"count": {
						"type": "number",
						"description": "How many messages it holds."
					},
					"latestAt": {
						"type": "number",
						"description": "When its newest message is dated, in milliseconds since 1970."
					},
					"unread": {
						"type": "boolean",
						"description": "Whether it is unread."
					},
					"starred": {
						"type": "boolean",
						"description": "Whether any of its messages is starred."
					},
					"important": {
						"type": "boolean",
						"description": "The Important marker: a person or a rule put it there."
					},
					"place": {
						"type": "string",
						"enum": [
							"inbox",
							"archived",
							"trash",
							"junk"
						],
						"description": "Where it is: the inbox, the archive, Trash or Junk."
					},
					"sent": {
						"type": "boolean",
						"description": "You’ve written in it, so it is in Sent."
					},
					"hasAttachment": {
						"type": "boolean",
						"description": "Whether any of its messages has a file."
					},
					"labels": {
						"type": "array",
						"items": {
							"type": "string"
						},
						"description": "The labels on it, by name."
					},
					"snoozedUntil": {
						"description": "When it comes back to your inbox, in milliseconds since 1970, if you’ve snoozed it.",
						"type": [
							"number",
							"null"
						]
					},
					"assignee": {
						"description": "Shared mailboxes only: who owns it, or null when anyone can take it.",
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"email": {
										"type": "string",
										"description": "Their address."
									},
									"name": {
										"description": "Their name, or null when they have none.",
										"type": [
											"string",
											"null"
										]
									},
									"deactivated": {
										"description": "Their org deactivated them. Present only when true.",
										"type": "boolean",
										"const": true
									}
								},
								"required": [
									"email",
									"name"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						]
					},
					"tab": {
						"description": "Its inbox tab. Absent when sorting is off and there is one inbox.",
						"type": "string",
						"enum": [
							"primary",
							"updates",
							"newsletters",
							"promotions"
						]
					},
					"needsReply": {
						"description": "It is waiting on an answer from you.",
						"type": "boolean"
					},
					"phishing": {
						"description": "Why it looks forged. Absent when there is nothing to warn about.",
						"type": "object",
						"properties": {
							"domain": {
								"type": "string",
								"description": "The domain the mail really came from."
							},
							"imitates": {
								"description": "The domain or name it passes itself off as. Null when it imitates nobody known.",
								"type": [
									"string",
									"null"
								]
							},
							"failed": {
								"description": "The check it failed, such as DMARC. Null when none did.",
								"type": [
									"string",
									"null"
								]
							},
							"reason": {
								"description": "What it does that looks like fraud: a `lookalike` domain, a `payment` ask, a request for `credentials`, or a risky `attachment`.",
								"type": "string",
								"enum": [
									"lookalike",
									"payment",
									"credentials",
									"attachment"
								]
							}
						},
						"required": [
							"domain",
							"imitates",
							"failed"
						],
						"additionalProperties": false
					},
					"followUp": {
						"description": "It is back because something you sent got no answer.",
						"type": "boolean"
					},
					"picture": {
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"url": {
										"type": "string",
										"description": "A short-lived URL of the picture."
									},
									"icon": {
										"type": "boolean",
										"description": "It is a site’s icon, drawn smaller on a neutral tile."
									}
								},
								"required": [
									"url",
									"icon"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						],
						"description": "The sender’s picture, or null for initials."
					},
					"senderDeactivated": {
						"description": "The sender shown is someone in your org who is deactivated. Present only when true.",
						"type": "boolean",
						"const": true
					}
				},
				"required": [
					"id",
					"mailbox",
					"from",
					"subject",
					"snippet",
					"count",
					"latestAt",
					"unread",
					"starred",
					"important",
					"place",
					"sent",
					"hasAttachment",
					"labels",
					"snoozedUntil",
					"picture"
				],
				"additionalProperties": false,
				"example": {
					"id": "out_3f9a1c0e7b2d",
					"mailbox": "text",
					"from": "hello@example.com",
					"fromAddress": "hello@example.com",
					"subject": "Your Acme receipt",
					"snippet": "text",
					"count": 12,
					"latestAt": 1796048940000,
					"unread": true,
					"starred": true,
					"important": true,
					"place": "inbox",
					"sent": true,
					"hasAttachment": true,
					"labels": [
						"text"
					],
					"snoozedUntil": 1796048940000,
					"assignee": {
						"email": "hello@example.com",
						"name": "Acme API",
						"deactivated": true
					},
					"tab": "primary",
					"needsReply": true,
					"phishing": {
						"domain": "example.com",
						"imitates": "text",
						"failed": "text",
						"reason": "lookalike"
					},
					"followUp": true,
					"picture": {
						"url": "https://hooks.example.com/mailset",
						"icon": true
					},
					"senderDeactivated": true
				}
			},
			"Message": {
				"title": "The Message object",
				"description": "One message of a conversation, as `threads.get` answers it: its headers, body and files.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/threads#message"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "The message’s id."
					},
					"fromName": {
						"description": "The sender’s name, or null when the message gave none.",
						"type": [
							"string",
							"null"
						]
					},
					"fromAddress": {
						"type": "string",
						"description": "The sender’s address."
					},
					"to": {
						"type": "array",
						"items": {
							"type": "string"
						},
						"description": "The addresses in To and Cc."
					},
					"replyTo": {
						"description": "Where the sender asked for replies to go, when that isn’t just their From. Absent for most mail.",
						"maxItems": 10,
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"name": {
									"description": "The name, or null.",
									"type": [
										"string",
										"null"
									]
								},
								"address": {
									"type": "string",
									"description": "The address."
								}
							},
							"required": [
								"name",
								"address"
							],
							"additionalProperties": false
						}
					},
					"sentAt": {
						"type": "number",
						"description": "When it is dated, in milliseconds since 1970."
					},
					"text": {
						"type": "string",
						"description": "Its text."
					},
					"html": {
						"description": "Its HTML part as it arrived. Null for plain mail, mail sent from here, and anything very large.",
						"type": [
							"string",
							"null"
						]
					},
					"auth": {
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"tls": {
										"type": "boolean",
										"description": "It arrived over an encrypted connection."
									},
									"spf": {
										"type": "boolean",
										"description": "SPF passed."
									},
									"dkim": {
										"type": "boolean",
										"description": "DKIM passed."
									},
									"dmarc": {
										"type": "boolean",
										"description": "DMARC passed."
									},
									"forged": {
										"description": "The sender’s domain says this From is not theirs: DMARC ran and failed.",
										"type": "boolean"
									}
								},
								"required": [
									"tls",
									"spf",
									"dkim",
									"dmarc"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						],
						"description": "How it arrived. Null on mail sent from here."
					},
					"outgoing": {
						"type": "boolean",
						"description": "It was sent from this mailbox."
					},
					"starred": {
						"type": "boolean",
						"description": "Whether it is starred."
					},
					"attachments": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"id": {
									"type": "string",
									"description": "The file’s id, for `attachments.get`."
								},
								"name": {
									"type": "string",
									"description": "Its file name."
								},
								"contentType": {
									"type": "string",
									"description": "Its media type."
								},
								"size": {
									"type": "number",
									"description": "Its size in bytes."
								},
								"inline": {
									"type": "boolean",
									"description": "It is shown inside the message, like a picture in the text."
								},
								"scan": {
									"type": "string",
									"enum": [
										"clean",
										"infected",
										"unscanned"
									],
									"description": "What the virus scan said."
								},
								"skipped": {
									"description": "Why it wasn’t kept, when it wasn’t.",
									"type": [
										"string",
										"null"
									]
								}
							},
							"required": [
								"id",
								"name",
								"contentType",
								"size",
								"inline",
								"scan",
								"skipped"
							],
							"additionalProperties": false
						},
						"description": "Its files."
					},
					"picture": {
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"url": {
										"type": "string",
										"description": "A short-lived URL of the picture."
									},
									"icon": {
										"type": "boolean",
										"description": "It is a site’s icon, drawn smaller on a neutral tile."
									}
								},
								"required": [
									"url",
									"icon"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						],
						"description": "The sender’s picture, or null for initials."
					},
					"deactivated": {
						"description": "Sent by someone in your org who is deactivated. Present only when true.",
						"type": "boolean",
						"const": true
					},
					"unsubscribe": {
						"description": "A way to leave this sender’s list. Absent when the message offers none.",
						"type": "object",
						"properties": {
							"how": {
								"type": "string",
								"enum": [
									"oneClick",
									"link"
								],
								"description": "`oneClick`: Mailset asks the sender for you. `link`: the sender’s own page, for you to open."
							},
							"url": {
								"description": "The sender’s page, when `how` is `link`.",
								"type": "string"
							},
							"done": {
								"type": "boolean",
								"description": "This mailbox already asked this sender to stop."
							}
						},
						"required": [
							"how",
							"done"
						],
						"additionalProperties": false
					}
				},
				"required": [
					"id",
					"fromName",
					"fromAddress",
					"to",
					"sentAt",
					"text",
					"html",
					"auth",
					"outgoing",
					"starred",
					"attachments",
					"picture"
				],
				"additionalProperties": false,
				"example": {
					"id": "out_3f9a1c0e7b2d",
					"fromName": "text",
					"fromAddress": "hello@example.com",
					"to": [
						"ana@example.com"
					],
					"replyTo": [
						{
							"name": "Acme API",
							"address": "hello@example.com"
						}
					],
					"sentAt": 1796048940000,
					"text": "text",
					"html": "text",
					"auth": {
						"tls": true,
						"spf": true,
						"dkim": true,
						"dmarc": true,
						"forged": true
					},
					"outgoing": true,
					"starred": true,
					"attachments": [
						{
							"id": "out_3f9a1c0e7b2d",
							"name": "Acme API",
							"contentType": "text",
							"size": 20480,
							"inline": true,
							"scan": "clean",
							"skipped": "text"
						}
					],
					"picture": {
						"url": "https://hooks.example.com/mailset",
						"icon": true
					},
					"deactivated": true,
					"unsubscribe": {
						"how": "oneClick",
						"url": "https://hooks.example.com/mailset",
						"done": true
					}
				}
			},
			"Draft": {
				"title": "The Draft object",
				"description": "A message being written: its addresses, its words and its files.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/drafts#draft"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "The draft’s id."
					},
					"mailbox": {
						"type": "string",
						"description": "The mailbox it would be sent from."
					},
					"from": {
						"type": "string",
						"description": "The From address: the mailbox’s own or one of its aliases."
					},
					"to": {
						"type": "string",
						"description": "The To addresses, as typed."
					},
					"cc": {
						"type": "string",
						"description": "The Cc addresses, as typed."
					},
					"bcc": {
						"type": "string",
						"description": "The Bcc addresses, as typed."
					},
					"subject": {
						"type": "string",
						"description": "Its subject."
					},
					"text": {
						"type": "string",
						"description": "Its text."
					},
					"threadId": {
						"description": "The conversation it answers, or null for a new one.",
						"type": [
							"string",
							"null"
						]
					},
					"updatedAt": {
						"type": "number",
						"description": "When it was last saved, in milliseconds since 1970."
					},
					"files": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"id": {
									"type": "string",
									"description": "The file’s id."
								},
								"name": {
									"type": "string",
									"description": "Its file name."
								},
								"contentType": {
									"type": "string",
									"description": "Its media type."
								},
								"size": {
									"type": "number",
									"description": "Its size in bytes."
								},
								"scan": {
									"type": "string",
									"enum": [
										"clean",
										"infected",
										"unscanned"
									],
									"description": "What the virus scan said."
								}
							},
							"required": [
								"id",
								"name",
								"contentType",
								"size",
								"scan"
							],
							"additionalProperties": false
						},
						"description": "Its files."
					},
					"markdown": {
						"type": "boolean",
						"description": "The text carries formatting marks, so it goes out formatted."
					}
				},
				"required": [
					"id",
					"mailbox",
					"from",
					"to",
					"cc",
					"bcc",
					"subject",
					"text",
					"threadId",
					"updatedAt",
					"files",
					"markdown"
				],
				"additionalProperties": false,
				"example": {
					"id": "out_3f9a1c0e7b2d",
					"mailbox": "text",
					"from": "hello@example.com",
					"to": "ana@example.com",
					"cc": "text",
					"bcc": "text",
					"subject": "Your Acme receipt",
					"text": "text",
					"threadId": "out_3f9a1c0e7b2d",
					"updatedAt": 1796048940000,
					"files": [
						{
							"id": "out_3f9a1c0e7b2d",
							"name": "Acme API",
							"contentType": "text",
							"size": 20480,
							"scan": "clean"
						}
					],
					"markdown": true
				}
			},
			"Label": {
				"title": "The Label object",
				"description": "A label: its name, its color and how many conversations carry it.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/labels#label"
				},
				"type": "object",
				"properties": {
					"name": {
						"type": "string",
						"description": "The label’s name."
					},
					"color": {
						"type": "string",
						"enum": [
							"slate",
							"amber",
							"green",
							"red",
							"blue",
							"violet"
						],
						"description": "Its color."
					},
					"count": {
						"type": "number",
						"description": "Conversations carrying it, outside Trash and Junk."
					}
				},
				"required": [
					"name",
					"color",
					"count"
				],
				"additionalProperties": false,
				"example": {
					"name": "Acme API",
					"color": "slate",
					"count": 12
				}
			},
			"Rule": {
				"title": "The Rule object",
				"description": "A rule on a mailbox: the email it matches and what it does to it.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/rules#rule"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "The rule’s id."
					},
					"mailbox": {
						"type": "string",
						"description": "The mailbox it runs on."
					},
					"name": {
						"type": "string",
						"description": "The rule’s name."
					},
					"conditions": {
						"type": "object",
						"properties": {
							"from": {
								"description": "Mail from this sender.",
								"type": "string"
							},
							"to": {
								"description": "Mail sent to this address.",
								"type": "string"
							},
							"subject": {
								"description": "Words in the subject.",
								"type": "string"
							},
							"hasWords": {
								"description": "Words anywhere in it.",
								"type": "string"
							},
							"doesntHave": {
								"description": "Words it must not have.",
								"type": "string"
							},
							"hasAttachment": {
								"description": "It carries a file.",
								"type": "boolean"
							},
							"larger": {
								"description": "Larger than this many bytes.",
								"type": "number"
							},
							"smaller": {
								"description": "Smaller than this many bytes.",
								"type": "number"
							}
						},
						"additionalProperties": false,
						"description": "What mail it matches. Every part has to hold."
					},
					"actions": {
						"type": "object",
						"properties": {
							"skipInbox": {
								"description": "Archives it as it arrives.",
								"type": "boolean"
							},
							"markRead": {
								"description": "Marks it read.",
								"type": "boolean"
							},
							"star": {
								"description": "Stars it.",
								"type": "boolean"
							},
							"label": {
								"description": "Puts this label on it.",
								"type": "string"
							},
							"forward": {
								"description": "Forwards it to this address.",
								"type": "string"
							},
							"delete": {
								"description": "Moves it to Trash.",
								"type": "boolean"
							},
							"neverJunk": {
								"description": "Never sends it to Junk.",
								"type": "boolean"
							},
							"important": {
								"description": "Marks the conversation important.",
								"type": "boolean"
							},
							"neverImportant": {
								"description": "Keeps it from ever being marked important. Beats `important`.",
								"type": "boolean"
							},
							"tab": {
								"description": "Files it in this inbox tab.",
								"type": "string",
								"enum": [
									"primary",
									"updates",
									"newsletters",
									"promotions"
								]
							}
						},
						"additionalProperties": false,
						"description": "What it does to that mail."
					},
					"summary": {
						"type": "string",
						"description": "The rule in one line, in the operators it’s written in."
					},
					"matched": {
						"type": "number",
						"description": "Conversations it has matched or changed."
					},
					"run": {
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"id": {
										"type": "string",
										"description": "The run’s id."
									},
									"state": {
										"type": "string",
										"enum": [
											"running",
											"done",
											"failed"
										],
										"description": "`running`, `done` or `failed`."
									},
									"scanned": {
										"type": "number",
										"description": "Conversations looked at so far."
									},
									"changed": {
										"type": "number",
										"description": "Of those, how many the rule changed."
									},
									"reason": {
										"type": [
											"string",
											"null"
										]
									}
								},
								"required": [
									"id",
									"state",
									"scanned",
									"changed",
									"reason"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						],
						"description": "Its latest run over existing mail, if it has had one."
					},
					"forwardWaiting": {
						"type": "boolean",
						"description": "It forwards, and forwarding isn’t on here yet."
					}
				},
				"required": [
					"id",
					"mailbox",
					"name",
					"conditions",
					"actions",
					"summary",
					"matched",
					"run",
					"forwardWaiting"
				],
				"additionalProperties": false,
				"example": {
					"id": "out_3f9a1c0e7b2d",
					"mailbox": "text",
					"name": "Acme API",
					"conditions": {
						"from": "hello@example.com",
						"to": "ana@example.com",
						"subject": "Your Acme receipt",
						"hasWords": "text",
						"doesntHave": "text",
						"hasAttachment": true,
						"larger": 1,
						"smaller": 1
					},
					"actions": {
						"skipInbox": true,
						"markRead": true,
						"star": true,
						"label": "text",
						"forward": "text",
						"delete": true,
						"neverJunk": true,
						"important": true,
						"neverImportant": true,
						"tab": "primary"
					},
					"summary": "text",
					"matched": 1,
					"run": {
						"id": "out_3f9a1c0e7b2d",
						"state": "running",
						"scanned": 1,
						"changed": 1,
						"reason": "The day’s sending limit is reached."
					},
					"forwardWaiting": true
				}
			},
			"Contact": {
				"title": "The Contact object",
				"description": "A person in your contacts, with every field you keep of them.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/contacts#contact"
				},
				"type": "object",
				"properties": {
					"id": {
						"type": "string",
						"description": "The contact’s id."
					},
					"name": {
						"type": "string",
						"description": "The full name as shown."
					},
					"firstName": {
						"type": "string"
					},
					"middleName": {
						"type": "string"
					},
					"lastName": {
						"type": "string"
					},
					"prefix": {
						"type": "string"
					},
					"suffix": {
						"type": "string"
					},
					"nickname": {
						"type": "string"
					},
					"company": {
						"type": "string"
					},
					"title": {
						"type": "string"
					},
					"department": {
						"type": "string"
					},
					"emails": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"value": {
									"type": "string",
									"description": "The address, number, URL or text."
								},
								"label": {
									"type": "string",
									"description": "What it’s for: `work`, `home`. Empty when unlabelled."
								}
							},
							"required": [
								"value",
								"label"
							],
							"additionalProperties": false
						}
					},
					"phones": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"value": {
									"type": "string",
									"description": "The address, number, URL or text."
								},
								"label": {
									"type": "string",
									"description": "What it’s for: `work`, `home`. Empty when unlabelled."
								}
							},
							"required": [
								"value",
								"label"
							],
							"additionalProperties": false
						}
					},
					"addresses": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"value": {
									"type": "string",
									"description": "The address, number, URL or text."
								},
								"label": {
									"type": "string",
									"description": "What it’s for: `work`, `home`. Empty when unlabelled."
								}
							},
							"required": [
								"value",
								"label"
							],
							"additionalProperties": false
						}
					},
					"websites": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"value": {
									"type": "string",
									"description": "The address, number, URL or text."
								},
								"label": {
									"type": "string",
									"description": "What it’s for: `work`, `home`. Empty when unlabelled."
								}
							},
							"required": [
								"value",
								"label"
							],
							"additionalProperties": false
						}
					},
					"birthday": {
						"type": "string"
					},
					"notes": {
						"type": "string"
					},
					"labels": {
						"type": "array",
						"items": {
							"type": "string"
						},
						"description": "The labels on the contact, by name."
					},
					"other": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"value": {
									"type": "string",
									"description": "The address, number, URL or text."
								},
								"label": {
									"type": "string",
									"description": "What it’s for: `work`, `home`. Empty when unlabelled."
								}
							},
							"required": [
								"value",
								"label"
							],
							"additionalProperties": false
						}
					},
					"picture": {
						"description": "A short-lived URL for their photo. Null: none, so show initials.",
						"type": [
							"string",
							"null"
						]
					},
					"createdAt": {
						"type": "number",
						"description": "When it was saved, in ms since the epoch."
					},
					"updatedAt": {
						"type": "number",
						"description": "When it last changed, in ms since the epoch."
					}
				},
				"required": [
					"id",
					"name",
					"firstName",
					"middleName",
					"lastName",
					"prefix",
					"suffix",
					"nickname",
					"company",
					"title",
					"department",
					"emails",
					"phones",
					"addresses",
					"websites",
					"birthday",
					"notes",
					"labels",
					"other",
					"picture",
					"createdAt",
					"updatedAt"
				],
				"additionalProperties": false,
				"example": {
					"id": "out_3f9a1c0e7b2d",
					"name": "Acme API",
					"firstName": "text",
					"middleName": "text",
					"lastName": "text",
					"prefix": "text",
					"suffix": "text",
					"nickname": "text",
					"company": "text",
					"title": "text",
					"department": "text",
					"emails": [
						{
							"value": "text",
							"label": "text"
						}
					],
					"phones": [
						{
							"value": "text",
							"label": "text"
						}
					],
					"addresses": [
						{
							"value": "text",
							"label": "text"
						}
					],
					"websites": [
						{
							"value": "text",
							"label": "text"
						}
					],
					"birthday": "text",
					"notes": "text",
					"labels": [
						"text"
					],
					"other": [
						{
							"value": "text",
							"label": "text"
						}
					],
					"picture": "text",
					"createdAt": 1796048940000,
					"updatedAt": 1796048940000
				}
			},
			"AiSettings": {
				"title": "The AI settings object",
				"description": "An org’s AI: what it runs on, a model per feature, and this month.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/ai#ai-settings"
				},
				"type": "object",
				"properties": {
					"source": {
						"type": "string",
						"enum": [
							"mailset",
							"own",
							"off"
						],
						"description": "What the org chose to run AI on. `mailset`: Mailset’s key. `own`: the org’s own key. `off`: no AI."
					},
					"using": {
						"anyOf": [
							{
								"type": "string",
								"enum": [
									"mailset",
									"own"
								]
							},
							{
								"type": "null"
							}
						],
						"description": "What calls go to right now. Null when nothing does."
					},
					"mailsetAllowed": {
						"type": "boolean",
						"description": "Whether the org’s plan lets it use Mailset’s key."
					},
					"configured": {
						"type": "boolean",
						"description": "Whether Mailset’s own key is there to run AI on."
					},
					"banner": {
						"anyOf": [
							{
								"type": "string",
								"enum": [
									"no_ai",
									"credit_used",
									"key_failing"
								]
							},
							{
								"type": "null"
							}
						],
						"description": "What to tell people about the org’s AI right now, if anything."
					},
					"key": {
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"provider": {
										"type": "string",
										"enum": [
											"anthropic"
										],
										"description": "Whose key it is."
									},
									"last4": {
										"type": "string",
										"description": "The key’s last four characters. The rest is never shown."
									},
									"state": {
										"type": "string",
										"enum": [
											"ok",
											"failing"
										],
										"description": "failing: the provider refused it, and the org’s AI is paused until it’s fixed."
									},
									"failure": {
										"anyOf": [
											{
												"type": "string",
												"enum": [
													"invalid",
													"no_credit"
												]
											},
											{
												"type": "null"
											}
										],
										"description": "Why the key stopped working: `invalid`, or `no_credit` left on it. Null while it works."
									},
									"problem": {
										"description": "What went wrong and what to do, in words. Null while it works.",
										"type": [
											"string",
											"null"
										]
									},
									"addedAt": {
										"type": "number",
										"description": "When the key was saved, in ms since the epoch."
									},
									"checkedAt": {
										"type": "number",
										"description": "When it was last tried, in ms since the epoch."
									},
									"limitedUntil": {
										"description": "Until when the provider asked to slow down; null when it hasn’t.",
										"type": [
											"number",
											"null"
										]
									}
								},
								"required": [
									"provider",
									"last4",
									"state",
									"failure",
									"problem",
									"addedAt",
									"checkedAt",
									"limitedUntil"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						],
						"description": "The org’s own key. Null: none saved."
					},
					"provider": {
						"type": "string",
						"enum": [
							"anthropic"
						],
						"description": "Whose models the features pick from."
					},
					"features": {
						"type": "array",
						"items": {
							"type": "object",
							"properties": {
								"job": {
									"type": "string",
									"enum": [
										"triage",
										"phishing",
										"summary",
										"replies",
										"draft",
										"followup",
										"search",
										"chat"
									],
									"description": "The feature’s id."
								},
								"slug": {
									"type": "string",
									"description": "The feature as `ai models set` names it."
								},
								"name": {
									"type": "string",
									"description": "The feature’s name."
								},
								"about": {
									"type": "string",
									"description": "What the feature does, in a sentence."
								},
								"soon": {
									"type": "boolean",
									"description": "Held for later: nothing calls it yet."
								},
								"model": {
									"type": "string",
									"description": "The org’s pick, which runs on its own key."
								},
								"defaultModel": {
									"type": "string",
									"description": "Mailset’s pick for it."
								},
								"inUse": {
									"description": "What runs right now: the default on Mailset’s key. Null while AI is off.",
									"type": [
										"string",
										"null"
									]
								},
								"units": {
									"type": "number",
									"description": "Units behind the estimate, over `days`."
								},
								"usd": {
									"type": "number",
									"description": "A month of it at the org’s own volume: at Mailset’s price list on Mailset’s key, at the provider’s list prices on the org’s own."
								},
								"options": {
									"type": "array",
									"items": {
										"type": "object",
										"properties": {
											"model": {
												"type": "string",
												"description": "The model’s id: what `ai models set --model` takes."
											},
											"name": {
												"type": "string",
												"description": "The model’s name."
											},
											"usd": {
												"type": "number",
												"description": "A month of this feature on this model on the org’s own key, at the provider’s list prices."
											}
										},
										"required": [
											"model",
											"name",
											"usd"
										],
										"additionalProperties": false
									},
									"description": "The models it can use."
								},
								"warning": {
									"description": "Set when the model it uses is a costly one for what it does.",
									"type": [
										"string",
										"null"
									]
								}
							},
							"required": [
								"job",
								"slug",
								"name",
								"about",
								"soon",
								"model",
								"defaultModel",
								"inUse",
								"units",
								"usd",
								"options",
								"warning"
							],
							"additionalProperties": false
						},
						"description": "Each AI feature, the model it uses and what a month of it costs."
					},
					"days": {
						"type": "number",
						"description": "Days of the org’s own volume behind the estimates, at most 30. Zero: none yet."
					},
					"month": {
						"type": "object",
						"properties": {
							"credit": {
								"type": "object",
								"properties": {
									"from": {
										"type": "string",
										"description": "The first day of this month, UTC."
									},
									"usd": {
										"description": "Null: no credit limits it.",
										"type": [
											"number",
											"null"
										]
									},
									"usedUsd": {
										"type": "number",
										"description": "What calls on Mailset’s key were worth this month, at the price list."
									},
									"units": {
										"type": "array",
										"items": {
											"type": "object",
											"properties": {
												"job": {
													"type": "string",
													"enum": [
														"triage",
														"phishing",
														"summary",
														"replies",
														"draft",
														"followup",
														"search",
														"chat"
													]
												},
												"units": {
													"type": "number"
												}
											},
											"required": [
												"job",
												"units"
											],
											"additionalProperties": false
										}
									},
									"usedWords": {
										"type": "string",
										"description": "The same in plain words: \"about 4,200 sorted emails, 37 drafts\"."
									},
									"display": {
										"type": "string",
										"enum": [
											"bar",
											"earlier",
											"none"
										]
									}
								},
								"required": [
									"from",
									"usd",
									"usedUsd",
									"units",
									"usedWords",
									"display"
								],
								"additionalProperties": false,
								"description": "The month’s AI credit on Mailset’s key, and what was used of it."
							},
							"own": {
								"type": "object",
								"properties": {
									"calls": {
										"type": "number"
									},
									"usd": {
										"type": "number"
									}
								},
								"required": [
									"calls",
									"usd"
								],
								"additionalProperties": false,
								"description": "On the org’s own key, at the provider’s list prices. Mailset never bills it."
							}
						},
						"required": [
							"credit",
							"own"
						],
						"additionalProperties": false,
						"description": "This month so far."
					}
				},
				"required": [
					"source",
					"using",
					"mailsetAllowed",
					"configured",
					"banner",
					"key",
					"provider",
					"features",
					"days",
					"month"
				],
				"additionalProperties": false,
				"example": {
					"source": "mailset",
					"using": "mailset",
					"mailsetAllowed": true,
					"configured": true,
					"banner": "no_ai",
					"key": {
						"provider": "anthropic",
						"last4": "text",
						"state": "ok",
						"failure": "invalid",
						"problem": "text",
						"addedAt": 1796048940000,
						"checkedAt": 1796048940000,
						"limitedUntil": 1796048940000
					},
					"provider": "anthropic",
					"features": [
						{
							"job": "triage",
							"slug": "text",
							"name": "Acme API",
							"about": "text",
							"soon": true,
							"model": "text",
							"defaultModel": "text",
							"inUse": "text",
							"units": 1,
							"usd": 1,
							"options": [
								{
									"model": "text",
									"name": "Acme API",
									"usd": 1
								}
							],
							"warning": "text"
						}
					],
					"days": 1,
					"month": {
						"credit": {
							"from": "hello@example.com",
							"usd": 1,
							"usedUsd": 1,
							"units": [
								{
									"job": "triage",
									"units": 1
								}
							],
							"usedWords": "text",
							"display": "bar"
						},
						"own": {
							"calls": 1,
							"usd": 1
						}
					}
				}
			},
			"Billing": {
				"title": "The Billing object",
				"description": "An org’s plan, what it pays for, its balance and what comes next.",
				"externalDocs": {
					"url": "https://mailset.app/docs/api/billing#billing"
				},
				"type": "object",
				"properties": {
					"plan": {
						"type": "string",
						"enum": [
							"trial",
							"base",
							"team"
						],
						"description": "The org’s plan: `trial`, `base` or `team`."
					},
					"arranged": {
						"default": false,
						"description": "The plan’s terms were arranged with Mailset, not taken from the price list: no list price applies, and nothing here upgrades, switches or cancels it.",
						"type": "boolean"
					},
					"interval": {
						"anyOf": [
							{
								"type": "string",
								"enum": [
									"month",
									"year"
								]
							},
							{
								"type": "null"
							}
						],
						"description": "How Base is billed. Null on other plans."
					},
					"payAsYouGo": {
						"type": "boolean",
						"description": "Whether use past the plan’s allowances draws from the balance."
					},
					"status": {
						"type": "string",
						"enum": [
							"active",
							"past_due",
							"canceled"
						],
						"description": "The subscription’s state: `active`, `past_due` or `canceled`."
					},
					"trialEndsAt": {
						"description": "When the trial ends, in ms since the epoch. Null outside a trial.",
						"type": [
							"number",
							"null"
						]
					},
					"trialDaysLeft": {
						"description": "Whole days left, counted up. Null outside a live trial.",
						"type": [
							"number",
							"null"
						]
					},
					"ended": {
						"type": "boolean",
						"description": "The trial ended, or the subscription was canceled, and nothing replaced it."
					},
					"afterEnd": {
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"since": {
										"type": "number"
									},
									"mailStopsAt": {
										"type": "number",
										"description": "From here new mail to the org’s addresses is refused."
									},
									"mailStopped": {
										"type": "boolean"
									},
									"deletesAt": {
										"type": "number",
										"description": "From here the org’s mailboxes, with their mail and files, are deleted."
									},
									"deletedAt": {
										"description": "When they were. Null: not yet.",
										"type": [
											"number",
											"null"
										]
									}
								},
								"required": [
									"since",
									"mailStopsAt",
									"mailStopped",
									"deletesAt",
									"deletedAt"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						],
						"description": "What happens after the plan ended. Null while the plan is live, and on a plan arranged with Mailset."
					},
					"mailsetAi": {
						"type": "string",
						"enum": [
							"on",
							"credit_used",
							"off"
						],
						"description": "Whether the org may use Mailset’s AI, and why not when it may not."
					},
					"tier": {
						"type": "string",
						"enum": [
							"no_card",
							"trial",
							"paid"
						],
						"description": "How far the org may send. `sending status` has the limits."
					},
					"members": {
						"type": "object",
						"properties": {
							"count": {
								"type": "number"
							},
							"invited": {
								"type": "number",
								"description": "Invites nobody has accepted yet. They count once they join."
							},
							"included": {
								"description": "What the plan includes. Null: no count applies.",
								"type": [
									"number",
									"null"
								]
							},
							"cap": {
								"description": "Past this an invite is refused (a trial, a plan arranged with Mailset). Null: seats instead.",
								"type": [
									"number",
									"null"
								]
							},
							"extra": {
								"type": "number",
								"description": "Seats past the included members, billed on the subscription."
							},
							"seatCents": {
								"description": "What one more costs, a month or a year (`interval`). Null: none is charged.",
								"type": [
									"number",
									"null"
								]
							}
						},
						"required": [
							"count",
							"invited",
							"included",
							"cap",
							"extra",
							"seatCents"
						],
						"additionalProperties": false,
						"description": "The people who sign in, against what the plan includes."
					},
					"cheaper": {
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"plan": {
										"type": "string",
										"enum": [
											"base",
											"team"
										]
									},
									"interval": {
										"type": "string",
										"enum": [
											"month",
											"year"
										]
									},
									"cents": {
										"type": "number"
									},
									"currentCents": {
										"type": "number"
									}
								},
								"required": [
									"plan",
									"interval",
									"cents",
									"currentCents"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						],
						"description": "A plan that would cost less for these members, with what it costs a month."
					},
					"usage": {
						"type": "object",
						"properties": {
							"periodStart": {
								"type": "number",
								"description": "The calendar month in UTC: its first instant and the next month’s."
							},
							"periodEnd": {
								"type": "number"
							},
							"ai": {
								"type": "object",
								"properties": {
									"priceMicros": {
										"type": "number",
										"description": "Mailset’s AI this month at its price list."
									},
									"creditMicros": {
										"description": "The month’s AI credit. Null: none limits it (no prices here, or Mailset’s own org).",
										"type": [
											"number",
											"null"
										]
									},
									"overMicros": {
										"type": "number"
									}
								},
								"required": [
									"priceMicros",
									"creditMicros",
									"overMicros"
								],
								"additionalProperties": false
							},
							"storage": {
								"type": "object",
								"properties": {
									"bytes": {
										"type": "number",
										"description": "The latest daily count."
									},
									"includedBytes": {
										"description": "Null: no prices here, so nothing is included or over.",
										"type": [
											"number",
											"null"
										]
									},
									"overGbMonths": {
										"type": "number",
										"description": "GB-months past what’s included, so far this month."
									}
								},
								"required": [
									"bytes",
									"includedBytes",
									"overGbMonths"
								],
								"additionalProperties": false
							},
							"emails": {
								"type": "object",
								"properties": {
									"outside": {
										"type": "number",
										"description": "Recipients outside the org’s own domains this month. Incoming and internal mail never count."
									},
									"allowance": {
										"type": [
											"number",
											"null"
										]
									},
									"over": {
										"type": "number"
									}
								},
								"required": [
									"outside",
									"allowance",
									"over"
								],
								"additionalProperties": false
							},
							"owedMicros": {
								"type": "number",
								"description": "What this month’s use past the allowances costs so far: drawn, and not yet."
							},
							"billed": {
								"type": "boolean",
								"description": "Pay as you go draws it from the balance."
							}
						},
						"required": [
							"periodStart",
							"periodEnd",
							"ai",
							"storage",
							"emails",
							"owedMicros",
							"billed"
						],
						"additionalProperties": false,
						"description": "This month’s use against the plan’s allowances."
					},
					"balance": {
						"type": "object",
						"properties": {
							"micros": {
								"type": "number",
								"description": "What the ledger holds."
							},
							"pendingMicros": {
								"type": "number",
								"description": "Usage not drawn yet (today’s, mostly)."
							},
							"availableMicros": {
								"type": "number",
								"description": "What draws see: the ledger less what’s pending, or zero after a failed charge."
							},
							"failed": {
								"type": "boolean",
								"description": "A charge failed and hasn’t gone through since."
							},
							"retryAt": {
								"type": [
									"number",
									"null"
								]
							},
							"expiringMicros": {
								"type": "number",
								"description": "Credit that expires in the next 30 days."
							},
							"cardSaved": {
								"type": "boolean",
								"description": "A card is saved, so auto top-ups can charge it."
							},
							"autoTopup": {
								"type": "object",
								"properties": {
									"on": {
										"type": "boolean"
									},
									"thresholdMicros": {
										"type": "number"
									},
									"amountMicros": {
										"type": "number"
									},
									"ceilingMicros": {
										"type": "number",
										"description": "The most auto top-ups may charge in a calendar month."
									},
									"usedThisMonthMicros": {
										"type": "number"
									}
								},
								"required": [
									"on",
									"thresholdMicros",
									"amountMicros",
									"ceilingMicros",
									"usedThisMonthMicros"
								],
								"additionalProperties": false
							}
						},
						"required": [
							"micros",
							"pendingMicros",
							"availableMicros",
							"failed",
							"retryAt",
							"expiringMicros",
							"cardSaved",
							"autoTopup"
						],
						"additionalProperties": false,
						"description": "The prepaid balance and auto top-up."
					},
					"available": {
						"type": "boolean",
						"description": "Whether card payments are available, so Upgrade, Add credit and Manage billing work."
					},
					"subscribed": {
						"type": "boolean",
						"description": "The org has a paid subscription."
					},
					"prices": {
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"currency": {
										"type": "string"
									},
									"baseMonthlyCents": {
										"type": "number"
									},
									"baseYearlyCents": {
										"type": "number"
									},
									"teamMonthlyCents": {
										"type": "number"
									},
									"teamYearlyCents": {
										"type": "number"
									},
									"baseMembers": {
										"type": "number",
										"description": "Members (people who sign in) each plan includes. Mailboxes are unlimited."
									},
									"teamMembers": {
										"type": "number"
									},
									"trialMembers": {
										"type": "number"
									},
									"baseSeatMonthlyCents": {
										"type": "number",
										"description": "Each member past them: a seat on the subscription."
									},
									"baseSeatYearlyCents": {
										"type": "number"
									},
									"teamSeatMonthlyCents": {
										"type": "number"
									},
									"teamSeatYearlyCents": {
										"type": "number"
									},
									"storageGb": {
										"type": "number",
										"description": "Every plan’s monthly allowances."
									},
									"emailAllowance": {
										"type": "number"
									},
									"aiCreditCents": {
										"type": "number"
									},
									"emailsPer1000Cents": {
										"type": "number",
										"description": "What draws from the balance past them."
									},
									"storageGbMonthCents": {
										"type": "number"
									},
									"topupMinCents": {
										"type": "number",
										"description": "Top-ups: the least one can be, and the defaults an owner can change."
									},
									"topupThresholdCents": {
										"type": "number"
									},
									"topupAmountCents": {
										"type": "number"
									},
									"topupCeilingCents": {
										"type": "number"
									},
									"overdraftCents": {
										"type": "number",
										"description": "How far storage may take the balance below zero before it stops drawing."
									},
									"creditMonths": {
										"type": "number",
										"description": "How long a credit lasts."
									},
									"endedReceiveDays": {
										"type": "number",
										"description": "After a plan ends unpaid: new mail to the org is refused from this many days on, and its mail and files are deleted at the second."
									},
									"endedDeleteDays": {
										"type": "number"
									}
								},
								"required": [
									"currency",
									"baseMonthlyCents",
									"baseYearlyCents",
									"teamMonthlyCents",
									"teamYearlyCents",
									"baseMembers",
									"teamMembers",
									"trialMembers",
									"baseSeatMonthlyCents",
									"baseSeatYearlyCents",
									"teamSeatMonthlyCents",
									"teamSeatYearlyCents",
									"storageGb",
									"emailAllowance",
									"aiCreditCents",
									"emailsPer1000Cents",
									"storageGbMonthCents",
									"topupMinCents",
									"topupThresholdCents",
									"topupAmountCents",
									"topupCeilingCents",
									"overdraftCents",
									"creditMonths",
									"endedReceiveDays",
									"endedDeleteDays"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						],
						"description": "What plans and extra use cost. Null where nothing is charged."
					},
					"offer": {
						"anyOf": [
							{
								"type": "object",
								"properties": {
									"code": {
										"type": "string"
									},
									"name": {
										"type": "string"
									},
									"percent": {
										"type": "number"
									},
									"months": {
										"type": "number"
									},
									"claimedAt": {
										"type": "number"
									},
									"redeemBy": {
										"type": "number",
										"description": "A UTC midnight: Checkout takes the offer off until then."
									}
								},
								"required": [
									"code",
									"name",
									"percent",
									"months",
									"claimedAt",
									"redeemBy"
								],
								"additionalProperties": false
							},
							{
								"type": "null"
							}
						],
						"description": "The launch offer this org can still subscribe with. Null: none, or it’s used."
					},
					"renewsAt": {
						"default": null,
						"description": "When the subscription renews, in ms since the epoch: its period’s end. Null with none.",
						"type": [
							"number",
							"null"
						]
					},
					"cancelAt": {
						"default": null,
						"description": "The plan is set to end then, at its period’s end. Null: it renews.",
						"type": [
							"number",
							"null"
						]
					},
					"paymentRetryAt": {
						"default": null,
						"description": "When a failed payment is tried again, in ms since the epoch. Null: none planned.",
						"type": [
							"number",
							"null"
						]
					}
				},
				"required": [
					"plan",
					"arranged",
					"interval",
					"payAsYouGo",
					"status",
					"trialEndsAt",
					"trialDaysLeft",
					"ended",
					"afterEnd",
					"mailsetAi",
					"tier",
					"members",
					"cheaper",
					"usage",
					"balance",
					"available",
					"subscribed",
					"prices",
					"offer",
					"renewsAt",
					"cancelAt",
					"paymentRetryAt"
				],
				"additionalProperties": false,
				"example": {
					"plan": "trial",
					"arranged": false,
					"interval": "month",
					"payAsYouGo": true,
					"status": "active",
					"trialEndsAt": 1796048940000,
					"trialDaysLeft": 1,
					"ended": true,
					"afterEnd": {
						"since": 1796048940000,
						"mailStopsAt": 1796048940000,
						"mailStopped": true,
						"deletesAt": 1796048940000,
						"deletedAt": 1796048940000
					},
					"mailsetAi": "on",
					"tier": "no_card",
					"members": {
						"count": 12,
						"invited": 1,
						"included": 1,
						"cap": 1,
						"extra": 1,
						"seatCents": 1
					},
					"cheaper": {
						"plan": "base",
						"interval": "month",
						"cents": 1,
						"currentCents": 1
					},
					"usage": {
						"periodStart": 1,
						"periodEnd": 1,
						"ai": {
							"priceMicros": 1,
							"creditMicros": 1,
							"overMicros": 1
						},
						"storage": {
							"bytes": 20480,
							"includedBytes": 20480,
							"overGbMonths": 1
						},
						"emails": {
							"outside": 1,
							"allowance": 1,
							"over": 1
						},
						"owedMicros": 1,
						"billed": true
					},
					"balance": {
						"micros": 1,
						"pendingMicros": 1,
						"availableMicros": 1,
						"failed": true,
						"retryAt": 1796048940000,
						"expiringMicros": 1,
						"cardSaved": true,
						"autoTopup": {
							"on": true,
							"thresholdMicros": 1,
							"amountMicros": 1,
							"ceilingMicros": 1,
							"usedThisMonthMicros": 1
						}
					},
					"available": true,
					"subscribed": true,
					"prices": {
						"currency": "text",
						"baseMonthlyCents": 1,
						"baseYearlyCents": 1,
						"teamMonthlyCents": 1,
						"teamYearlyCents": 1,
						"baseMembers": 1,
						"teamMembers": 1,
						"trialMembers": 1,
						"baseSeatMonthlyCents": 1,
						"baseSeatYearlyCents": 1,
						"teamSeatMonthlyCents": 1,
						"teamSeatYearlyCents": 1,
						"storageGb": 1,
						"emailAllowance": 1,
						"aiCreditCents": 1,
						"emailsPer1000Cents": 1,
						"storageGbMonthCents": 1,
						"topupMinCents": 1,
						"topupThresholdCents": 1,
						"topupAmountCents": 1,
						"topupCeilingCents": 1,
						"overdraftCents": 1,
						"creditMonths": 1,
						"endedReceiveDays": 1,
						"endedDeleteDays": 1
					},
					"offer": {
						"code": "482913",
						"name": "Acme API",
						"percent": 1,
						"months": 1,
						"claimedAt": 1796048940000,
						"redeemBy": 1796048940000
					},
					"renewsAt": 1796048940000,
					"cancelAt": 1796048940000,
					"paymentRetryAt": 1796048940000
				}
			}
		},
		"responses": {
			"Error": {
				"description": "400 `invalid_input`: The request is wrong. `issues` names each field.\n401 `unauthorized`: No valid credential: a missing or wrong token, a bad `ms-proof`, or a clock more than two minutes off.\n403 `step_up_required`: This needs a passkey. `purpose` names the action to approve.\n403 `forbidden`: The credential may not do this.\n404 `not_found`: There is no such thing, or the caller can’t see it.\n409 `conflict`: It can’t be done as things stand.\n410 `expired`: What the request names is past its time.\n429 `limit_reached`: A limit refused it. `retryAt` says when it could go, where it has one.\n503 `unavailable`: Mailset, or something it depends on, can’t answer now.\n500 `internal`: A fault on Mailset’s side.",
				"content": {
					"application/json": {
						"schema": {
							"type": "object",
							"properties": {
								"ok": {
									"type": "boolean",
									"const": false
								},
								"error": {
									"$ref": "#/components/schemas/Error"
								}
							},
							"required": [
								"ok",
								"error"
							]
						}
					}
				}
			}
		}
	}
}
