Skip to content
Skip to main content

Provisioning Agent Accounts

Every Agent Account lives on a domain. Before you can create one, pick a domain to host on — either a shared Nylas trial domain (instant, no DNS setup) or a domain you own (MX and TXT records at your DNS provider). This page walks through both paths and shows how to create accounts once a domain is ready.

StrategyAddress formatSetupWhen to use
Nylas trial domainalias@<your-application>.nylas.emailNone — register from the DashboardPrototyping, local testing, demos
Your own domain[email protected]MX and TXT records at your DNS providerProduction, customer-facing agents, branded mail

You can mix both strategies in one Nylas application. Many customers prototype on *.nylas.email and move to a custom domain before launch.

You register a domain once per Nylas organization, then create as many Agent Accounts under it as your plan allows.

  1. Register the domain with Nylas. From the Dashboard, add the domain and pick the data center region (US or EU) where your application lives. You can also register through the API — see Managing domains.
  2. Publish DNS records at your DNS provider. Nylas generates the MX record (routes inbound mail to Nylas) and TXT records (prove ownership and configure SPF/DKIM for outbound) you need to publish. Add them at your DNS provider.
  3. Wait for verification. Once the records propagate, Nylas verifies them automatically. The domain status moves to verified and is ready to host Agent Accounts.

We recommend a dedicated subdomain for production use — for example, agents.yourcompany.com — so that sender reputation on Agent Accounts is isolated from your primary marketing domain.

For the step-by-step DNS record flow and the verification API, see Managing domains.

Once your domain is verified, you can create Agent Accounts at any address under it. Three paths — in rough order of setup effort.

After nylas init, the CLI exposes the full Agent Accounts workflow:

# Create the Agent Account
nylas agent account create [email protected]
# Create with IMAP/SMTP access enabled from the start
nylas agent account create [email protected] --app-password "MySecureP4ssword!2024"
# List all Agent Accounts on the application
nylas agent account list
nylas agent account list --json
# Get a single Agent Account by ID or email
nylas agent account get [email protected]
# Check connector readiness
nylas agent status
# List policies and rules attached to accounts
nylas agent policy list
nylas agent rule list
# Delete by grant ID or email (--yes skips the confirmation prompt)
nylas agent account delete [email protected] --yes

nylas agent account create provisions the grant and prints the id, status, and connector details. Agent Accounts also show up in nylas auth list alongside connected grants.

In the left navigation, open Agent Accounts → Accounts and click Create account. Pick a registered domain and an alias. The account is live immediately and you can view its inbox from the Dashboard.

Use POST /v3/connect/custom with "provider": "nylas". Unlike OAuth providers, this flow doesn’t need a refresh token — only the email address on a registered domain.

Save the data.id — that’s the grant_id you’ll use on every subsequent call.

If you’ve created a policy, pass policy_id in settings to apply it to the new grant.

If you omit policy_id, the grant inherits whatever policy_id is configured on the application’s nylas connector, if any. You can change the policy on an existing grant by updating its settings.

Set app_password if you want end users to connect mail clients (Outlook, Apple Mail, Thunderbird, and so on) to the Agent Account over IMAP and SMTP submission in addition to using the API. The password is stored as a bcrypt hash — Nylas validates it on write and you can’t retrieve it later, only reset it.

From the CLI, pass it at creation time:

nylas agent account create [email protected] --app-password "MySecureP4ssword!2024"

Or through the API, pass app_password in settings:

The password must be 18–40 printable ASCII characters with at least one uppercase letter, one lowercase letter, and one digit. If you omit app_password, protocol-level access stays disabled and IMAP/SMTP clients reject authentication. See Connect mail clients to an Agent Account for the full setup.

SettingTypeRequiredDescription
emailstringYesThe Agent Account email address. The domain must match a registered domain.
policy_idstring (UUID)NoA policy to apply to this grant. Inherited from the nylas connector when omitted.
app_passwordstringNoPassword for IMAP and SMTP-submission access. 18–40 printable ASCII characters with at least one uppercase letter, one lowercase letter, and one digit. Bcrypt-hashed on write. Without this, protocol access stays disabled.

After you have a grant_id, send a test email to the new address from any external client. Then list the mailbox:

If you’ve registered a message.created webhook, you should also receive a notification as soon as mail lands. The payload has the same shape as message.created for any other grant — branch on the grant’s provider ("nylas") if you need to distinguish Agent Account deliveries from connected-grant deliveries.

A single Nylas application can manage Agent Accounts across any number of registered domains. Common patterns:

  • Per-customer domains. Your customers bring their own domains. You register each one and provision Agent Accounts on their behalf.
  • Sender-reputation isolation. High-volume outbound split across sales-a.yourcompany.com, sales-b.yourcompany.com, and so on, so that issues on one domain don’t contaminate the others.
  • Environment separation. agents.staging.yourcompany.com and agents.yourcompany.com on the same application, so that staging traffic stays off the production domain.