---
title: "Add SMTP Credential"
method: POST
path: "/security/smtp"
tags: ["Security"]
---

# Add SMTP Credential

`POST /security/smtp`

Add new SMTP Credential. Required Access Level: ModifyAccessTokens

## Request body

- SmtpCredentialsPayload — Create new SMTP Credentials
  - `Name` string, string, required — Name of the Credential for ease of reference. It must be a valid email address.
  - `Expires` string, date-time, nullable — Date this SmtpCredential expires.
  - `RestrictAccessToIPRange` string[] — Which IPs can use this SmtpCredential
  - `Subaccount` string, string — Email of the subaccount for which this SmtpCredential should be created

## Response `201`

Created

- NewSmtpCredentials — Newly generated SMTP Credentials with Token
  - `Token` string, string — Unique token to be used in the system
  - `AccessLevel` 'None' | 'ViewAccount' | 'ViewContacts' | 'ViewForms' | 'ViewTemplates' | 'ViewCampaigns' | 'ViewChannels' | 'ViewAutomations' | 'ViewSurveys' | 'ViewSettings' | 'ViewBilling' | 'ViewSubAccounts' | 'ViewUsers' | 'ViewFiles' | 'ViewReports' | 'ModifyAccount' | 'ModifyContacts' | 'ModifyForms' | 'ModifyTemplates' | 'ModifyCampaigns' | 'ModifyChannels' | 'ModifyAutomations' | 'ModifySurveys' | 'ModifyFiles' | 'Export' | 'SendSmtp' | 'SendSMS' | 'ModifySettings' | 'ModifyBilling' | 'ModifyProfile' | 'ModifySubAccounts' | 'ModifyUsers' | 'Security' | 'ModifyLanguage' | 'ViewSupport' | 'SendHttp' | 'Modify2FAEmail' | 'ModifySupport' | 'ViewCustomFields' | 'ModifyCustomFields' | 'ModifyWebNotifications' | 'ExtendedLogs' | 'VerifyEmails' | 'Modify2FASms' | 'ViewVerifyEmails' | 'ViewAccessTokens' | 'ViewWebNotifications' | 'ModifyLandingPages' | 'ViewLandingPages' | 'ModifySuppressions' | 'ViewSuppressions' | 'ViewDragDropEditor' | 'ViewTemplateEditor' | 'ViewAITools' | 'ModifySubscriptionAntiSpam' | 'ViewLandingPagesCheckout' | 'ModifyLandingPagesCheckout' | 'ViewHTMLEditor' | 'ModifyAccessTokens' | 'ViewPaidNewsletters' | 'ModifyPaidNewsletters'
  - `Name` string, string — Name of the key.
  - `DateCreated` string, date-time — Date this SmtpCredential was created.
  - `LastUse` string, date-time, nullable — Date this SmtpCredential was last used.
  - `Expires` string, date-time, nullable — Date this SmtpCredential expires.
  - `RestrictAccessToIPRange` string[] — Which IPs can use this SmtpCredential

---

[API](https://skmtc.net/elasticemail/apis/megamail-api.md) · [All operations](https://skmtc.net/elasticemail/apis/megamail-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elasticemail/megamail-api/versions/1a0ebb83f676/schema)
