Skip to content

Get Limit method 🪪 Sub-Accounts

Retrieves the limit of a specified sub-account.

TIP

A value of -1 indicates that the sub-account inherits the parent account's limit, allowing the sub-account to utilize any remaining capacity within the parent account's allocation.

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.getLimit('validhandle123')
ts
import { MailChannels } from 'mailchannels-sdk'

const mailchannels = new MailChannels('your-api-key')

const { data, error } = await mailchannels.subAccounts.getLimit('validhandle123')

Params

  • handle string required: The handle of the sub-account to retrieve the limit for.

Response

  • data SubAccountsLimit | null nullable
    • sends number guaranteed
  • error ErrorResponse | null nullable: Error information if the operation failed.
    • message string guaranteed: A human-readable description of the error.
    • statusCode number | null nullable: The HTTP status code from the API, or null if the error is not related to an HTTP request. This field is intended for diagnostic use only and should not be relied upon.
    • type string guaranteed: 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 getLimit (handle: string): Promise<SubAccountsLimitResponse>

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;
};

Limit type declaration

ts
interface SubAccountsLimit {
  sends: number;
}
ts
type SubAccountsLimitResponse = DataResponse<SubAccountsLimit>;

Source

SourcePlaygroundDocsTests

Released under the MIT License.