Developer platform
NexMask OpenAPI
Manage mailboxes, read mail, and query account information through a stable API.
API Key
Send your complete API Key in the apiKey HTTP header on every OpenAPI request. Start with the read-only request below before integrating mailbox creation. OpenAPI access requires an active membership.
API Key authentication ↓YOUR_API_KEYAPI Key authentication
Send your complete API Key in the apiKey HTTP header on every OpenAPI request. Start with the read-only request below before integrating mailbox creation.
1. Get your API Key
- Sign in and copy the key from the API Key area at the top of Personal space. This page also displays your own key while signed in. When signed out, YOUR_API_KEY is only a placeholder, not a working key. Personal space ↗
- OpenAPI access requires an active membership.
- Replace YOUR_API_KEY in every example with the complete key, without a Bearer prefix, extra quotes or whitespace. Resetting your API Key invalidates the old key; update every integration.
2. Send the request header
Use apiKey as the header name and the raw key as its value. OpenAPI does not read API Keys from Authorization: Bearer, JSON bodies, URL parameters or website login cookies. Signing in on the website does not replace this header. MCP Bearer authentication does not apply here.
apiKey: YOUR_API_KEY
Accept-Language: en-US
For POST endpoints, also set Content-Type: application/json and put business parameters in the JSON body. Keep apiKey in the header. GET queries normally do not need Content-Type.
Pass the API Key in the request header and keep it secure. Accept-Language takes priority for both success and error responses. If omitted or blank, the API Key owner language is used; unidentified accounts default to en-US. Supports zh-CN, zh-TW, en-US and language weights. Invalid or unsupported headers default to en-US. X-Language and website login preferences do not affect OpenAPI.
3. Make a read-only test request
This GET request only reads the account associated with the key. It creates no mailbox and deducts no credits. Active membership is required. HTTP 200 with code=0 indicates success; opening the public documentation is not API authentication. Examples keep placeholders and never insert your actual key.
curl --request GET 'https://app.nexmask.net/openapi/v1/user/info.cgi' \
--header 'apiKey: YOUR_API_KEY' \
--header 'Accept-Language: en-US'
Configure Postman
In Headers, add apiKey with your full key as Value; optionally add Accept-Language. Alternatively, select API Key in Authorization, set Key to apiKey, enter the key as Value and choose Header for Add to. Do not select Bearer Token. For POST, select raw / JSON under Body.
Common authentication errors
HTTP 401 / code=-1210— The API Key is missing or invalid, or the account is frozen. Check the placeholder, the apiKey header, any accidental Bearer prefix and whether the key was reset.HTTP 403 / code=-1300— The key was recognized, but membership is missing or expired. Check membership status in Personal space.HTTP 415— The POST content type is incorrect. Set Content-Type: application/json and send valid JSON. The JSON example contains business parameters only, not a complete HTTP request.
Keep and use the key on a trusted backend. Do not expose it in public pages, repositories, screenshots, shared logs or URLs. Reset it in Personal space if leaked, and never publicly share requests containing a real key.
/openapi/v1/mailbox/create.cgiCreate mailbox
Create a new incoming mailbox. If domainId is omitted, a public or login domain is selected at random.
Request fields
prefixstringNoMailbox prefix, 5–64 characters; omit to generate randomlydomainIdlongNoOptional incoming domain ID; omit it to randomly select a public or login domaindurationHoursintegerNoValidity period in hours; defaults to 1. 0 is also treated as 1 hour. An unconfigured one-hour duration remains free; every other duration must match an available plan. Negative or unconfigured duration: -1100 (invalid parameter).Successful response data
idlongYesMailbox IDemailstringYesFull email addressreceivedCountlongYesTotal number of received emailsexpiresAtdatetimeYesExpiration timeguestbooleanYesWhether this is a guest mailbox; always false when created through OpenAPIResponse example
{"code":0,"msg":"Success","data":{"id":128,"email":"[email protected]","receivedCount":0,"expiresAt":"2026-09-03T12:00:00.000+00:00","guest":false}}
/openapi/v1/relay/mailbox/create.cgiCreate a mainstream mailbox
Allocate a new mainstream mailbox with the selected suffix. No prefix or domain ID is needed. Requires a valid API Key and active VIP membership. Uses the same plans and credit pricing as temporary mailboxes. Does not renew, reclaim, or switch the active mailbox on the website.
Request fields
suffixstring (enum)YesRequired enum: gmail.com, outlook.com, googlemail.com, hotmail.com. The suffix is selected exactly. Returns -1407 when unavailable; never substitutes another suffix.durationHoursintegerYesRequired non-negative integer, not null. 0 is treated as 1 hour. VIP pricing applies. An unconfigured one-hour duration remains free; every other duration must match a configured mailbox plan. Insufficient credits: -1208; negative or unconfigured duration: -1100 (invalid parameter).Successful response data
idlongYesMailbox IDemailstringYesFull email addressreceivedCountlongYesTotal number of received emailsexpiresAtdatetimeYesExpiration timeguestbooleanYesWhether this is a guest mailbox; always false when created through OpenAPIReturns exactly the same structure as temporary mailbox creation. Use id as mailboxId to query messages, or use the mailbox list and mail detail endpoints. Only the owning API user has access. Each repeated call creates another mailbox and charges the selected plan.
Response example
{"code":0,"msg":"Success","data":{"id":1024,"email":"[email protected]","receivedCount":0,"expiresAt":"2026-10-06T10:00:00.000+00:00","state":0,"uuid":null,"guest":false}}
/openapi/v1/domain/list.cgiAvailable domains
List every domain available to the current API user: public, login, the user's private domains, and member domains while membership is active. All domains are loaded first and filtered in application code.
Successful response data
idlongYesDomain ID accepted as domainId by mailbox creationdomainstringYesIncoming domain nametypeintegerYesDomain type: 0 public, 1 login, 2 member, 3 privateownerIdlongYesOwning user ID; 0 for system domainsmailboxCountlongYesTotal mailbox pool size for the domainmailboxOccupylongYesNumber of occupied mailbox pool entriesstateintegerYesDomain state; this list only returns available domains with state 0Response example
{"code":0,"msg":"Success","data":[{"id":1,"domain":"nexmask.com","type":0,"ownerId":0,"mailboxOccupy":320,"seq":1000,"mailboxCount":10000,"mailCount":860,"state":0,"createdAt":"2026-09-01T10:00:00.000+00:00","updatedAt":"2026-09-04T10:00:00.000+00:00"}]}
/openapi/v1/tools/us_address/generate.cgiRandom US address
Create a temporary mailbox using the existing OpenAPI mailbox rules, then return public address data and randomly generated identity details for a selected or random state.
Request fields
prefixstringNoMailbox prefix, 5–64 characters; omit to generate randomlydomainIdlongNoOptional incoming domain ID; omit it to randomly select a public or login domaindurationHoursintegerNoValidity period in hours; defaults to 1. 0 is also treated as 1 hour. An unconfigured one-hour duration remains free; every other duration must match an available plan. Negative or unconfigured duration: -1100 (invalid parameter).stateCodestringNoTwo-letter USPS state code, such as CA; omit it to choose randomly from the 50 states and Washington, DC.Successful response data
mailboxIdlongYesRecord ID of the mailbox created by this requestemailstringYesTemporary email address created by this requestmailboxDomainIdlongYesIncoming domain ID of the created mailboxfirstNamestringYesRandomly generated first namelastNamestringYesRandomly generated last namegenderstringYesRandom gender localized to the current API languagephonestringYesPhone number with a state-matched area code and randomly generated exchange and subscriber numbersstreetAddressstringYesComplete street address from the public data samplecitystringYesCitystateNamestringYesFull state namestateCodestringYesTwo-letter USPS state codezipCodestringYesZIP CodelatitudedecimalYesAddress latitudelongitudedecimalYesAddress longitudefullAddressstringYesComplete address composed of street, city, state, and ZIP CodeResponse example
{"code":0,"msg":"Success","data":{"mailboxId":128,"email":"[email protected]","mailboxDomainId":1,"firstName":"Emily","lastName":"Carter","gender":"Female","phone":"+1 (202) 483-7612","streetAddress":"4600 Silver Hill Rd","city":"Washington","stateName":"District of Columbia","stateCode":"DC","zipCode":"20233","latitude":38.8459,"longitude":-76.9274,"fullAddress":"4600 Silver Hill Rd, Washington, DC 20233, United States"}}
/openapi/v1/mail/list.cgiMail list
List mail for the current API user, optionally filtered by mailboxId, newest first, with 10 items per page.
Request fields
mailboxIdlongNoMailbox ID owned by the current user; omit it to query all account mailpageintegerNoPage number starting at 1; defaults to 1keywordstringNoSender or subject keyword, up to 100 charactersSuccessful response data
countintegerYesTotal number of matching recordssizeintegerYesFixed at 10 items per pagepageintegerYesCurrent page numbertotalintegerYesTotal number of pagesdataarrayYesArray of mail summariesdata mail item
idlongYesMail IDtostringYesRecipient email addressmessageIdstring/nullNoEmail Message-ID; null when not provided by the messagefromstringYesSender addresssubjectstring/nullNoEmail subject; null when absentreceivedAtdatetimeYesTime receivedreadbooleanYesWhether the email has been readkeywordstring/nullNoKeyword extracted from the email; null when none is foundkeywordDisplaystring/nullNoDisplay-ready keyword text; null when unavailableResponse example
{"code":0,"msg":"Success","data":{"count":1,"size":10,"page":1,"total":1,"data":[{"id":901,"to":"[email protected]","messageId":"example-message-id","from":"NexMask <[email protected]>","subject":"Your verification code","receivedAt":"2026-09-02T12:30:00.000+00:00","read":false,"keyword":"897456","keywordDisplay":"897456"}]}}
/openapi/v1/mail/detail.cgiMail details
Read the complete content of a specific email.
Request fields
idlongYesMail IDSuccessful response data
idlongYesMail IDtostringYesRecipient email addressmessageIdstring/nullNoEmail Message-ID; null when not provided by the messagefromstringYesSender addresssubjectstring/nullNoEmail subject; null when absentreceivedAtdatetimeYesTime receivedtextContentstring/nullNoPlain-text email body; null when absentattachmentsarrayYesArray of attachments; empty when there are no attachmentsattachments item
fileNamestringYesAttachment file namecontentTypestring/nullNoAttachment media type; null when unknownsizelongYesAttachment size in bytesResponse example
{"code":0,"msg":"Success","data":{"id":901,"to":"[email protected]","messageId":"example-message-id","from":"NexMask <[email protected]>","subject":"Your verification code","receivedAt":"2026-09-02T12:30:00.000+00:00","textContent":"Your verification code is 897456.","attachments":[]}}
/openapi/v1/user/info.cgiUser information
Query the account associated with the current API Key.
Successful response data
idlongYesUser IDemailstringYesLogin email addressscoreintegerYesCurrent pointsvipExpiredatetime/nullYesMembership expiration time; null when membership has never been activatedstateintegerYesAccount statuscreatedAtdatetimeYesCreation timeupdatedAtdatetimeYesLast update timeResponse example
{"code":0,"msg":"Success","data":{"id":1,"email":"[email protected]","score":50000,"vipExpire":"2026-10-01T00:00:00.000+00:00","state":0,"createdAt":"2026-08-01T00:00:00.000+00:00","updatedAt":"2026-09-02T00:00:00.000+00:00"}}
/openapi/v1/mailbox/list.cgiMailbox list
List mailboxes for the current account with pagination.
Request fields
pageintegerNoPage number starting at 1; defaults to 1keywordstringNoEmail address keyword, up to 100 charactersSuccessful response data
countintegerYesTotal number of matching recordssizeintegerYesFixed at 10 items per pagepageintegerYesCurrent page numbertotalintegerYesTotal number of pagesdataarrayYesArray of mailboxesdata mailbox item
idlongYesMailbox IDdomainIdlongYesIncoming domain IDemailstringYesFull email addressuserIdlongYesOwner user IDreceivedCountlongYesTotal number of received emailsexpiresAtdatetime/nullNoExpiration time; null means no expirationcreatedAtdatetimeYesCreation timeupdatedAtdatetimeYesLast update timeexpiredbooleanYesWhether the mailbox has expiredexpiryTextstringYesLocalized expiration status text for displayexpiryTonestringYesStatus style: permanent, warning, healthy, or expiredResponse example
{"code":0,"msg":"Success","data":{"count":1,"size":10,"page":1,"total":1,"data":[{"id":128,"domainId":1,"email":"[email protected]","userId":1,"receivedCount":1,"expiresAt":"2026-09-03T12:00:00.000+00:00","createdAt":"2026-09-02T12:00:00.000+00:00","updatedAt":"2026-09-02T12:30:00.000+00:00","expired":false,"expiryText":"Expires in 24 hours","expiryTone":"warning"}]}}
Common responses and errors
All endpoints use the same code, msg, and data response structure.
codeintegerYes0 indicates success; negative values indicate recognized business errorsmsgstringYesHuman-readable result messagedataobject/nullNoBusiness data returned on successResponse codes
0Operation successful-1001The system is busy, please try again later-1006Frequent operations, please try again later-1100The request parameter is illegal-1101Request parameters cannot be empty-1102The request type must be application/json-1208Insufficient points, please top up first-1210API Key is invalid-1300An active membership is required to use this feature.-1400Please select the receiving domain name-1401The receiving domain name is currently unavailable-1403This domain name is for members only-1404The private domain name is not available-1405Please select the validity period-1407The email address is being added, please try again later.-1408Invalid email name format; maximum 64 characters-1409This email address is already in use-1410Email creation failed, please try again later-1411This email is currently unavailable-1412This email is currently unavailable-1700No US address is currently available. Please try again later.{"code":-1210,"msg":"API Key is invalid","data":null}