Create, list, update, and delete scoped AhaSend API keys from the command line, including domain-restricted keys such as messages:send:.
AhaSend CLI apikeys commands let you create, inspect, update and revoke API keys; this page covers their arguments and flags.Before running the examples, log in with an API key that has the api-keys:read, api-keys:write and api-keys:deletescopes. Replace YOUR_RESOURCE_ID with the ID of an API key, and example.com in the scopes with a domain in your account. The delete example needs jq.
update - Update an API key’s label, scopes or IP allow list
delete - Delete an API key
API keys are used to authenticate requests to the AhaSend API. You can create multiple API keys with different scopes and labels to organize access for different applications or team members.Each API key has:
A unique identifier and secret
Scopes (permissions) that define what the key can do; see Scopes
A label that names it, required when you create it
An optional IP allow list that limits where the key can be used; see IP Allow Lists
# List API keysahasend apikeys list# Fetch 10 keys, then the page after themahasend apikeys list --limit 10ahasend apikeys list --limit 10 --after YOUR_CURSOR
Table output shows each key’s label, ID, public key, scopes and last use. Plain and CSV output add the IP allow list and the creation and update times. Secrets are never shown. Pages work as Lists and Pagination describes; replace YOUR_CURSOR with the cursor of the previous page.
The output shows the key’s secret once. Save it at once: it cannot be retrieved later. A retry with the same --idempotency-key within 5 minutes returns the same response, secret included. After that, create a new key if you lose the secret.--label holds up to 255 characters.
Give each scope with its own --scope, or separate scopes with commas. Scope names are case-sensitive; the domain of a scope is compared ignoring case. The CLI checks every scope before it sends the request: a scope the API does not accept, or a scope given twice, fails with exit code 4. Follow the principle of least privilege, and grant only the scopes the key needs.A scope that ends in {domain} takes one of your domains in its place, such as messages:send:{example.com}. The domain must exist in your account. Quote such a scope, as the examples do, so your shell passes the braces unchanged.
--ip-allow-list limits the source IPs that can authenticate with the key. Each entry is a CIDR block, such as 203.0.113.0/24, or a bare IPv4 or IPv6 address, such as 2001:db8::1. Repeat the flag, or separate entries with commas. Without it, the key works from any IP, which table and plain output show as any.The CLI checks the list before it sends the request. These fail with exit code 4:
An empty value
An entry that is not an IP address or CIDR block
A block that allows every IP, such as 0.0.0.0/0 or ::/0; leave the list empty instead
More than 100 distinct entries, the API’s limit
A request with the key from an IP outside the list fails with HTTP 403 (exit code 6). See IP allow lists for how the API applies the list.
update changes only the flags you give, and needs at least one. Do not replace the scopes of the key the CLI is logged in with unless the new scopes keep the api-keys scopes you need: otherwise that key can no longer change itself back. --scope replaces all of the key’s scopes: to add a scope, give every existing scope plus the new one. --ip-allow-list replaces the whole list, and --clear-ip-allow-list removes it so the key works from any IP. The secret cannot be changed; create a new key and delete the old one instead.
# Update the labelahasend apikeys update YOUR_RESOURCE_ID --label "Updated Label"# Replace the scopesahasend apikeys update YOUR_RESOURCE_ID \ --scope "messages:send:{example.com}" \ --scope "messages:read:{example.com}"# Replace the IP allow listahasend apikeys update YOUR_RESOURCE_ID --ip-allow-list 203.0.113.0/24# Remove the IP allow list so the key works from any IPahasend apikeys update YOUR_RESOURCE_ID --clear-ip-allow-list
--ip-allow-list and --clear-ip-allow-list cannot be used together.The API refuses to give the key you are calling with an IP allow list that leaves out your current IP, so you cannot lock yourself out. The update fails with HTTP 409, exit code 1.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"AhaSend","description":"AhaSend is a European transactional email service for developers: send through a REST API, SMTP relay, CLI or the official Node.js and Go SDKs, with data stored in the EU and 1,000 free emails per month.","colors":{"primary":"#066fd1","light":"#F8FAFC","dark":"#0F172A"},"logo":{"light":"https://mintcdn.com/ahasend/F35Ozd-1GsftDpcH/logo.png?fit=max\u0026auto=format\u0026n=F35Ozd-1GsftDpcH\u0026q=85\u0026s=ca1d4c27f7c2811598e65cb25a21323c","dark":"https://mintcdn.com/ahasend/F35Ozd-1GsftDpcH/logo-dark.png?fit=max\u0026auto=format\u0026n=F35Ozd-1GsftDpcH\u0026q=85\u0026s=bb6b9068b30f93fd1ea216e2a7c1d137","href":"https://ahasend.com/"},"favicon":"https://mintcdn.com/ahasend/F35Ozd-1GsftDpcH/favicon.png?fit=max\u0026auto=format\u0026n=F35Ozd-1GsftDpcH\u0026q=85\u0026s=ac855c16b6cb74b8c5965d2e7ef3e324","appearance":{"strict":false},"navbar":{"links":[{"href":"https://dash.ahasend.com","label":"Login"}],"primary":{"type":"button","label":"Get Started","href":"https://dash.ahasend.com/user/register"}},"footer":{"socials":{"x":"https://x.com/aha_send","linkedin":"https://www.linkedin.com/company/ahasend","github":"https://github.com/ahasend"},"links":[{"header":"Resources","items":[{"label":"Pricing","href":"https://ahasend.com/pricing"},{"label":"Support","href":"mailto:support@ahasend.com"},{"label":"Status","href":"https://status.ahasend.com"},{"label":"Security","href":"https://ahasend.com/security"}]},{"header":"Company","items":[{"label":"Blog","href":"https://ahasend.com/blog"},{"label":"Feedback Board","href":"https://ahasend.sleekplan.app/"}]},{"header":"Legal","items":[{"label":"Imprint","href":"https://ahasend.com/imprint"},{"label":"Terms of Service","href":"https://ahasend.com/terms"},{"label":"Privacy Policy","href":"https://ahasend.com/privacy"},{"label":"Data Processing Agreement","href":"https://ahasend.com/dpa"}]}]},"seo":{"metatags":{"canonical":"https://ahasend.com/docs","twitter:site":"@aha_send"},"organization":{"name":"AhaSend","legalName":"AhaSend B.V.","url":"https://ahasend.com","sameAs":["https://x.com/aha_send","https://www.linkedin.com/company/ahasend","https://github.com/ahasend"]}},"integrations":{"telemetry":{"enabled":true},"cookies":{"key":"cookieConsent","value":"true"}},"errors":{"404":{"redirect":true}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"thumbnails":{"appearance":"dark","background":"https://mintcdn.com/ahasend/Gpf8BnLpzpIKQ4dU/images/social-background.svg?fit=max\u0026auto=format\u0026n=Gpf8BnLpzpIKQ4dU\u0026q=85\u0026s=df32e1edef517352b8437c75feecbf6e"},"markdown":{"instructions":["AhaSend stores all message data in the EU. See /facts.","The API base URL is https://api.ahasend.com. Send the API key in the Authorization: Bearer header. See /api-reference/authentication.","Use send.ahasend.com for SMTP. Ports 25, 587 and 2525 use STARTTLS. Port 465 is not supported. See /smtp.","For send-only integrations, create an API Key v2 under Credentials → Add and scope it to messages:send:{your-domain}. See /send-api/credentials and /api-reference/scopes."]},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"ahasend","hasAudioNarration":false,"actualSubdomain":"ahasend","customDomains":["ahasend.com"],"gitSource":{"type":"github","owner":"ahasend","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adfc073cd3471cd953b0201","collectionId":"4784fba2-4354-479f-8cd1-66684a92aba7","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adfc073cd3471cd953b0201"},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6adfc319e83fbbb268c93e4e","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"default","tag":"API Reference","count":148},{"language":"default","tag":"API reference","count":114},{"language":"default","tag":"Documentation","count":68},{"language":"default","tag":"Guides","count":52},{"language":"default","tag":"Integrations","count":41},{"language":"default","tag":"Webhooks","count":29},{"language":"default","tag":"CLI","count":25},{"language":"default","tag":"Commands","count":15},{"language":"default","tag":"Domain Authentication","count":13},{"language":"default","tag":"Campaigns","count":12}]},"assistantConfig":{},"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":"editor-v7-file-tree","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":"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":"pause-universal-search-reconcile","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":"per-site-search-delta","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":"editor-private-page-search","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":"editor-nav-generations","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":"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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":false}},"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#content-container table{display:table}#content-container table thead th{text-align:left}"},{"filePath":"roadmap.css","content":".rm{display:flex;flex-direction:column;gap:2.5rem;margin-top:1.5rem}.rm-head{display:flex;align-items:center;gap:.65rem;margin-bottom:1rem}.rm-badge{display:inline-flex;align-items:center;margin:0;border:0;font-size:.78rem;font-weight:600;letter-spacing:.02em;padding:.28rem .75rem;border-radius:999px;line-height:1}.rm-badge.is-active{background:#fdebd0;color:#854f0b}.rm-badge.is-planned{background:#e6f1fb;color:#0c447c}.rm-badge.is-shipped{background:#e1f5ee;color:#0f6e56}.rm-list{display:flex;flex-direction:column;gap:.65rem}.rm-card{display:flex;gap:.9rem;padding:.9rem 1.05rem;background:#fff;border:1px solid #e5e7eb;border-radius:.7rem;transition:transform .15s ease,box-shadow .15s ease}.rm-card:hover{transform:translateY(-1px);box-shadow:0 4px 14px rgba(0,0,0,.06)}.rm-accent{flex:0 0 3px;border-radius:2px}.rm-card.is-active .rm-accent{background:#ba7517}.rm-card.is-planned .rm-accent{background:#378add}.rm-card.is-shipped .rm-accent{background:#1d9e75}.rm-card.is-sub{margin-left:2rem;position:relative}.rm-card p,.rm-card.is-sub .rm-title{font-size:.9rem}.rm-card.is-sub::after,.rm-card.is-sub::before{content:\"\";position:absolute;left:-1.15rem;pointer-events:none}.rm-card.is-sub::before{top:-.65rem;height:calc(100% + .65rem);border-left:1.5px solid #d1d5db}.rm-card.is-sub::after{top:50%;width:.85rem;border-top:1.5px solid #d1d5db}.rm-card .rm-title{margin:0 0 .2rem;font-size:.97rem;font-weight:600;line-height:1.35;color:#111827}.rm-card p{margin:0;line-height:1.55;color:#4b5563}.rm-date,.rm-tag{display:inline-block}.rm-date{margin-top:.5rem;font-size:.78rem;font-weight:600;color:#0f6e56}.rm-tag{margin-left:.5rem;font-size:.66rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;padding:.16rem .5rem;border-radius:999px;vertical-align:middle;line-height:1.4;color:#fff;box-shadow:0 1px 2px rgba(0,0,0,.15)}.rm-tag.is-new{background:#6d28d9}.rm-tag.is-product{background:#be123c}.rm-tag.is-improvement{background:#0e7490}.rm-tag.is-early{background:#1d4ed8}.rm-tag.is-bugfix{background:#c2410c}.dark .rm-card{background:rgba(255,255,255,.025);border-color:rgba(255,255,255,.09)}.dark .rm-card p{color:#9ca3af}.dark .rm-badge.is-active{background:rgba(186,117,23,.18);color:#fac074}.dark .rm-badge.is-planned{background:rgba(55,138,221,.18);color:#85b7eb}.dark .rm-badge.is-shipped{background:rgba(29,158,117,.18);color:#5dcaa5}.dark .rm-date{color:#5dcaa5}.dark .rm-card.is-sub::after,.dark .rm-card.is-sub::before{border-color:rgba(255,255,255,.18)}.rm-note{margin-top:2.5rem;font-size:.85rem;color:#6b7280}.dark .rm-note{color:#9ca3af}.dark .rm-card .rm-title{color:#e7e9ee}.rm-jump{margin:-.5rem 0 0;font-size:.88rem}.rm-jump a{color:#2296ff;text-decoration:none;font-weight:500}.rm-jump a:hover{text-decoration:underline}.rm-badge[id]{scroll-margin-top:6rem}"}],"page":{"pagePath":"cli/commands/apikeys","slug":"/cli/commands/apikeys","pageMetadata":{"title":"ahasend apikeys: Manage API Keys","description":"Create, list, update, and delete scoped AhaSend API keys from the command line, including domain-restricted keys such as messages:send:{example.com}.","icon":"key","sidebarTitle":"apikeys","href":"/cli/commands/apikeys"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"Create, list, update, and delete scoped AhaSend API keys from the command line, including domain-restricted keys such as messages:send:\", \".\"]\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,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`AhaSend CLI `,_jsx(_components.code,{children:`apikeys`}),` commands let you create, inspect, update and revoke API keys; this page covers their arguments and flags.`]}),`\n`,_jsxs(_components.p,{children:[`Before running the examples, `,_jsx(_components.a,{href:`/cli/authentication`,children:`log in`}),` with an API key that has the `,_jsx(_components.code,{children:`api-keys:read`}),`, `,_jsx(_components.code,{children:`api-keys:write`}),` and `,_jsx(_components.code,{children:`api-keys:delete`}),` `,_jsx(_components.a,{href:`/api-reference/scopes#api-key-management`,children:`scopes`}),`. Replace `,_jsx(_components.code,{children:`YOUR_RESOURCE_ID`}),` with the ID of an API key, and `,_jsx(_components.code,{children:`example.com`}),` in the scopes with a domain in your account. The delete example needs `,_jsx(_components.a,{href:`https://jqlang.org`,children:`jq`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`ahasend apikeys [subcommand] [flags]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(_components.p,{children:`Available subcommands:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`list`}),` - List API keys`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`create`}),` - Create an API key`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`get`}),` - Get details of an API key`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`update`}),` - Update an API key’s label, scopes or IP allow list`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`delete`}),` - Delete an API key`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`API keys are used to authenticate requests to the AhaSend API. You can create multiple API keys with different scopes and labels to organize access for different applications or team members.`}),`\n`,_jsx(_components.p,{children:`Each API key has:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`A unique identifier and secret`}),`\n`,_jsxs(_components.li,{children:[`Scopes (permissions) that define what the key can do; see `,_jsx(_components.a,{href:`#scopes`,children:`Scopes`})]}),`\n`,_jsx(_components.li,{children:`A label that names it, required when you create it`}),`\n`,_jsxs(_components.li,{children:[`An optional IP allow list that limits where the key can be used; see `,_jsx(_components.a,{href:`#ip-allow-lists`,children:`IP Allow Lists`})]}),`\n`,_jsx(_components.li,{children:`Creation and last used timestamps`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`list-api-keys`,children:`List API Keys`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# List API keys`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Fetch 10 keys, then the page after them`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --limit`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 10`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` list`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --limit`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 10`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --after`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` YOUR_CURSOR`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Table output shows each key’s label, ID, public key, scopes and last use. Plain and CSV output add the IP allow list and the creation and update times. Secrets are never shown. Pages work as `,_jsx(_components.a,{href:`/cli/configuration#lists-and-pagination`,children:`Lists and Pagination`}),` describes; replace `,_jsx(_components.code,{children:`YOUR_CURSOR`}),` with the cursor of the previous page.`]}),`\n`,_jsx(Heading,{level:`2`,id:`create-api-key`,children:`Create API Key`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`--label`}),` and at least one `,_jsx(_components.code,{children:`--scope`}),` are required.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`21`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Send messages from any domain`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --label`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Production API\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --scope`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages:send:all\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Read-only analytics key`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --label`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Analytics Only\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --scope`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"statistics-transactional:read:all\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --scope`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages:read:all\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Domain-specific messaging`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --label`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Newsletter Service\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --scope`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages:send:{example.com}\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --scope`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"suppressions:read\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Key usable only from specific IPs`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --label`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Production servers\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --scope`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages:send:all\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --ip-allow-list`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 203.0.113.0/24`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --ip-allow-list`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 2001:db8::1`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The output shows the key’s secret once. Save it at once: it cannot be retrieved later. A retry with the same `,_jsx(_components.code,{children:`--idempotency-key`}),` within 5 minutes returns the same response, secret included. After that, create a new key if you lose the secret.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`--label`}),` holds up to 255 characters.`]}),`\n`,_jsx(Heading,{level:`2`,id:`scopes`,children:`Scopes`}),`\n`,_jsxs(_components.p,{children:[`Give each scope with its own `,_jsx(_components.code,{children:`--scope`}),`, or separate scopes with commas. Scope names are case-sensitive; the domain of a scope is compared ignoring case. The CLI checks every scope before it sends the request: a scope the API does not accept, or a scope given twice, fails with exit code 4. Follow the principle of least privilege, and grant only the scopes the key needs.`]}),`\n`,_jsxs(_components.p,{children:[`A scope that ends in `,_jsx(_components.code,{children:`{domain}`}),` takes one of your domains in its place, such as `,_jsx(_components.code,{children:`messages:send:{example.com}`}),`. The domain must exist in your account. Quote such a scope, as the examples do, so your shell passes the braces unchanged.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Area`}),_jsx(_components.th,{children:`Scopes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Messages`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`messages:send:all`}),`, `,_jsx(_components.code,{children:`messages:send:{domain}`}),`, `,_jsx(_components.code,{children:`messages:cancel:all`}),`, `,_jsx(_components.code,{children:`messages:cancel:{domain}`}),`, `,_jsx(_components.code,{children:`messages:read:all`}),`, `,_jsx(_components.code,{children:`messages:read:{domain}`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Domains`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`domains:read`}),`, `,_jsx(_components.code,{children:`domains:write`}),`, `,_jsx(_components.code,{children:`domains:delete:all`}),`, `,_jsx(_components.code,{children:`domains:delete:{domain}`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Accounts`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`accounts:read`}),`, `,_jsx(_components.code,{children:`accounts:write`}),`, `,_jsx(_components.code,{children:`accounts:billing`}),`, `,_jsx(_components.code,{children:`accounts:members:read`}),`, `,_jsx(_components.code,{children:`accounts:members:add`}),`, `,_jsx(_components.code,{children:`accounts:members:update`}),`, `,_jsx(_components.code,{children:`accounts:members:remove`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Webhooks`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`webhooks:read:all`}),`, `,_jsx(_components.code,{children:`webhooks:read:{domain}`}),`, `,_jsx(_components.code,{children:`webhooks:write:all`}),`, `,_jsx(_components.code,{children:`webhooks:write:{domain}`}),`, `,_jsx(_components.code,{children:`webhooks:delete:all`}),`, `,_jsx(_components.code,{children:`webhooks:delete:{domain}`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Routes`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`routes:read:all`}),`, `,_jsx(_components.code,{children:`routes:read:{domain}`}),`, `,_jsx(_components.code,{children:`routes:write:all`}),`, `,_jsx(_components.code,{children:`routes:write:{domain}`}),`, `,_jsx(_components.code,{children:`routes:delete:all`}),`, `,_jsx(_components.code,{children:`routes:delete:{domain}`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Suppressions`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`suppressions:read`}),`, `,_jsx(_components.code,{children:`suppressions:write`}),`, `,_jsx(_components.code,{children:`suppressions:delete`}),`, `,_jsx(_components.code,{children:`suppressions:wipe`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Templates`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`templates:read`}),`, `,_jsx(_components.code,{children:`templates:write`}),`, `,_jsx(_components.code,{children:`templates:delete`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Campaigns`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`campaigns:read`}),`, `,_jsx(_components.code,{children:`campaigns:write`}),`, `,_jsx(_components.code,{children:`campaigns:delete`}),`, `,_jsx(_components.code,{children:`campaigns:send`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Contacts`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`contacts:read`}),`, `,_jsx(_components.code,{children:`contacts:write`}),`, `,_jsx(_components.code,{children:`contacts:delete`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Lists`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`lists:read`}),`, `,_jsx(_components.code,{children:`lists:write`}),`, `,_jsx(_components.code,{children:`lists:delete`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`SMTP credentials`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`smtp-credentials:read:all`}),`, `,_jsx(_components.code,{children:`smtp-credentials:read:{domain}`}),`, `,_jsx(_components.code,{children:`smtp-credentials:write:all`}),`, `,_jsx(_components.code,{children:`smtp-credentials:write:{domain}`}),`, `,_jsx(_components.code,{children:`smtp-credentials:delete:all`}),`, `,_jsx(_components.code,{children:`smtp-credentials:delete:{domain}`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Statistics`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`statistics-transactional:read:all`}),`, `,_jsx(_components.code,{children:`statistics-transactional:read:{domain}`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`API keys`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`api-keys:read`}),`, `,_jsx(_components.code,{children:`api-keys:write`}),`, `,_jsx(_components.code,{children:`api-keys:delete`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Sub-accounts`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`sub-accounts:read`}),`, `,_jsx(_components.code,{children:`sub-accounts:write`}),`, `,_jsx(_components.code,{children:`sub-accounts:delete`}),`, `,_jsx(_components.code,{children:`sub-accounts:suspend`}),`, `,_jsx(_components.code,{children:`sub-accounts:usage`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Sub-account API keys`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`sub-account-api-keys:read`}),`, `,_jsx(_components.code,{children:`sub-account-api-keys:write`}),`, `,_jsx(_components.code,{children:`sub-account-api-keys:delete`})]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`ahasend apikeys create --help`}),` lists the same scopes. See `,_jsx(_components.a,{href:`/api-reference/scopes`,children:`Permission scopes`}),` for what each one allows.`]}),`\n`,_jsx(Heading,{level:`2`,id:`ip-allow-lists`,children:`IP Allow Lists`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`--ip-allow-list`}),` limits the source IPs that can authenticate with the key. Each entry is a CIDR block, such as `,_jsx(_components.code,{children:`203.0.113.0/24`}),`, or a bare IPv4 or IPv6 address, such as `,_jsx(_components.code,{children:`2001:db8::1`}),`. Repeat the flag, or separate entries with commas. Without it, the key works from any IP, which table and plain output show as `,_jsx(_components.code,{children:`any`}),`.`]}),`\n`,_jsx(_components.p,{children:`The CLI checks the list before it sends the request. These fail with exit code 4:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`An empty value`}),`\n`,_jsx(_components.li,{children:`An entry that is not an IP address or CIDR block`}),`\n`,_jsxs(_components.li,{children:[`A block that allows every IP, such as `,_jsx(_components.code,{children:`0.0.0.0/0`}),` or `,_jsx(_components.code,{children:`::/0`}),`; leave the list empty instead`]}),`\n`,_jsx(_components.li,{children:`More than 100 distinct entries, the API’s limit`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`A request with the key from an IP outside the list fails with HTTP 403 (exit code 6). See `,_jsx(_components.a,{href:`/security/ip-allow-lists`,children:`IP allow lists`}),` for how the API applies the list.`]}),`\n`,_jsx(Heading,{level:`2`,id:`get-api-key-details`,children:`Get API Key Details`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` get`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` YOUR_RESOURCE_ID`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The key ID must be a UUID. Table and plain output show the secret key as `,_jsx(_components.code,{children:`[HIDDEN]`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`update-api-key`,children:`Update API Key`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`update`}),` changes only the flags you give, and needs at least one. Do not replace the scopes of the key the CLI is logged in with unless the new scopes keep the `,_jsx(_components.code,{children:`api-keys`}),` scopes you need: otherwise that key can no longer change itself back. `,_jsx(_components.code,{children:`--scope`}),` replaces all of the key’s scopes: to add a scope, give every existing scope plus the new one. `,_jsx(_components.code,{children:`--ip-allow-list`}),` replaces the whole list, and `,_jsx(_components.code,{children:`--clear-ip-allow-list`}),` removes it so the key works from any IP. The secret cannot be changed; create a new key and delete the old one instead.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Update the label`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` update`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` YOUR_RESOURCE_ID`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --label`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Updated Label\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Replace the scopes`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` update`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` YOUR_RESOURCE_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --scope`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages:send:{example.com}\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --scope`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"messages:read:{example.com}\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Replace the IP allow list`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` update`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` YOUR_RESOURCE_ID`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --ip-allow-list`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 203.0.113.0/24`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Remove the IP allow list so the key works from any IP`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` update`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` YOUR_RESOURCE_ID`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --clear-ip-allow-list`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`--ip-allow-list`}),` and `,_jsx(_components.code,{children:`--clear-ip-allow-list`}),` cannot be used together.`]}),`\n`,_jsx(_components.p,{children:`The API refuses to give the key you are calling with an IP allow list that leaves out your current IP, so you cannot lock yourself out. The update fails with HTTP 409, exit code 1.`}),`\n`,_jsx(Heading,{level:`2`,id:`delete-api-key`,children:`Delete API Key`}),`\n`,_jsxs(_components.p,{children:[`The command asks for confirmation first, as `,_jsx(_components.a,{href:`/cli/configuration#prompts`,children:`Prompts`}),` describes; `,_jsx(_components.code,{children:`--force`}),` (`,_jsx(_components.code,{children:`-f`}),`) skips it.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`TEST_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --label`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Docs deletion test\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --scope`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"accounts:read\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --output`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` jq`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -er`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '.id'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ahasend`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` apikeys`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` delete`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$TEST_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Deleting an API key is irreversible. Applications using this key will lose access immediately.`})}),`\n`,_jsx(Heading,{level:`2`,id:`command-flags`,children:`Command Flags`}),`\n`,_jsxs(_components.p,{children:[`These flags come from the CLI’s `,_jsx(_components.code,{children:`--help`}),`. All commands also accept the `,_jsx(_components.a,{href:`/cli/configuration#global-flags`,children:`global flags`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`apikeys-create`,children:_jsx(_components.code,{children:`apikeys create`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Flag`}),_jsx(_components.th,{children:`Description and default`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--idempotency-key string`})}),_jsx(_components.td,{children:`Idempotency key for safe retries (generated when omitted)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--ip-allow-list strings`})}),_jsx(_components.td,{children:`CIDR block or IP address allowed to use the key (can be used multiple times)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--label string`})}),_jsx(_components.td,{children:`Label for the API key (required)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--scope strings`})}),_jsx(_components.td,{children:`Scope to grant (required; can be used multiple times)`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`apikeys-delete`,children:_jsx(_components.code,{children:`apikeys delete`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Flag`}),_jsx(_components.th,{children:`Description and default`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`-f`}),`, `,_jsx(_components.code,{children:`--force`})]}),_jsx(_components.td,{children:`Skip confirmation prompt`})]})})]}),`\n`,_jsx(Heading,{level:`3`,id:`apikeys-get`,children:_jsx(_components.code,{children:`apikeys get`})}),`\n`,_jsxs(_components.p,{children:[`This command has no command-specific flags. See `,_jsx(_components.a,{href:`/cli/configuration#global-flags`,children:`global flags`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`apikeys-list`,children:_jsx(_components.code,{children:`apikeys list`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Flag`}),_jsx(_components.th,{children:`Description and default`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--after string`})}),_jsx(_components.td,{children:`Return the page after this cursor`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--before string`})}),_jsx(_components.td,{children:`Return the page before this cursor`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--limit int32`})}),_jsx(_components.td,{children:`Maximum number of items to return (0-100; 0 uses the API default)`})]})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`apikeys-update`,children:_jsx(_components.code,{children:`apikeys update`})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Flag`}),_jsx(_components.th,{children:`Description and default`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--clear-ip-allow-list`})}),_jsx(_components.td,{children:`Remove the IP allow list so the key works from any IP`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--ip-allow-list strings`})}),_jsx(_components.td,{children:`New CIDR block or IP address allowed to use the key, replacing the list (can be used multiple times)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--label string`})}),_jsx(_components.td,{children:`New label for the API key`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`--scope strings`})}),_jsx(_components.td,{children:`New scope to grant, replacing all scopes (can be used multiple times)`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next Steps`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/api-reference/scopes`,children:`Learn about API Key Scopes`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/cli/authentication`,children:`Authenticate with the CLI`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/cli/commands/messages`,children:`Send messages`})}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`related-guides`,children:`Related Guides`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/cli/installation`,children:`Install the CLI`}),`, `,_jsx(_components.a,{href:`/cli/authentication`,children:`CLI authentication`}),`, `,_jsx(_components.a,{href:`/api-reference/scopes`,children:`Permission scopes`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/security/scoped-credentials`,children:`Scoped credentials`}),`, `,_jsx(_components.a,{href:`/api-reference/api-keys/create-api-key`,children:`Create key API`}),`, `,_jsx(_components.a,{href:`/security/ip-allow-lists`,children:`IP allow lists`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/cli/configuration`,children:`CLI configuration and output`}),`, `,_jsx(_components.a,{href:`/api-reference/authentication`,children:`API authentication`}),`, `,_jsx(_components.a,{href:`/domains`,children:`Domain setup`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/send-api/sandbox`,children:`Sandbox behavior`}),`, `,_jsx(_components.a,{href:`/bounces#suppression-duration`,children:`Suppression durations`}),`.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"ahasend apikeys: Manage API Keys","description":"Create, list, update, and delete scoped AhaSend API keys from the command line, including domain-restricted keys such as messages:send:{example.com}.","icon":"key","sidebarTitle":"apikeys","href":"/cli/commands/apikeys"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"List API Keys","slug":"list-api-keys","depth":2,"children":[]},{"title":"Create API Key","slug":"create-api-key","depth":2,"children":[]},{"title":"Scopes","slug":"scopes","depth":2,"children":[]},{"title":"IP Allow Lists","slug":"ip-allow-lists","depth":2,"children":[]},{"title":"Get API Key Details","slug":"get-api-key-details","depth":2,"children":[]},{"title":"Update API Key","slug":"update-api-key","depth":2,"children":[]},{"title":"Delete API Key","slug":"delete-api-key","depth":2,"children":[]},{"title":"Command Flags","slug":"command-flags","depth":2,"children":[{"title":"apikeys create","slug":"apikeys-create","depth":3,"children":[]},{"title":"apikeys delete","slug":"apikeys-delete","depth":3,"children":[]},{"title":"apikeys get","slug":"apikeys-get","depth":3,"children":[]},{"title":"apikeys list","slug":"apikeys-list","depth":3,"children":[]},{"title":"apikeys update","slug":"apikeys-update","depth":3,"children":[]}]},{"title":"Next Steps","slug":"next-steps","depth":2,"children":[]},{"title":"Related Guides","slug":"related-guides","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/ahasend/1d760da0535d9f7c/ahasend-gtm.js"],"subdomain":"ahasend","siteName":"AhaSend","title":"ahasend apikeys: Manage API Keys - AhaSend","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-16T17:32:36.688Z","originalFileLocation":"cli/commands/apikeys.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=\"system\"}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=\"Create, list, update, and delete scoped AhaSend API keys from the command line, including domain-restricted keys such as messages:send:{example.com}.\">\u003cmeta data-mint-head name=\"application-name\" content=\"AhaSend\">\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/ahasend/4BjAcdwrGYDKJCaO/_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/ahasend/4BjAcdwrGYDKJCaO/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/ahasend/4BjAcdwrGYDKJCaO/_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/ahasend/4BjAcdwrGYDKJCaO/_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/ahasend/4BjAcdwrGYDKJCaO/_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/ahasend/4BjAcdwrGYDKJCaO/_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/ahasend/4BjAcdwrGYDKJCaO/_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/ahasend/4BjAcdwrGYDKJCaO/_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/ahasend/4BjAcdwrGYDKJCaO/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"ahasend apikeys: Manage API Keys - AhaSend\">\u003cmeta data-mint-head property=\"og:description\" content=\"Create, list, update, and delete scoped AhaSend API keys from the command line, including domain-restricted keys such as messages:send:{example.com}.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"AhaSend\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://ahasend.com/docs/cli/commands/apikeys\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://ahasend.mintlify.app/_mintlify/api/og/v2?division=Commands\u0026amp;title=ahasend+apikeys%3A+Manage+API+Keys\u0026amp;description=Create%2C+list%2C+update%2C+and+delete+scoped+AhaSend+API+keys+from+the+command+line%2C+including+domain-restricted+keys+such+as+messages%3Asend%3A%7Bexample.com%7D.\u0026amp;theme=fec911c84bb9f722051c4af3\u0026amp;signature=72365a30280ab558f42b07d5c8ebd5caf0d4047c01688cdc53e8686c7b53076f\">\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=\"ahasend apikeys: Manage API Keys - AhaSend\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Create, list, update, and delete scoped AhaSend API keys from the command line, including domain-restricted keys such as messages:send:{example.com}.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://ahasend.mintlify.app/_mintlify/api/og/v2?division=Commands\u0026amp;title=ahasend+apikeys%3A+Manage+API+Keys\u0026amp;description=Create%2C+list%2C+update%2C+and+delete+scoped+AhaSend+API+keys+from+the+command+line%2C+including+domain-restricted+keys+such+as+messages%3Asend%3A%7Bexample.com%7D.\u0026amp;theme=fec911c84bb9f722051c4af3\u0026amp;signature=72365a30280ab558f42b07d5c8ebd5caf0d4047c01688cdc53e8686c7b53076f\">\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/ahasend/4BjAcdwrGYDKJCaO/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"AhaSend\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#066fd1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://ahasend.com/docs/cli/commands/apikeys\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/cli/commands/apikeys.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://ahasend.com/#organization\",\"name\":\"AhaSend\",\"legalName\":\"AhaSend B.V.\",\"url\":\"https://ahasend.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/ahasend/F35Ozd-1GsftDpcH/logo.png?fit=max\u0026auto=format\u0026n=F35Ozd-1GsftDpcH\u0026q=85\u0026s=ca1d4c27f7c2811598e65cb25a21323c\"},\"sameAs\":[\"https://x.com/aha_send\",\"https://www.linkedin.com/company/ahasend\",\"https://github.com/ahasend\"]},{\"@type\":\"WebSite\",\"@id\":\"https://ahasend.com/docs#website\",\"name\":\"AhaSend\",\"url\":\"https://ahasend.com/docs\",\"publisher\":{\"@id\":\"https://ahasend.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://ahasend.com/docs/cli/commands/apikeys#webpage\",\"url\":\"https://ahasend.com/docs/cli/commands/apikeys\",\"name\":\"ahasend apikeys: Manage API Keys\",\"description\":\"Create, list, update, and delete scoped AhaSend API keys from the command line, including domain-restricted keys such as messages:send:{example.com}.\",\"dateModified\":\"2026-10-16T17:32:36.688Z\",\"isPartOf\":{\"@id\":\"https://ahasend.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://ahasend.com/docs/cli/commands/apikeys#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://ahasend.com/docs/cli/commands/apikeys#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Commands\",\"item\":\"https://ahasend.com/docs/cli/commands/messages\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ahasend apikeys: Manage API Keys\",\"item\":\"https://ahasend.com/docs/cli/commands/apikeys\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://ahasend.com/docs/cli/commands/apikeys#article\",\"headline\":\"ahasend apikeys: Manage API Keys\",\"name\":\"ahasend apikeys: Manage API Keys\",\"description\":\"Create, list, update, and delete scoped AhaSend API keys from the command line, including domain-restricted keys such as messages:send:{example.com}.\",\"url\":\"https://ahasend.com/docs/cli/commands/apikeys\",\"mainEntityOfPage\":{\"@id\":\"https://ahasend.com/docs/cli/commands/apikeys#webpage\"},\"dateModified\":\"2026-10-16T17:32:36.688Z\",\"publisher\":{\"@id\":\"https://ahasend.com/#organization\"},\"isPartOf\":{\"@id\":\"https://ahasend.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"AhaSend\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"AhaSend","nav":{"global":null,"tabs":[{"tab":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":""}]},{"tab":"API Reference","icon":"code","pages":[{"title":"API Reference","href":"/api-reference"}]},{"tab":"CLI","icon":"square-terminal","groups":[{"group":"Getting Started","pages":[{"title":"AhaSend CLI: Send Email from Your Terminal","icon":"book","sidebarTitle":"Overview","href":"/cli"},{"title":"Install the AhaSend CLI (macOS, Linux, Windows)","icon":"download","sidebarTitle":"Installation","href":"/cli/installation"},{"title":"CLI Quickstart: Send Email from the Terminal","icon":"play","sidebarTitle":"Quickstart","href":"/cli/quickstart"},{"title":"CLI Authentication: API Keys and Profiles","icon":"key","sidebarTitle":"Authentication","href":"/cli/authentication"},{"title":"CLI Configuration: Config File, Flags, Output","icon":"gear","sidebarTitle":"Configuration","href":"/cli/configuration"},{"title":"CLI Examples: Scripts and CI/CD Automation","icon":"lightbulb","sidebarTitle":"Examples","href":"/cli/examples"}]},{"group":"Commands","pages":[{"title":"ahasend messages: Send and Track Email","icon":"envelope","sidebarTitle":"messages","href":"/cli/commands/messages"},{"title":"ahasend domains: Add and Verify Domains","icon":"globe","sidebarTitle":"domains","href":"/cli/commands/domains"},{"title":"ahasend webhooks: Manage and Test Webhooks","icon":"webhook","sidebarTitle":"webhooks","href":"/cli/commands/webhooks"},{"title":"ahasend routes: Manage Inbound Email Routes","icon":"route","sidebarTitle":"routes","href":"/cli/commands/routes"},{"title":"ahasend suppressions: Manage Suppressions","icon":"ban","sidebarTitle":"suppressions","href":"/cli/commands/suppressions"},{"title":"ahasend smtp: SMTP Credentials and Test Sends","description":"Create, list, and delete AhaSend SMTP relay credentials from the CLI, and send test emails through send.ahasend.com on port 587 to verify your setup.","icon":"server","sidebarTitle":"smtp","href":"/cli/commands/smtp"},{"title":"ahasend apikeys: Manage API Keys","icon":"key","sidebarTitle":"apikeys","href":"/cli/commands/apikeys"},{"title":"ahasend stats: Delivery and Bounce Reports","description":"Pull AhaSend deliverability, bounce and delivery-time reports from the CLI, grouped by hour, day, week or month and exported to CSV or JSON.","icon":"chart-line","sidebarTitle":"stats","href":"/cli/commands/stats"},{"title":"ahasend auth: Log In and Manage Profiles","icon":"user-shield","sidebarTitle":"auth","href":"/cli/commands/auth"},{"title":"ahasend ping: Test API Connectivity","icon":"wifi","sidebarTitle":"ping","href":"/cli/commands/ping"},{"title":"ahasend contacts: Manage Account Contacts","sidebarTitle":"contacts","icon":"address-book","href":"/cli/commands/contacts"},{"title":"ahasend lists: Manage Contact Lists","sidebarTitle":"lists","icon":"list-ul","href":"/cli/commands/lists"},{"title":"ahasend templates: Transactional Templates","sidebarTitle":"templates","icon":"file-lines","href":"/cli/commands/templates"},{"title":"ahasend campaigns: Manage Campaigns","sidebarTitle":"campaigns","icon":"bullhorn","href":"/cli/commands/campaigns"},{"title":"ahasend subaccounts: Manage Sub-Accounts","sidebarTitle":"subaccounts","icon":"building","href":"/cli/commands/subaccounts"}]},{"group":"Features","pages":[{"title":"Send Batch Emails from CSV with the CLI","icon":"layer-group","sidebarTitle":"Batch Processing","href":"/cli/batch-processing"},{"title":"Message Content and Substitutions in the CLI","icon":"file-code","sidebarTitle":"Message Content","href":"/cli/templates"},{"title":"Test Webhooks Locally with the CLI","icon":"bug","sidebarTitle":"Webhook Testing","href":"/cli/webhook-testing"},{"title":"Test Inbound Email Routes Locally with the CLI","icon":"envelopes-bulk","sidebarTitle":"Route Testing","href":"/cli/route-testing"}]}]},{"tab":"Guides","icon":"plug","pages":[{"title":"Guides","href":"/guides"}]},{"tab":"Changelog","icon":"clock-rotate-left","pages":[{"title":"Changelog","href":"/changelog"}]},{"tab":"Roadmap","icon":"map","pages":[{"title":"Roadmap","href":"/roadmap"}]}]},"title":"ahasend apikeys: Manage API Keys - AhaSend","buildId":"dpl_GvhK4qVXq51DpfYJLCtPpYNN4YHN","deploymentId":"dpl_GvhK4qVXq51DpfYJLCtPpYNN4YHN","dynamics":[],"chunks":[]}