Use AI to convert a natural language description into an explicit guard rule configuration.
POST
/
api
/
e2
/
guard
/
generate
TypeScript
import Inbound from "inboundemail";
const inbound = new Inbound();
const result = await inbound.guard.generate({
prompt: "Flag messages asking for passwords or payment details."
});
curl -X POST 'https://inbound.new/api/e2/guard/generate' \
-H "Authorization: Bearer $INBOUND_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"prompt": "Flag messages asking for passwords or payment details."
}'
import Inbound from "inboundemail";
const inbound = new Inbound();
const result = await inbound.guard.generate({
prompt: "Flag messages asking for passwords or payment details."
});
curl -X POST 'https://inbound.new/api/e2/guard/generate' \
-H "Authorization: Bearer $INBOUND_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"prompt": "Flag messages asking for passwords or payment details."
}'
{"docsConfig":{"theme":"almond","$schema":"https://mintlify.com/docs.json","name":"inbound","colors":{"primary":"#8161FF","light":"#8161FF","dark":"#8161FF"},"logo":{"light":"https://mintcdn.com/inbound/9X4YbAqu-aoC72gx/logo/light.svg?fit=max\u0026auto=format\u0026n=9X4YbAqu-aoC72gx\u0026q=85\u0026s=e69d7ac2088d0df4183778cec514579b","dark":"https://mintcdn.com/inbound/9X4YbAqu-aoC72gx/logo/dark.svg?fit=max\u0026auto=format\u0026n=9X4YbAqu-aoC72gx\u0026q=85\u0026s=4ea108060d4b108db09c4372600b9a0a"},"favicon":"https://mintcdn.com/inbound/9X4YbAqu-aoC72gx/favicon.svg?fit=max\u0026auto=format\u0026n=9X4YbAqu-aoC72gx\u0026q=85\u0026s=14120b3a3cda1e2520075cbbf4671ead","appearance":{"default":"dark"},"background":{"color":{"light":"#FAFAF9"}},"navbar":{"links":[{"href":"https://inbound.new/logs","label":"Mail Flow"}],"primary":{"type":"button","label":"Get Started","href":"https://inbound.new"}},"footer":{"socials":{"github":"https://github.com/r44vc0rp/inbound"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"inbound","hasAudioNarration":false,"actualSubdomain":"inbound","customDomains":["inbound.new"],"gitSource":{"type":"github","owner":"inboundemail","repo":"inbound","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae67adac064cc679ece80b6","collectionId":"054936fd-a0aa-47d2-90ec-55fccec5c3ed","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae67adac064cc679ece80b6"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6ae67adac064cc679ece80b6","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"API Reference","count":89},{"language":"default","tag":"Mailboxes","count":42},{"language":"default","tag":"Documentation","count":15},{"language":"default","tag":"Mailboxes \u0026 SMTP","count":11},{"language":"default","tag":"Emails","count":9},{"language":"default","tag":"Guard","count":7},{"language":"default","tag":"Domains","count":6},{"language":"default","tag":"Endpoints","count":6},{"language":"default","tag":"Overview","count":5},{"language":"default","tag":"Email Addresses","count":5}]},"assistantConfig":{"deflection":{"enabled":true,"email":"support@inbound.new","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"api-reference/guard/generate-rule-from-natural-language","slug":"/api-reference/guard/generate-rule-from-natural-language","pageMetadata":{"title":"Generate rule from natural language","description":"Use AI to convert a natural language description into an explicit guard rule configuration.","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/guard/generate","href":"/api-reference/guard/generate-rule-from-natural-language","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Use AI to convert a natural language description into an explicit guard rule configuration.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Generate rule from natural language","description":"Use AI to convert a natural language description into an explicit guard rule configuration.","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/guard/generate","href":"/api-reference/guard/generate-rule-from-natural-language","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Guard"],"summary":"Generate rule from natural language","description":"Use AI to convert a natural language description into an explicit guard rule configuration.","requestBody":"57d8e63c-e8d9-4456-b301-7410d2e778ef","responses":{"200":"e5204fc8-8670-491a-b924-8ff043300652","400":"fc0cb899-56f8-4c1b-a813-a240dd67d5ed","401":"df6be23e-7551-40fd-af4d-43a053d156b4","500":"f73698a6-79dc-4627-959a-30b1c5aa1f94"},"operationId":"postApiE2GuardGenerate","x-codeSamples":[{"lang":"typescript","label":"TypeScript","source":"import Inbound from \"inboundemail\";\n\nconst inbound = new Inbound();\nconst result = await inbound.guard.generate({\n prompt: \"Flag messages asking for passwords or payment details.\"\n});"},{"lang":"curl","label":"cURL","source":"curl -X POST 'https://inbound.new/api/e2/guard/generate' \\\n -H \"Authorization: Bearer $INBOUND_API_KEY\" \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"prompt\": \"Flag messages asking for passwords or payment details.\"\n}'"}],"method":"post","type":"path","servers":["a6ff19d1-12ee-4cff-bb3c-f5e23b952134"],"security":["a21929c0-7ca0-4eed-85c4-490e145403c5"],"path":"/api/e2/guard/generate","baseUrlOptions":["https://inbound.new"],"title":"Generate rule from natural language","codeSamples":[{"label":"TypeScript","lang":"typescript","source":"import Inbound from \"inboundemail\";\n\nconst inbound = new Inbound();\nconst result = await inbound.guard.generate({\n prompt: \"Flag messages asking for passwords or payment details.\"\n});"},{"label":"cURL","lang":"curl","source":"curl -X POST 'https://inbound.new/api/e2/guard/generate' \\\n -H \"Authorization: Bearer $INBOUND_API_KEY\" \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"prompt\": \"Flag messages asking for passwords or payment details.\"\n}'"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"minLength":1,"description":"Natural language description of the rule","type":"string","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"}},"required":["prompt"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"prompt":"\u003cstring>"}}},"exampleType":"generated"},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"prompt":{"minLength":1,"description":"Natural language description of the rule","type":"string","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"}},"required":["prompt"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"prompt":"\u003cstring>"}}},"exampleType":"generated"},"multipart/form-data":{"schema":{"type":"object","properties":{"prompt":{"minLength":1,"description":"Natural language description of the rule","type":"string","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"}},"required":["prompt"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"prompt":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"e5204fc8-8670-491a-b924-8ff043300652":{"description":"Response for status 200","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["config"],"properties":{"config":{"type":"object","properties":{"mode":{"oneOf":[{"type":"string","const":"simple","uniqueKey":"oneOf.0.config.mode.oneOf.0","typeLabel":"string"},{"type":"string","const":"advanced","uniqueKey":"oneOf.0.config.mode.oneOf.1","typeLabel":"string"}],"uniqueKey":"oneOf.0.config.mode","typeLabel":"string"},"subject":{"type":"object","properties":{"operator":{"oneOf":[{"type":"string","const":"OR","isRequired":true,"uniqueKey":"oneOf.0.config.subject.operator.oneOf.0","typeLabel":"string"},{"type":"string","const":"AND","isRequired":true,"uniqueKey":"oneOf.0.config.subject.operator.oneOf.1","typeLabel":"string"}],"isRequired":true,"uniqueKey":"oneOf.0.config.subject.operator","typeLabel":"string"},"values":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.0.config.subject.values.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"oneOf.0.config.subject.values","typeLabel":"string[]"}},"required":["operator","values"],"uniqueKey":"oneOf.0.config.subject","typeLabel":"object"},"from":{"type":"object","properties":{"operator":{"oneOf":[{"type":"string","const":"OR","isRequired":true,"uniqueKey":"oneOf.0.config.from.operator.oneOf.0","typeLabel":"string"},{"type":"string","const":"AND","isRequired":true,"uniqueKey":"oneOf.0.config.from.operator.oneOf.1","typeLabel":"string"}],"isRequired":true,"uniqueKey":"oneOf.0.config.from.operator","typeLabel":"string"},"values":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.0.config.from.values.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"oneOf.0.config.from.values","typeLabel":"string[]"}},"required":["operator","values"],"uniqueKey":"oneOf.0.config.from","typeLabel":"object"},"to":{"type":"object","properties":{"operator":{"oneOf":[{"type":"string","const":"OR","isRequired":true,"uniqueKey":"oneOf.0.config.to.operator.oneOf.0","typeLabel":"string"},{"type":"string","const":"AND","isRequired":true,"uniqueKey":"oneOf.0.config.to.operator.oneOf.1","typeLabel":"string"}],"isRequired":true,"uniqueKey":"oneOf.0.config.to.operator","typeLabel":"string"},"values":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.0.config.to.values.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"oneOf.0.config.to.values","typeLabel":"string[]"}},"required":["operator","values"],"uniqueKey":"oneOf.0.config.to","typeLabel":"object"},"hasAttachment":{"type":"boolean","uniqueKey":"oneOf.0.config.hasAttachment","typeLabel":"boolean"},"hasWords":{"type":"object","properties":{"operator":{"oneOf":[{"type":"string","const":"OR","isRequired":true,"uniqueKey":"oneOf.0.config.hasWords.operator.oneOf.0","typeLabel":"string"},{"type":"string","const":"AND","isRequired":true,"uniqueKey":"oneOf.0.config.hasWords.operator.oneOf.1","typeLabel":"string"}],"isRequired":true,"uniqueKey":"oneOf.0.config.hasWords.operator","typeLabel":"string"},"values":{"type":"array","items":{"type":"string","uniqueKey":"oneOf.0.config.hasWords.values.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"oneOf.0.config.hasWords.values","typeLabel":"string[]"}},"required":["operator","values"],"uniqueKey":"oneOf.0.config.hasWords","typeLabel":"object"}},"isRequired":true,"uniqueKey":"oneOf.0.config","typeLabel":"object"}},"uniqueKey":"oneOf.0","typeLabel":"object"},{"type":"object","required":["config","error"],"properties":{"config":{"type":"object","properties":{},"isRequired":true,"uniqueKey":"oneOf.1.config","typeLabel":"object"},"error":{"type":"string","isRequired":true,"uniqueKey":"oneOf.1.error","typeLabel":"string"}},"uniqueKey":"oneOf.1","typeLabel":"object"}],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"config":{"mode":"simple","subject":{"operator":"OR","values":["\u003cstring>"]},"from":{"operator":"OR","values":["\u003cstring>"]},"to":{"operator":"OR","values":["\u003cstring>"]},"hasAttachment":true,"hasWords":{"operator":"OR","values":["\u003cstring>"]}}}}},"exampleType":"generated"}},"exampleType":"generated"},"fc0cb899-56f8-4c1b-a813-a240dd67d5ed":{"description":"Response for status 400","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"df6be23e-7551-40fd-af4d-43a053d156b4":{"description":"Response for status 401","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"f73698a6-79dc-4627-959a-30b1c5aa1f94":{"description":"Response for status 500","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"a21929c0-7ca0-4eed-85c4-490e145403c5":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Your Inbound API key. Include it in the Authorization header as: Bearer \u003cyour-api-key>","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"a6ff19d1-12ee-4cff-bb3c-f5e23b952134":{"url":"https://inbound.new","description":"Production API server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Your Inbound API key. Include it in the Authorization header as: Bearer \u003cyour-api-key>","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Your Inbound API key. Include it in the Authorization header as: Bearer \u003cyour-api-key>","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"https://inbound.new/openapi.json"},"subdomain":"inbound","siteName":"inbound","title":"Generate rule from natural language - inbound","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-31T23:33:51.719Z","originalFileLocation":"api-reference/guard/generate-rule-from-natural-language.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use AI to convert a natural language description into an explicit guard rule configuration.\">\u003cmeta data-mint-head name=\"application-name\" content=\"inbound\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/inbound/jpl8ag4HwpFFGPF8/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/inbound/jpl8ag4HwpFFGPF8/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/inbound/jpl8ag4HwpFFGPF8/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/inbound/jpl8ag4HwpFFGPF8/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/inbound/jpl8ag4HwpFFGPF8/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/inbound/jpl8ag4HwpFFGPF8/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/inbound/jpl8ag4HwpFFGPF8/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/inbound/jpl8ag4HwpFFGPF8/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/inbound/jpl8ag4HwpFFGPF8/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Generate rule from natural language - inbound\">\u003cmeta data-mint-head property=\"og:description\" content=\"Use AI to convert a natural language description into an explicit guard rule configuration.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"inbound\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://inbound.new/docs/api-reference/guard/generate-rule-from-natural-language\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://inbound.mintlify.site/docs/_mintlify/api/og/v2?division=Guard\u0026amp;title=Generate+rule+from+natural+language\u0026amp;description=Use+AI+to+convert+a+natural+language+description+into+an+explicit+guard+rule+configuration.\u0026amp;theme=15f7b51bd66015d661d671dc\u0026amp;signature=b7215dd653a2f0a6db483c79531811d3b903d55c09f7d6c2d6b81319e6bd2866\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Generate rule from natural language - inbound\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Use AI to convert a natural language description into an explicit guard rule configuration.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://inbound.mintlify.site/docs/_mintlify/api/og/v2?division=Guard\u0026amp;title=Generate+rule+from+natural+language\u0026amp;description=Use+AI+to+convert+a+natural+language+description+into+an+explicit+guard+rule+configuration.\u0026amp;theme=15f7b51bd66015d661d671dc\u0026amp;signature=b7215dd653a2f0a6db483c79531811d3b903d55c09f7d6c2d6b81319e6bd2866\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/inbound/jpl8ag4HwpFFGPF8/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"inbound\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#8161FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://inbound.new/docs/api-reference/guard/generate-rule-from-natural-language\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api-reference/guard/generate-rule-from-natural-language.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://inbound.new/#organization\",\"name\":\"inbound\",\"url\":\"https://inbound.new\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/inbound/9X4YbAqu-aoC72gx/logo/light.svg?fit=max\u0026auto=format\u0026n=9X4YbAqu-aoC72gx\u0026q=85\u0026s=e69d7ac2088d0df4183778cec514579b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://inbound.new/docs#website\",\"name\":\"inbound\",\"url\":\"https://inbound.new/docs\",\"publisher\":{\"@id\":\"https://inbound.new/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://inbound.new/docs/api-reference/guard/generate-rule-from-natural-language#webpage\",\"url\":\"https://inbound.new/docs/api-reference/guard/generate-rule-from-natural-language\",\"name\":\"Generate rule from natural language\",\"description\":\"Use AI to convert a natural language description into an explicit guard rule configuration.\",\"dateModified\":\"2026-10-31T23:33:51.719Z\",\"isPartOf\":{\"@id\":\"https://inbound.new/docs#website\"},\"breadcrumb\":{\"@id\":\"https://inbound.new/docs/api-reference/guard/generate-rule-from-natural-language#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://inbound.new/docs/api-reference/guard/generate-rule-from-natural-language#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guard\",\"item\":\"https://inbound.new/docs/api-reference/guard/list-guard-rules\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generate rule from natural language\",\"item\":\"https://inbound.new/docs/api-reference/guard/generate-rule-from-natural-language\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://inbound.new/docs/api-reference/guard/generate-rule-from-natural-language#apireference\",\"headline\":\"Generate rule from natural language\",\"name\":\"Generate rule from natural language\",\"description\":\"Use AI to convert a natural language description into an explicit guard rule configuration.\",\"url\":\"https://inbound.new/docs/api-reference/guard/generate-rule-from-natural-language\",\"mainEntityOfPage\":{\"@id\":\"https://inbound.new/docs/api-reference/guard/generate-rule-from-natural-language#webpage\"},\"dateModified\":\"2026-10-31T23:33:51.719Z\",\"publisher\":{\"@id\":\"https://inbound.new/#organization\"},\"isPartOf\":{\"@id\":\"https://inbound.new/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"inbound\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"inbound","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/quickstart/introduction"}]},{"anchor":"API Reference","icon":"square-terminal","groups":[{"group":"Overview","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"Rate Limits","href":"/api-reference/rate-limits"},{"title":"Webhook Structure","href":"/api-reference/webhook"},{"title":"Security","href":"/api-reference/security"},{"title":"Error Codes","href":"/api-reference/errors"}]},{"group":"Domains","pages":[{"title":"List all domains","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/domains","href":"/api-reference/domains/list-all-domains"},{"title":"Create new domain","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/domains","href":"/api-reference/domains/create-new-domain"},{"title":"Get domain by ID","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/domains/{id}","href":"/api-reference/domains/get-domain-by-id"},{"title":"Delete domain","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json delete /api/e2/domains/{id}","href":"/api-reference/domains/delete-domain"},{"title":"Update domain catch-all and subdomain settings","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json patch /api/e2/domains/{id}","href":"/api-reference/domains/update-domain-catch-all-and-subdomain-settings"},{"title":"Enable DKIM","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/domains/{id}/dkim","href":"/api-reference/domains/enable-dkim"}]},{"group":"Endpoints","pages":[{"title":"List all endpoints","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/endpoints","href":"/api-reference/endpoints/list-all-endpoints"},{"title":"Create new endpoint","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/endpoints","href":"/api-reference/endpoints/create-new-endpoint"},{"title":"Get endpoint details","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/endpoints/{id}","href":"/api-reference/endpoints/get-endpoint-details"},{"title":"Update endpoint","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json put /api/e2/endpoints/{id}","href":"/api-reference/endpoints/update-endpoint"},{"title":"Delete endpoint","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json delete /api/e2/endpoints/{id}","href":"/api-reference/endpoints/delete-endpoint"},{"title":"Test endpoint","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/endpoints/{id}/test","href":"/api-reference/endpoints/test-endpoint"}]},{"group":"Email Addresses","pages":[{"title":"List all email addresses","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/email-addresses","href":"/api-reference/email-addresses/list-all-email-addresses"},{"title":"Create email address","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/email-addresses","href":"/api-reference/email-addresses/create-email-address"},{"title":"Get email address","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/email-addresses/{id}","href":"/api-reference/email-addresses/get-email-address"},{"title":"Update email address","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json put /api/e2/email-addresses/{id}","href":"/api-reference/email-addresses/update-email-address"},{"title":"Delete email address","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json delete /api/e2/email-addresses/{id}","href":"/api-reference/email-addresses/delete-email-address"}]},{"group":"Attachments","pages":[{"title":"List email attachments","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/attachments/{id}","href":"/api-reference/attachments/list-email-attachments"},{"title":"Download attachment by position","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/attachments/{id}/parts/{index}","href":"/api-reference/attachments/download-attachment-by-position"},{"title":"Download email attachment","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/attachments/{id}/{filename}","href":"/api-reference/attachments/download-email-attachment"}]},{"group":"Authentication","pages":[{"title":"Revoke the current API key","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/auth/revoke-key","href":"/api-reference/authentication/revoke-the-current-api-key"}]},{"group":"Emails","pages":[{"title":"List all emails","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/emails","href":"/api-reference/emails/list-all-emails"},{"title":"Send an email","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/emails","href":"/api-reference/emails/send-an-email"},{"title":"Get email by ID","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/emails/{id}","href":"/api-reference/emails/get-email-by-id"},{"title":"Cancel scheduled email","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json delete /api/e2/emails/{id}","href":"/api-reference/emails/cancel-scheduled-email"},{"title":"Update email","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json patch /api/e2/emails/{id}","href":"/api-reference/emails/update-email"},{"title":"Pause scheduled email","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/emails/{id}/pause","href":"/api-reference/emails/pause-scheduled-email"},{"title":"Resume paused scheduled email","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/emails/{id}/resume","href":"/api-reference/emails/resume-paused-scheduled-email"},{"title":"Reply to an email","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/emails/{id}/reply","href":"/api-reference/emails/reply-to-an-email"},{"title":"Retry email delivery","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/emails/{id}/retry","href":"/api-reference/emails/retry-email-delivery"}]},{"group":"Inbox","pages":[{"title":"List inbox threads","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mail/threads","href":"/api-reference/inbox/list-inbox-threads"},{"title":"Get thread by ID","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mail/threads/{id}","href":"/api-reference/inbox/get-thread-by-id"}]},{"group":"Mailboxes","pages":[{"title":"List managed mailboxes","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes","href":"/api-reference/mailboxes/list-managed-mailboxes"},{"title":"Create a managed mailbox","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes","href":"/api-reference/mailboxes/create-a-managed-mailbox"},{"title":"List activity for all mailboxes","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/activity","href":"/api-reference/mailboxes/list-activity-for-all-mailboxes"},{"title":"List mailbox activity","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/activity","href":"/api-reference/mailboxes/list-mailbox-activity"},{"title":"Get a mailbox","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}","href":"/api-reference/mailboxes/get-a-mailbox"},{"title":"Update a managed mailbox","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json put /api/e2/mailboxes/{id}","href":"/api-reference/mailboxes/update-a-managed-mailbox"},{"title":"Delete a managed mailbox","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json delete /api/e2/mailboxes/{id}","href":"/api-reference/mailboxes/delete-a-managed-mailbox"},{"title":"Rotate a mailbox password","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes/{id}/rotate-password","href":"/api-reference/mailboxes/rotate-a-mailbox-password"},{"title":"List mailbox messages","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/messages","href":"/api-reference/mailboxes/list-mailbox-messages"},{"title":"Get a mailbox message","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/messages/{messageId}","href":"/api-reference/mailboxes/get-a-mailbox-message"},{"title":"Mark a mailbox message read, archived or junk","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json patch /api/e2/mailboxes/{id}/messages/{messageId}","href":"/api-reference/mailboxes/mark-a-mailbox-message-read-archived-or-junk"},{"title":"Get a mailbox thread","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/threads/{threadId}","href":"/api-reference/mailboxes/get-a-mailbox-thread"},{"title":"Download a mailbox attachment","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/messages/{messageId}/attachments/{index}","href":"/api-reference/mailboxes/download-a-mailbox-attachment"},{"title":"List mailbox folders","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/folders","href":"/api-reference/mailboxes/list-mailbox-folders"},{"title":"Create a mailbox folder","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes/{id}/folders","href":"/api-reference/mailboxes/create-a-mailbox-folder"},{"title":"Delete a mailbox folder","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json delete /api/e2/mailboxes/{id}/folders/{folder}","href":"/api-reference/mailboxes/delete-a-mailbox-folder"},{"title":"Rename or subscribe a mailbox folder","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json patch /api/e2/mailboxes/{id}/folders/{folder}","href":"/api-reference/mailboxes/rename-or-subscribe-a-mailbox-folder"},{"title":"Expunge a mailbox folder","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes/{id}/folders/{folder}/expunge","href":"/api-reference/mailboxes/expunge-a-mailbox-folder"},{"title":"List folder messages","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/folders/{folder}/messages","href":"/api-reference/mailboxes/list-folder-messages"},{"title":"Add a message to a folder","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes/{id}/folders/{folder}/messages","href":"/api-reference/mailboxes/add-a-message-to-a-folder"},{"title":"Get a folder message","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/folders/{folder}/messages/{uid}","href":"/api-reference/mailboxes/get-a-folder-message"},{"title":"Delete a folder message","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json delete /api/e2/mailboxes/{id}/folders/{folder}/messages/{uid}","href":"/api-reference/mailboxes/delete-a-folder-message"},{"title":"Update a folder message's flags","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json patch /api/e2/mailboxes/{id}/folders/{folder}/messages/{uid}","href":"/api-reference/mailboxes/update-a-folder-messages-flags"},{"title":"Download a folder message's raw source","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/folders/{folder}/messages/{uid}/raw","href":"/api-reference/mailboxes/download-a-folder-messages-raw-source"},{"title":"Move a folder message","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes/{id}/folders/{folder}/messages/{uid}/move","href":"/api-reference/mailboxes/move-a-folder-message"},{"title":"Copy a folder message","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes/{id}/folders/{folder}/messages/{uid}/copy","href":"/api-reference/mailboxes/copy-a-folder-message"},{"title":"List a folder message's attachments","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/folders/{folder}/messages/{uid}/attachments","href":"/api-reference/mailboxes/list-a-folder-messages-attachments"},{"title":"Download a folder message's attachment","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/folders/{folder}/messages/{uid}/attachments/{index}","href":"/api-reference/mailboxes/download-a-folder-messages-attachment"},{"title":"List mailbox filters","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/filters","href":"/api-reference/mailboxes/list-mailbox-filters"},{"title":"Create a mailbox filter","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes/{id}/filters","href":"/api-reference/mailboxes/create-a-mailbox-filter"},{"title":"Reorder mailbox filters","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes/{id}/filters/reorder","href":"/api-reference/mailboxes/reorder-mailbox-filters"},{"title":"Run mailbox filters on a folder","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes/{id}/filters/apply","href":"/api-reference/mailboxes/run-mailbox-filters-on-a-folder"},{"title":"Get a mailbox filter","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/filters/{filterId}","href":"/api-reference/mailboxes/get-a-mailbox-filter"},{"title":"Delete a mailbox filter","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json delete /api/e2/mailboxes/{id}/filters/{filterId}","href":"/api-reference/mailboxes/delete-a-mailbox-filter"},{"title":"Update a mailbox filter","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json patch /api/e2/mailboxes/{id}/filters/{filterId}","href":"/api-reference/mailboxes/update-a-mailbox-filter"},{"title":"Run one mailbox filter on a folder","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes/{id}/filters/{filterId}/apply","href":"/api-reference/mailboxes/run-one-mailbox-filter-on-a-folder"},{"title":"Get mailbox spam settings","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/mailboxes/{id}/spam","href":"/api-reference/mailboxes/get-mailbox-spam-settings"},{"title":"Replace mailbox spam settings","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json put /api/e2/mailboxes/{id}/spam","href":"/api-reference/mailboxes/replace-mailbox-spam-settings"},{"title":"Add a sender to the mailbox spam allow list","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes/{id}/spam/allow","href":"/api-reference/mailboxes/add-a-sender-to-the-mailbox-spam-allow-list"},{"title":"Remove a sender from the mailbox spam allow list","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json delete /api/e2/mailboxes/{id}/spam/allow","href":"/api-reference/mailboxes/remove-a-sender-from-the-mailbox-spam-allow-list"},{"title":"Add a sender to the mailbox spam block list","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/mailboxes/{id}/spam/block","href":"/api-reference/mailboxes/add-a-sender-to-the-mailbox-spam-block-list"},{"title":"Remove a sender from the mailbox spam block list","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json delete /api/e2/mailboxes/{id}/spam/block","href":"/api-reference/mailboxes/remove-a-sender-from-the-mailbox-spam-block-list"}]},{"group":"Spam Filter","pages":[{"title":"Get spam filter settings","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/spam-filter","href":"/api-reference/spam-filter/get-spam-filter-settings"},{"title":"Update spam filter settings","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json put /api/e2/spam-filter","href":"/api-reference/spam-filter/update-spam-filter-settings"}]},{"group":"Guard","pages":[{"title":"List guard rules","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/guard","href":"/api-reference/guard/list-guard-rules"},{"title":"Create guard rule","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/guard","href":"/api-reference/guard/create-guard-rule"},{"title":"Get guard rule","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json get /api/e2/guard/{id}","href":"/api-reference/guard/get-guard-rule"},{"title":"Update guard rule","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json put /api/e2/guard/{id}","href":"/api-reference/guard/update-guard-rule"},{"title":"Delete guard rule","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json delete /api/e2/guard/{id}","href":"/api-reference/guard/delete-guard-rule"},{"title":"Check if rule matches email","description":"Test a guard rule against a specific email to see if it would match.","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/guard/{id}/check","href":"/api-reference/guard/check-if-rule-matches-email"},{"title":"Generate rule from natural language","deprecated":null,"version":null,"openapi":"https://inbound.new/openapi.json post /api/e2/guard/generate","href":"/api-reference/guard/generate-rule-from-natural-language"}]},{"group":"Webhooks","pages":[{"title":"Email received","description":"\nWhen emails arrive at your configured addresses, Inbound sends a webhook to your endpoint with the complete email data.\n\n## Webhook Payload Structure\n\nWe provide a fully typed webhook payload for you to use in your endpoints:\n\n```typescript\nimport type { InboundWebhookPayload } from 'inboundemail'\n```\n\n### Example Payload\n\n```typescript\nconst payload: InboundWebhookPayload = {\n event: 'email.received',\n timestamp: '2024-01-15T10:30:00Z',\n email: {\n id: 'inbnd_abc123def456ghi',\n messageId: '\u003cunique-id@sender.com>',\n from: {\n text: 'John Doe \u003cjohn@sender.com>',\n addresses: [{\n name: 'John Doe',\n address: 'john@sender.com'\n }]\n },\n to: {\n text: 'support@yourdomain.com',\n addresses: [{\n name: null,\n address: 'support@yourdomain.com'\n }]\n },\n recipient: 'support@yourdomain.com',\n subject: 'Help with my order',\n receivedAt: '2024-01-15T10:30:00Z',\n parsedData: {\n messageId: '\u003cunique-id@sender.com>',\n date: new Date('2024-01-15T10:30:00Z'),\n subject: 'Help with my order',\n from: { /* ... */ },\n to: { /* ... */ },\n cc: null,\n bcc: null,\n replyTo: null,\n textBody: 'Hello, I need help with my recent order...',\n htmlBody: '\u003cp>Hello, I need help with my recent order...\u003c/p>',\n attachments: [\n {\n filename: 'order-receipt.pdf',\n contentType: 'application/pdf',\n size: 45678,\n contentId: '\u003catt_abc123>',\n contentDisposition: 'attachment',\n downloadUrl: 'https://inbound.new/api/e2/attachments/inbnd_abc123/parts/0'\n }\n ]\n }\n },\n endpoint: {\n id: 'endp_xyz789',\n name: 'Support Webhook',\n type: 'webhook'\n }\n}\n```\n\n## Webhook Security\n\nAlways verify webhook requests before processing them to prevent unauthorized access.\n\n### Verification Headers\n\nEvery webhook request includes security headers:\n\n| Header | Description |\n|--------|-------------|\n| `X-Webhook-Verification-Token` | Unique verification token for your endpoint |\n| `X-Endpoint-ID` | ID of the endpoint that triggered this webhook |\n| `X-Webhook-Event` | Event type (e.g., `email.received`) |\n| `X-Webhook-Timestamp` | ISO 8601 timestamp of when the webhook was sent |\n\n### Verifying with the SDK\n\n```typescript\nimport { Inbound, verifyWebhookFromHeaders } from 'inboundemail'\n\nconst inbound = new Inbound(process.env.INBOUND_API_KEY!)\n\nexport async function POST(request: Request) {\n // Verify webhook authenticity before processing\n const isValid = await verifyWebhookFromHeaders(request.headers, inbound)\n \n if (!isValid) {\n return new Response('Unauthorized', { status: 401 })\n }\n \n // Process the verified webhook payload\n const payload: InboundWebhookPayload = await request.json()\n const { email } = payload\n \n console.log('Received verified email:', email.subject)\n \n return new Response('OK', { status: 200 })\n}\n```\n\n## Downloading Attachments\n\nEach attachment includes a `downloadUrl` for direct file access:\n\n```typescript\n// Download attachments from webhook payload\nfor (const attachment of email.parsedData.attachments) {\n const response = await fetch(attachment.downloadUrl, {\n headers: {\n 'Authorization': `Bearer ${process.env.INBOUND_API_KEY}`\n }\n })\n \n if (response.ok) {\n const fileBuffer = await response.arrayBuffer()\n // Process the file...\n }\n}\n```\n\n> **Note:** Authentication via API key in the Authorization header is required to download attachments.\n","version":null,"deprecated":null,"openapi":"https://inbound.new/openapi.json webhook emailReceived","href":"/api-reference/webhooks/email-received"}]}]}]},"basePath":"","title":"Generate rule from natural language - inbound","buildId":"dpl_ATnXPMW25DMPUr9VBw6kL6MfBt6T","deploymentId":"dpl_ATnXPMW25DMPUr9VBw6kL6MfBt6T","dynamics":["c2aa737661","b0f84f53ff","a9bb46feb3","2b790eda92"],"chunks":["OpenApiReferenceProvider-CNqlzjVB.js","utils-BqFiXZ79.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-CnR4QBe6.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-BY2ZM1OO.js","snippetPresets-x-8ACO8V.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","Page-CTxrMSpo.js","ApiExamples-Ch-SJE05.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CqqG_0NE.js","shallow-BXrZ2b0C.js","getApiPlaygroundDisplay-n7J_wkjq.js","CodeSnippet-CQsp4vyQ.js","CodeSnippets-BfuHqvZx.js","getPastedJson-BjrGIK1i.js","icon-7iLZnVOC.js","MethodPill-TBS1m84e.js","DuplicateIcon-BNMrV4Vs.js","createIcon-C5kCqeU2.js","DynamicMarkdown-Bq09mRwR.js","SectionHeading-G4Bflf5Q.js","axios-vUo_bRtp.js","Markdown-BTUds0aX.js","clsx-6wHzaN2_.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BPypQKlo.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-o6bee4ro.js"]}