Email REST API: Gmail & Outlook Aliases, Originals & Credits
Understand original versus alias inboxes, five-minute expiry, exact request costs, funding bonuses and secure email polling with integration examples.
OTPIXA editorial team · Updated 16 November 2026 · 15 min read
Email REST API: build around the complete inbox lifecycle
An email REST API lets software request an inbox, inspect incoming messages and read the content needed for an authorized workflow. For developers, the value is not simply obtaining an address. It is the ability to connect that address to a stable inbox identifier, an expiry time, predictable request costs and an observable result. A useful integration handles all of those pieces together instead of stopping after address creation.
OTPIXA's email API supports Gmail and Outlook mailbox categories with two kinds of allocation: aliases and originals. It uses a dedicated credit account rather than the ordinary website wallet or the numbers API USD balance. Creation, inbox polling and individual message reads have distinct costs. That model can be economical for measured workflows, but it rewards careful polling and clear accounting rather than constant refresh loops.
This guide explains the difference between mailbox kinds, exact credit prices, funding bonuses, the five-minute lifetime, authentication, request examples and safe message handling. It describes the current implementation, not a promise that every connected service is healthy. A live authenticated allocation and message readback remain the acceptance test for an integration. A documentation page or a successful missing-key rejection alone is not proof that real inbox creation works.
Alias versus original: what the words mean
An alias is an alternate address form associated with an underlying mailbox. Depending on the supplied address, aliasing may use supported plus-addressing or dot variations. The exact returned address is the one your application must use. Do not independently manufacture variants and assume OTPIXA will expose their messages. The API allocates a specific address and binds it to an inbox record for the authorized user.
An original is supplied as a real mailbox address rather than an alias variation. “Original” describes the address type; it does not mean OTPIXA transfers a permanent Google or Microsoft account to you. The API does not supply an account password, a long-term login session, recovery ownership or a promise of permanent exclusive access. The product is a temporary receiving inbox within OTPIXA's stated lifetime.
Both kinds can be requested for the supported Gmail or Outlook category when that supply is enabled and available. The API validates returned addresses against the requested category rather than treating any arbitrary string as a valid mailbox. If no appropriate address can be supplied, creation should fail rather than return a made-up address. Supply and destination-platform acceptance are separate questions: a real address can still be rejected by another service's policy.
OTPIXA is independent of Google and Microsoft. The names Gmail and Outlook identify address categories, not an endorsement, partnership or guarantee from those companies. Explain this distinction to your own users, especially if you are building a customer-facing tool. Do not advertise a temporary original mailbox as a permanent account for purchase or a safe replacement for a person's primary email.
Suitable workflows and unsafe assumptions
Temporary inboxes can support authorized onboarding tests, verification-email quality assurance and short-lived workflows where you are entitled to receive the message. For example, a team testing its own application may need to verify that a code arrives, that its email body is readable and that its software handles expiry correctly. A programmable inbox can reduce manual steps while making the test result auditable.
Avoid using temporary inboxes for primary account recovery, financial accounts, long-term subscriptions or anything that must remain accessible after the mailbox expires. Do not assume that an original address removes this limitation. A permanent user account should use a mailbox the user controls over time. The distinction is about lifetime and ownership, not whether an address visibly includes a plus sign.
The email API is a receiving workflow. It is not a documented outbound mail service, a bulk marketing sender, a SMTP relay or an official Gmail account-management API. It does not promise outgoing messages, inbox extensions, permanent storage or push webhooks. Design only around the endpoints actually available. If you need another capability, obtain confirmation before building a product that depends on it.
Five minutes means five minutes
Every allocated alias and original inbox lasts five minutes. The server-enforced expiry is authoritative. Polling, reading a message, refreshing the dashboard or replaying a creation request does not restart that lifetime. Your client should preserve the returned expiresAt value and stop attempting ordinary reads when the inbox has expired.
Create an inbox close to the moment it is needed. If your onboarding workflow spends several minutes asking a user unrelated questions before sending the verification email, allocating the address first wastes much of the available window. Move address creation near the message-trigger step, then begin a measured polling loop with a deadline before expiry.
When the window ends, the mailbox is unavailable. Creating a replacement inbox is a new allocation with its own address, identifier, cost and lifetime. An expired inbox is not automatically reactivated, and an already successful allocation is not refunded simply because its normal lifetime elapsed. Your software should explain expiry plainly instead of displaying an endless loading spinner that suggests messages can still arrive into an accessible inbox.
Website pricing and API pricing are different units
On the website, free aliases are offered without a deposit or engine activation. Paid original mailbox allocation has a stated default website price of $0.033 per successfully supplied mailbox and follows the website's balance and activation rules. That is useful context, but it is not the charging unit for the email REST API.
The email API has no subscription or activation fee. It uses a separate credits account. Creating a Gmail or Outlook alias costs 1 credit; creating a Gmail or Outlook original costs 3 credits. A successful inbox poll costs 3 credits, and a successful individual message read costs 3 credits. Account balance, usage and transaction reads are free. Funding the website wallet does not provide email API credits.
| API action | Endpoint | Cost |
|---|---|---|
| Create Gmail alias | POST /v1/inboxes | 1 credit |
| Create Outlook alias | POST /v1/inboxes | 1 credit |
| Create Gmail original | POST /v1/inboxes | 3 credits |
| Create Outlook original | POST /v1/inboxes | 3 credits |
| Poll active inbox | GET /v1/inboxes/{id}/messages | 3 credits |
| Read one message | GET /v1/messages/{id} | 3 credits |
| Balance, usage, transactions | GET /v1/account/* | 0 credits |
A successful empty poll still costs 3 credits. A successful cached poll also costs 3 credits. “No message found” is not the same outcome as “request failed.” This distinction is central to estimating costs. Read your application's polling policy before choosing a funding package; in many integrations, polling consumes more credits than creation.
Funding packages, bonuses and total credits
The minimum API deposit is $10. Each dollar buys 1,200 base email credits. The configured funding bonus applies to each confirmed deposit individually. It is not calculated from the sum of several unrelated deposits, and pending or failed payments do not increase the usable account balance.
| Deposit | Base credits | Bonus | Total credits |
|---|---|---|---|
| $10 | 12,000 | 0% | 12,000 |
| $50 | 60,000 | 10% | 66,000 |
| $100 | 120,000 | 15% | 138,000 |
| $250 | 300,000 | 20% | 360,000 |
| $500 | 600,000 | 25% | 750,000 |
| $1,000 | 1,200,000 | 30% | 1,560,000 |
For example, one $100 confirmed deposit provides 120,000 base credits and 18,000 bonus credits, giving 138,000 in total. Two $25 payments do not become a single $50 payment for the 10% tier. Your dashboard and transaction history should distinguish the base funding and bonus while reflecting their combined spendable balance.
Choose an available payment method from the email API dashboard and inspect its limits. The website includes crypto and local options, but a funding tier is not a guarantee that every gateway accepts that amount. For crypto, check the coin and network as carefully as the address. Do not interpret a checkout redirect as confirmation; wait until the verified payment flow credits the email product.
Estimate the whole workflow, not only creation
An alias workflow with one successful poll and one message read costs 7 credits: 1 for creation, 3 for polling and 3 for reading. An original workflow with those same steps costs 9 credits. Those totals are useful starting points, but most real workflows do not receive a message on the very first poll.
If an alias requires five successful polls before a message is found and you then read that message once, the total is 19 credits. The equivalent original workflow costs 21 credits. Additional reads of the same message are additional successful requests unless you intentionally replay a prior request using the same idempotency key. A cached server response is not automatically a free operation.
At the base conversion without bonuses, 1 credit represents one twelve-hundredth of a dollar of funded capacity. Three credits correspond to $0.0025 of base funding capacity; 7 correspond to about $0.00583 and 9 to $0.0075. These are arithmetic equivalents, not separate checkout prices or a promise about your average cost. Funding bonuses reduce the effective funded cost per credit, while repeated polling increases total credits used.
At $10, 12,000 credits theoretically cover 4,000 original creations alone. That does not mean 4,000 complete original-email verification workflows, because polls and reads also consume credits. If each completed original workflow used exactly 9 credits, the same balance would cover 1,333 whole workflows with 3 credits remaining. Actual capacity depends on supply, delivery timing and your application's request behavior.
Credentials and the actual API URL
Create a product-specific email key in the email API dashboard. Save it when displayed and keep it in your own server's secret configuration. Every endpoint uses Authorization: Bearer YOUR_KEY. A website session token is not an email API key, and a numbers API key cannot access email inbox endpoints.
The deployed base path is /api/public/v1 on the website host. Short endpoint names in the pricing table use /v1 for readability. When constructing real URLs, include the complete path. There is no requirement to use a separate API subdomain, and you should not assume one has been provisioned.
export OTPIXA_ORIGIN="https://otpixa.com"
# Set OTPIXA_EMAIL_KEY securely in your server environment.
curl "$OTPIXA_ORIGIN/api/public/v1/account/balance" \
-H "Authorization: Bearer $OTPIXA_EMAIL_KEY"Never put the key into the user's browser, a mobile app bundle, an address query parameter or a public repository. If your product has a frontend, call your own authenticated server and let that server talk to OTPIXA. Revoke and replace a key after exposure. Keep message contents and credentials out of normal request logs; troubleshooting usually needs an inbox ID and request ID, not a full private email body.
Create an alias or original inbox
Send POST /v1/inboxes with domain set to gmail or outlook and kind set to alias or original. The body describes the desired category, not a custom address you want to claim. Include a unique 8–120 character Idempotency-Key for the creation operation.
curl -X POST "$OTPIXA_ORIGIN/api/public/v1/inboxes" \
-H "Authorization: Bearer $OTPIXA_EMAIL_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: inbox-workflow-reference-001" \
-d '{"domain":"gmail","kind":"original"}'The creation result includes an inbox identifier, address, category, kind, status and expiry. Keep the exact returned address and ID together. The normal envelope also contains a request ID, cost and unit. The unit is credits for this product. Do not confuse the inbox ID with the request ID: one identifies the mailbox resource, while the other identifies a billed API operation.
Original allocations use available assigned inventory before automatic supply when applicable. This supply sequence does not change the documented 3-credit creation cost or five-minute lifetime. If original supply is disabled or an appropriate mailbox cannot be supplied, your client needs to handle the failure without inventing a replacement address. The reserved-charge flow is designed to refund a failed operation rather than charge for nonexistent allocation.
Poll messages without exhausting the balance
Call GET /v1/inboxes/{id}/messages using the allocated inbox ID. Only active inboxes belonging to the authenticated account and associated with API allocation are accessible through this flow. A website mailbox or another user's inbox is not an interchangeable API resource. Preserve this ownership boundary in your own application as well.
curl "$OTPIXA_ORIGIN/api/public/v1/inboxes/INBOX_UUID/messages" \
-H "Authorization: Bearer $OTPIXA_EMAIL_KEY"Respect the configured refresh interval, which defaults to 15 seconds, and the returned checkedAt information. The inbox service caches content between permitted refreshes. Calling faster may still return a successful cached response and consume 3 credits, without giving you fresher information. A disciplined client schedules its next check instead of immediately repeating an empty response.
Use a maximum number of polls and an expiry-aware deadline. Stop when the required message arrives, when the workflow is cancelled or when the inbox expires. If the provider is unavailable, back off instead of creating an aggressive retry storm. There are no documented outbound inbox webhooks in this version, so do not build a webhook-dependent workflow or assume a notification will replace polling.
Read a message and interpret its contents safely
Read an individual message with GET /v1/messages/{id}?inbox_id={inbox_id}. The query parameter identifies the owning inbox. Encode the message identifier as a URL segment rather than inserting arbitrary provider text directly into a path. Reading a message successfully costs 3 credits, separate from the poll that found it.
curl "$OTPIXA_ORIGIN/api/public/v1/messages/ENCODED_MESSAGE_ID?inbox_id=INBOX_UUID" \
-H "Authorization: Bearer $OTPIXA_EMAIL_KEY"Message data can include sender information, subject, text, sanitized HTML and detected verification content. A detected code is a convenience, not proof that the sender is genuine. Confirm the expected sender, context and workflow before using a code. Do not assume every string of digits in a message is the verification token your application needs.
Email HTML is untrusted content even when sanitized. If you display it, isolate it in a sandboxed iframe without script permission or same-origin permission. Do not inject it directly into your application's document. Treat external links cautiously and never execute instructions embedded in message text. Sender display names can be spoofed; a recognizable brand name alone does not authenticate an email.
Idempotency and billable GET requests
For inbox creation, generate and store an idempotency key before sending the request. Reuse exactly the same key, URL and JSON body only when retrying the same operation. A completed request can return its stored result without a second allocation. Reusing the key with different input produces a conflict rather than silently changing the earlier operation.
For GET requests, the server ordinarily creates a new operation identity when you do not send an idempotency key. That means repeated successful polls or reads are separately billable. You may explicitly use an idempotency key to replay a specific prior read, but the replay returns the stored result. It does not perform a fresh inbox check. Reusing one poll key forever therefore prevents you from observing newly arrived mail.
A 202 response means the operation is pending. Reconcile using the same operation identity, not a new paid creation. If an allocation was committed but a later step was interrupted, the recovery path is designed to find that existing resource rather than blindly charge again. If a request remains unresolved, contact support with its request ID. Do not tell a customer that an inbox was never created merely because your first HTTP response was lost.
Errors, refunds and operational visibility
Expect 400 for invalid input, 401 for missing or invalid authentication, 402 for insufficient email credits, 403 for an inactive account, 404 for an unavailable or expired resource, 409 for an idempotency conflict and 503 for service unavailability. Your client should make a different decision for each category rather than retry every failure identically.
A failed provider operation releases its reserved request charge through the billing flow. A successful empty poll remains billable. A successful allocation that later expires is not a failed allocation. Those three cases should appear differently in your accounting and customer messages. When a response is pending, reconcile the operation before assuming a refund has happened.
The free account endpoints expose balance, usage and transaction history for the email product. Current history reads are limited to the latest 100 records. Maintain your own minimal operational history when you need longer retention, but do not unnecessarily copy sensitive message bodies. Track inbox IDs, request IDs, charged credits, response codes and timing so you can investigate cost or delivery problems without leaking email content.
Production checks and next steps
Before relying on the integration, create one authorized alias and one original, confirm that each address matches the requested category and verify the returned five-minute expiry. Send an email from a system you control, poll it, read its message and reconcile the costs. Repeat a creation with its original idempotency key and confirm that it does not allocate or charge twice. Also test expired inbox reads, revoked credentials and isolation from the numbers API wallet.
Funding needs its own verification. Creating an unpaid invoice does not prove that settlement or the deposit bonus works. Confirm an approved real or gateway-test payment and inspect the email credits ledger afterward. If the live API reports service unavailability during key validation, allocation cannot be declared production-ready. Resolve the connection first and then repeat the full inbox lifecycle.
Use the email API dashboard for keys, funding and recent usage, and the email endpoint reference for the compact request contract. Visit the Email Generator for the separate website experience. For workflows needing temporary receiving numbers as well, read the numbers REST API guide. Start with one complete, measurable workflow and expand only after the real results and billing records agree.