List SMTP Passwords method 🪪 Sub-Accounts
Retrieves details of all SMTP passwords associated with the specified sub-account. For security, the full SMTP password is not returned; only the password ID and a partially redacted version are provided.
Usage
ts
import { MailChannelsClient, SubAccounts } from 'mailchannels-sdk'
const mailchannels = new MailChannelsClient('your-api-key')
const subAccounts = new SubAccounts(mailchannels)
const { data, error } = await subAccounts.listSmtpPasswords('validhandle123')ts
import { MailChannels } from 'mailchannels-sdk'
const mailchannels = new MailChannels('your-api-key')
const { data, error } = await mailchannels.subAccounts.listSmtpPasswords('validhandle123')Params
handlestringrequired: The handle of the sub-account to retrieve the SMTP passwords for.
Response
dataSubAccountsSmtpPassword[] | nullnullableenabledbooleanguaranteed: Whether the SMTP password is enabled.idnumberguaranteed: The SMTP password ID for the sub-account.smtpPasswordstringguaranteed: SMTP password for the sub-account.
errorErrorResponse | nullnullable: Error information if the operation failed.messagestringguaranteed: A human-readable description of the error.statusCodenumber | nullnullable: The HTTP status code from the API, ornullif the error is not related to an HTTP request. This field is intended for diagnostic use only and should not be relied upon.typestringguaranteed: A string identifier for the type of error. This field is intended for diagnostic use only and should not be relied upon.
Type declarations
Signature
ts
async function listSmtpPasswords (handle: string): Promise<SubAccountsListSmtpPasswordResponse>Response type declarations
ts
interface ErrorResponse {
message: string;
statusCode: number | null;
type: ErrorType;
}ts
type DataResponse<T> = {
data: T;
error: null;
} | {
data: null;
error: ErrorResponse;
};SMTP Password type declarations
ts
interface SubAccountsSmtpPassword {
enabled: boolean;
id: number;
smtpPassword: string;
}ts
type SubAccountsListSmtpPasswordResponse = DataResponse<SubAccountsSmtpPassword[]>;Source
Source • Playground • Docs • Tests