{
  "info": {
    "name": "Mailcore Email API",
    "description": "Controlled-pilot transactional API. Production sending is disabled at this documentation release; these artifacts do not activate it. Obtain separate production activation, approval, an active verified sender and a key through the operator before sending. No customer sandbox or public provisioning endpoints exist. Set apiKey in a private local environment; do not export its secret. Example .example addresses must be replaced. Save idempotencyKey with your application event, then reuse the unchanged request/key if an HTTP result is uncertain. Do not use a new key to resend an ambiguous message. Collection runs may send real mail once configured; requests are never run automatically.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {"type": "bearer", "bearer": [{"key": "token", "value": "{{apiKey}}", "type": "string"}]},
  "variable": [
    {"key": "baseUrl", "value": "https://mailcore.uz", "type": "string"},
    {"key": "apiKey", "value": "", "type": "string"},
    {"key": "sender", "value": "Example Shop <orders@notify.example>", "type": "string"},
    {"key": "recipient", "value": "customer@recipient.example", "type": "string"},
    {"key": "idempotencyKey", "value": "order-8421-completed", "type": "string"},
    {"key": "emailId", "value": "eml_0123456789abcdef01234567", "type": "string"}
  ],
  "item": [
    {"name": "Health", "request": {"auth": {"type": "noauth"}, "method": "GET", "url": {"raw": "{{baseUrl}}/api/email/v1/healthz", "host": ["{{baseUrl}}"], "path": ["api", "email", "v1", "healthz"]}, "description": "Unauthenticated minimal database check; healthy does not imply sending enabled."}, "response": []},
    {"name": "Queue one email", "event": [{"listen": "prerequest", "script": {"type": "text/javascript", "exec": ["if (!pm.variables.get('apiKey')) throw new Error('Set apiKey in a private environment before sending.');", "if (!/^[A-Za-z0-9._:-]{16,128}$/.test(pm.variables.get('idempotencyKey') || '')) throw new Error('Persist a valid idempotencyKey with this application event.');"]}}], "request": {"method": "POST", "header": [{"key": "Content-Type", "value": "application/json"}, {"key": "Idempotency-Key", "value": "{{idempotencyKey}}"}], "body": {"mode": "raw", "raw": "{\n  \"from\": \"{{sender}}\",\n  \"to\": \"{{recipient}}\",\n  \"subject\": \"Order #8421 completed\",\n  \"text\": \"Your order has been completed.\",\n  \"tags\": {\"order_id\": \"8421\"}\n}", "options": {"raw": {"language": "json"}}}, "url": {"raw": "{{baseUrl}}/api/email/v1/emails", "host": ["{{baseUrl}}"], "path": ["api", "email", "v1", "emails"]}, "description": "202 means queued. Copy the returned id into emailId for the status request. Replaying this identical event/key returns its original response; do not regenerate the key on retries."}, "response": []},
    {"name": "Read email state", "request": {"method": "GET", "url": {"raw": "{{baseUrl}}/api/email/v1/emails/{{emailId}}", "host": ["{{baseUrl}}"], "path": ["api", "email", "v1", "emails", "{{emailId}}"]}, "description": "Project-scoped state. accepted is provider handoff, delivered is a delivery event, ambiguous must not be blindly resent. Recipient/body are omitted."}, "response": []}
  ]
}
