{
    "schemes": [],
    "swagger": "2.0",
    "info": {
        "description": "REST API for creating temporary mailboxes, listing domains, and reading messages.",
        "title": "Temp Mailbox API",
        "contact": {},
        "version": "1.0"
    },
    "host": "localhost:3000",
    "basePath": "/v1",
    "paths": {
        "/domains": {
            "get": {
                "security": [
                    {
                        "RapidAPIProxySecret": [],
                        "RapidAPIUser": []
                    }
                ],
                "description": "List domains that can be used when creating a mailbox.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "domains"
                ],
                "summary": "List domains",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/handlers.DomainResponse"
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/mailboxes": {
            "get": {
                "security": [
                    {
                        "RapidAPIProxySecret": [],
                        "RapidAPIUser": []
                    }
                ],
                "description": "List temporary mailboxes for the authenticated user.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "mailboxes"
                ],
                "summary": "List mailboxes",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/handlers.MailboxResponse"
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "RapidAPIProxySecret": [],
                        "RapidAPIUser": []
                    }
                ],
                "description": "Create a new temporary mailbox. When name or domain are omitted, a random username and/or domain are chosen.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "mailboxes"
                ],
                "summary": "Create mailbox",
                "parameters": [
                    {
                        "description": "Mailbox to create",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/schema.CreateMailbox"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/handlers.MailboxResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "409": {
                        "description": "Conflict",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "422": {
                        "description": "Unprocessable Entity",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/mailboxes/{id}": {
            "get": {
                "security": [
                    {
                        "RapidAPIProxySecret": [],
                        "RapidAPIUser": []
                    }
                ],
                "description": "Get a mailbox by ID for the authenticated user.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "mailboxes"
                ],
                "summary": "Get mailbox",
                "parameters": [
                    {
                        "type": "string",
                        "format": "uuid",
                        "description": "Mailbox ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MailboxResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "422": {
                        "description": "Unprocessable Entity",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "RapidAPIProxySecret": [],
                        "RapidAPIUser": []
                    }
                ],
                "description": "Delete a mailbox and its messages for the authenticated user.",
                "tags": [
                    "mailboxes"
                ],
                "summary": "Delete mailbox",
                "parameters": [
                    {
                        "type": "string",
                        "format": "uuid",
                        "description": "Mailbox ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "422": {
                        "description": "Unprocessable Entity",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/mailboxes/{id}/messages": {
            "get": {
                "security": [
                    {
                        "RapidAPIProxySecret": [],
                        "RapidAPIUser": []
                    }
                ],
                "description": "List messages received by a mailbox.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "List messages",
                "parameters": [
                    {
                        "type": "string",
                        "format": "uuid",
                        "description": "Mailbox ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/handlers.MessageResponse"
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "422": {
                        "description": "Unprocessable Entity",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/mailboxes/{id}/messages/{messageID}": {
            "get": {
                "security": [
                    {
                        "RapidAPIProxySecret": [],
                        "RapidAPIUser": []
                    }
                ],
                "description": "Preview a message from a mailbox by ID. Marks the message as read.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Get message",
                "parameters": [
                    {
                        "type": "string",
                        "format": "uuid",
                        "description": "Mailbox ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "format": "uuid",
                        "description": "Message ID",
                        "name": "messageID",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MessageResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "422": {
                        "description": "Unprocessable Entity",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "RapidAPIProxySecret": [],
                        "RapidAPIUser": []
                    }
                ],
                "description": "Delete a message from a mailbox by ID.",
                "tags": [
                    "messages"
                ],
                "summary": "Delete message",
                "parameters": [
                    {
                        "type": "string",
                        "format": "uuid",
                        "description": "Mailbox ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "format": "uuid",
                        "description": "Message ID",
                        "name": "messageID",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "422": {
                        "description": "Unprocessable Entity",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/mailboxes/{id}/messages/{messageID}/forward": {
            "post": {
                "security": [
                    {
                        "RapidAPIProxySecret": [],
                        "RapidAPIUser": []
                    }
                ],
                "description": "Forward a mailbox message to an external email address via SMTP.",
                "consumes": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Forward message",
                "parameters": [
                    {
                        "type": "string",
                        "format": "uuid",
                        "description": "Mailbox ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "format": "uuid",
                        "description": "Message ID",
                        "name": "messageID",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Forward destination",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/schema.ForwardMessage"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No Content"
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "422": {
                        "description": "Unprocessable Entity",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    },
                    "502": {
                        "description": "Bad Gateway",
                        "schema": {
                            "$ref": "#/definitions/httpx.ErrorResponse"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "handlers.DomainResponse": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "format": "uuid",
                    "example": "550e8400-e29b-41d4-a716-446655440000"
                },
                "name": {
                    "type": "string",
                    "example": "example.com"
                }
            }
        },
        "handlers.MailboxResponse": {
            "type": "object",
            "properties": {
                "created_at": {
                    "type": "string",
                    "example": "2026-06-11T12:00:00Z"
                },
                "domain": {
                    "$ref": "#/definitions/handlers.DomainResponse"
                },
                "email": {
                    "type": "string",
                    "example": "inbox@example.com"
                },
                "expires_at": {
                    "type": "string",
                    "example": "2026-06-12T12:00:00Z"
                },
                "id": {
                    "type": "string",
                    "format": "uuid",
                    "example": "550e8400-e29b-41d4-a716-446655440000"
                },
                "name": {
                    "type": "string",
                    "example": "inbox"
                }
            }
        },
        "handlers.MessageResponse": {
            "type": "object",
            "properties": {
                "body": {
                    "type": "string",
                    "example": "Hello from temp mailbox."
                },
                "created_at": {
                    "type": "string",
                    "example": "2026-06-11T12:05:00Z"
                },
                "from": {
                    "type": "string",
                    "example": "sender@example.org"
                },
                "html": {
                    "type": "string",
                    "example": "\u003cp\u003eHello from temp mailbox.\u003c/p\u003e"
                },
                "id": {
                    "type": "string",
                    "format": "uuid",
                    "example": "550e8400-e29b-41d4-a716-446655440000"
                },
                "mailbox_id": {
                    "type": "string",
                    "format": "uuid",
                    "example": "660e8400-e29b-41d4-a716-446655440001"
                },
                "subject": {
                    "type": "string",
                    "example": "Welcome"
                },
                "text": {
                    "type": "string",
                    "example": "Hello from temp mailbox."
                },
                "unread": {
                    "type": "boolean",
                    "example": true
                }
            }
        },
        "httpx.ErrorResponse": {
            "type": "object",
            "properties": {
                "details": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    },
                    "example": {
                        "name": "the name field is required"
                    }
                },
                "error": {
                    "type": "string",
                    "example": "validation failed"
                }
            }
        },
        "schema.CreateMailbox": {
            "type": "object",
            "properties": {
                "domain": {
                    "type": "string",
                    "example": "example.com"
                },
                "lifespan": {
                    "type": "integer",
                    "example": 3600
                },
                "name": {
                    "type": "string",
                    "example": "mybox"
                }
            }
        },
        "schema.ForwardMessage": {
            "type": "object",
            "properties": {
                "to": {
                    "type": "string",
                    "example": "user@gmail.com"
                }
            }
        }
    },
    "securityDefinitions": {
        "RapidAPIProxySecret": {
            "type": "apiKey",
            "name": "X-Rapidapi-Proxy-Secret",
            "in": "header"
        },
        "RapidAPIUser": {
            "type": "apiKey",
            "name": "X-Rapidapi-User",
            "in": "header"
        }
    }
}