{"openapi":"3.1.0","info":{"title":"Вам письмо.рф Email API","version":"1.0.0","description":"HTTP API для отправки писем через JSON. Подходит для backend-сервисов, curl, automation и AI-агентов."},"servers":[{"url":"https://xn----7sbf0ascoft4i.xn--p1ai","description":"Production"}],"paths":{"/api/messages/send":{"post":{"summary":"Отправить письмо","description":"Принимает JSON с данными письма и возвращает структурированный ответ для разработчиков и AI-агентов. Без API key доступно до 3 бесплатных писем с одного IP. После этого для отправки нужен заголовок key.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"200":{"description":"Письмо отправлено","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageSuccess"}}}},"400":{"description":"Некорректный запрос","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Проблема с API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Временная ошибка отправки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"key"}},"schemas":{"SendMessageRequest":{"type":"object","required":["from","to","subject","text"],"properties":{"from":{"type":"string","description":"Имя отправителя","example":"ООО Север"},"to":{"type":"array","items":{"type":"string","format":"email"},"description":"Список получателей","example":["you@example.com"]},"subject":{"type":"string","example":"Тест API"},"text":{"type":"string","example":"Письмо отправлено через API"},"html":{"type":"string","example":"<div><strong>Письмо отправлено через API</strong></div>"}}},"SendMessageSuccess":{"type":"object","properties":{"ok":{"type":"boolean","example":true},"code":{"type":"string","example":"sent"},"message":{"type":"string","example":"Письмо отправлено."},"remainingAttempts":{"type":["integer","null"],"example":2},"data":{"type":"object","properties":{"messageId":{"type":"string","example":"<message-id>"},"accepted":{"type":"array","items":{"type":"string","format":"email"}},"rejected":{"type":"array","items":{"type":"string"}},"from":{"type":"string"},"to":{"type":"array","items":{"type":"string","format":"email"}},"subject":{"type":"string"}}}}},"ErrorResponse":{"type":"object","properties":{"ok":{"type":"boolean","example":false},"code":{"type":"string","examples":["invalid_api_key","invalid_request","smtp_unavailable","free_limit_reached"]},"message":{"type":"string"}}}}}}