API Documentation

Build powerful email testing workflows with our RESTful API. Available for DevQA, ProPlus, and Enterprise plans.

Get API Token

Authentication

All API requests require a Bearer token in the Authorization header:

Authorization: Bearer YOUR_API_TOKEN
Generate API tokens from your Dashboard. Rate limit: 10,000 requests/day.

Base URL

https://rapidinbox.app/api/v1

Inboxes

GET /inboxes

List all inboxes for your account.

Request
curl -X GET https://rapidinbox.app/api/v1/inboxes \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "inboxes": [
    {
      "localpart": "test-user",
      "domain": "rapidinbox.app",
      "email": "test-user@rapidinbox.app",
      "created_at": "2024-01-15T10:30:00Z",
      "has_pin": false
    }
  ],
  "count": 1
}

POST /inboxes

Create a new inbox. Localpart is optional (random if omitted).

Request
curl -X POST https://rapidinbox.app/api/v1/inboxes \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"localpart": "my-test-inbox"}'
Response (201 Created)
{
  "localpart": "my-test-inbox",
  "domain": "rapidinbox.app",
  "email": "my-test-inbox@rapidinbox.app",
  "created_at": "2024-01-15T10:35:00Z"
}
Parameters
Field Type Required Description
localpart string No Inbox name (3-64 chars, a-z0-9.-_)
mailDomainId integer No Domain ID (default: rapidinbox.app)

DELETE /inboxes/{localpart}

Delete an inbox and all its messages.

curl -X DELETE https://rapidinbox.app/api/v1/inboxes/my-test-inbox \
  -H "Authorization: Bearer YOUR_TOKEN"

Messages

GET /inboxes/{localpart}/messages

List all messages in an inbox.

curl -X GET https://rapidinbox.app/api/v1/inboxes/my-inbox/messages \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "messages": [
    {
      "id": "abc123",
      "from": "sender@example.com",
      "subject": "Welcome!",
      "date": "2024-01-15T10:40:00Z",
      "has_html": true,
      "attachments_count": 0
    }
  ],
  "count": 1
}

GET /inboxes/{localpart}/messages/{id}

Get full message details including body content.

curl -X GET https://rapidinbox.app/api/v1/inboxes/my-inbox/messages/abc123 \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "id": "abc123",
  "from": "sender@example.com",
  "subject": "Welcome!",
  "text": "Hello, welcome to our service!",
  "html": "<html>...</html>",
  "date": "2024-01-15T10:40:00Z",
  "attachments_count": 0
}

Account

GET /account

Get account information.

Response
{
  "id": 42,
  "email": "developer@example.com",
  "plan": "DevQA",
  "subscription_status": "Active",
  "created_at": "2024-01-01T00:00:00Z"
}

GET /account/usage

Get current usage and plan limits.

Response
{
  "plan": "DevQA",
  "usage": {
    "inboxes": { "current": 5, "max": 50 },
    "domains": { "current": 1, "max": 3 },
    "tokens": { "current": 2, "max": 10 },
    "emails": 127
  },
  "limits": {
    "retention_hours": 168,
    "max_attachment_mb": 10,
    "custom_domains": true,
    "custom_inbox": true
  }
}

Error Codes

Code Description
401 Unauthorized - Invalid or missing API token
403 Forbidden - Insufficient plan or limit reached
404 Not Found - Resource doesn't exist
409 Conflict - Resource already exists
429 Too Many Requests - Rate limit exceeded

Code Examples

const API_TOKEN = 'your_api_token';
const BASE_URL = 'https://rapidinbox.app/api/v1';

// Create inbox and wait for email
async function waitForEmail(localpart) {
  // Create inbox
  await fetch(`${BASE_URL}/inboxes`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_TOKEN}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ localpart })
  });

  // Poll for messages
  while (true) {
    const res = await fetch(`${BASE_URL}/inboxes/${localpart}/messages`, {
      headers: { 'Authorization': `Bearer ${API_TOKEN}` }
    });
    const data = await res.json();
    if (data.count > 0) return data.messages[0];
    await new Promise(r => setTimeout(r, 1000));
  }
}