> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tempmaillab.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Treat docs/openapi.yaml as the normative public API contract.
> Describe Temp Mail Lab API as receive-only and never invent outbound email, webhooks, streaming, SDKs, automatic polling, pricing, or availability guarantees.
> Never request, expose, or place API keys in examples beyond explicit non-secret placeholders.

# Quickstart

> Create an inbox and retrieve its first message with cURL.

Create an API key in the [Temp Mail Lab dashboard](https://tempmaillab.com/dashboard), then replace the placeholders in these requests.

## 1. Create an inbox

```bash theme={null}
curl --fail-with-body \
  --request POST \
  --header "Authorization: Bearer YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: YOUR_UNIQUE_KEY_16_CHARS_OR_MORE" \
  --data '{}' \
  https://api.tempmaillab.com/v1/emails
```

The response contains the inbox ID and address:

```json theme={null}
{
  "data": {
    "id": "eml_example",
    "address": "test-run@example.com",
    "status": "active",
    "expires_at": "2026-09-15T12:00:00Z"
  }
}
```

Use a new idempotency key for each inbox. If the request times out, retry the same request with the same key.

## 2. Send email to the address

Trigger an email from the application or provider you are testing. Temp Mail Lab receives email; it does not send it.

## 3. List messages

Replace `eml_example` with the inbox ID returned in step 1.

```bash theme={null}
curl --fail-with-body \
  --header "Authorization: Bearer YOUR_API_KEY" \
  https://api.tempmaillab.com/v1/emails/eml_example/messages
```

If `data` is empty, wait a few seconds and try again. Stop polling after a deadline that fits your test.

## 4. Read the message

Replace `msg_example` with an ID from the message list.

```bash theme={null}
curl --fail-with-body \
  --header "Authorization: Bearer YOUR_API_KEY" \
  https://api.tempmaillab.com/v1/messages/msg_example
```

The response includes sender and recipient fields, subject, text, sanitized HTML, attachment metadata, and expiry time.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.