{"id":"email.send","module":"comm-email","namespace":"email","action":"send","method":"POST","path":"/v1/email/send","idempotent":true,"available":true,"vendors":["resend","ses","tencent"],"vendors_ready":["resend"],"vendors_pending":["ses","tencent"],"key_status":"live","default_vendor":"resend","self_hosted":false,"minimum_tier":"standard","supported_message_classes":["transactional"],"regions":["western","china"],"dynamic_params":{"vendor":["resend"]},"models_tracked":false,"sdk_hint":"Regular parameters + types are stable — read them from the typed SDK signature / API reference for this capability. discovery only carries the runtime-dynamic values above (available, vendors, dynamic_params).","params":{"title":"EmailSendRequest","type":"object","required":["to"],"additionalProperties":false,"properties":{"to":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Recipient address, or an array of addresses for multiple recipients."},"cc":{"type":"array","items":{"type":"string"},"description":"Carbon copy recipients"},"bcc":{"type":"array","items":{"type":"string"},"description":"Blind carbon copy recipients"},"from":{"type":["string","null"],"description":"Optional. Omit to use Infrai's default sender on send.infrai.cc. If you provide a custom-domain sender, that domain must be verified first."},"from_display_name":{"type":["string","null"],"description":"Display name for the sender"},"reply_to":{"type":["string","null"],"description":"Reply-to email address"},"subject":{"type":["string","null"],"description":"Email subject line"},"body":{"type":["string","null"],"description":"Plain text body."},"html":{"type":["string","null"],"description":"HTML body of the email"},"template_id":{"type":["string","null"],"description":"Identifier of the template used for rendering"},"template_vars":{"type":["object","null"],"description":"Variables to substitute in the template"},"attachments":{"type":"array","items":{"type":"object"},"description":"List of email attachments"},"headers":{"type":["object","null"],"description":"Custom HTTP headers to include in requests or responses"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags for categorization and filtering"},"track_opens":{"type":"boolean","default":false,"description":"Whether to track email opens"},"track_clicks":{"type":"boolean","default":false,"description":"Whether to track link clicks in the email"},"scheduled_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601 timestamp when the resource is scheduled to activate"},"idempotency_key":{"type":["string","null"],"description":"Client-provided idempotency key; prevents duplicate execution on retry"},"vendor":{"type":["string","null"],"description":"Pin to a specific vendor.","enum":["resend","ses","tencent"]},"message_class":{"enum":["transactional","marketing"],"default":"transactional","description":"Semantic class of the message. Only transactional is currently live; marketing is reserved and fails closed."},"auto_unsubscribe_link":{"type":["boolean","null"],"description":"Whether to append a signed unsubscribe link. Transactional messages omit it by default; marketing-like content may still be forced to include it."}}},"response":{"title":"EmailSendResult","type":"object","required":["message_id","mode","from_used","accepted_recipients"],"additionalProperties":false,"properties":{"message_id":{"type":"string","pattern":"^msg_[A-Za-z0-9]{20,}$","description":"Unique identifier for this message"},"vendor_message_id":{"type":["string","null"],"description":"Message identifier assigned by the upstream vendor"},"from_used":{"type":"string","description":"Sender email address that was actually used for delivery"},"mode":{"enum":["default_vendor","verified_domain"],"description":"Delivery mode or operation mode"},"scheduled_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601 timestamp when the resource is scheduled to activate"},"accepted_recipients":{"type":"array","items":{"type":"string"},"description":"List of recipient email addresses that were accepted"},"suppressed_recipients":{"type":"array","items":{"type":"string"},"description":"List of recipient email addresses that were suppressed"},"metadata":{"type":["object","null"],"description":"Cost/vendor disclosure for this send (cost-transparency contract surface). A superset of kernel ResultMetadata that also carries the email-specific `mode` field; present once a vendor route has been resolved (absent only if all recipients were pre-suppressed before delivery was attempted... still normally present with cost_usd=0 in that case).","additionalProperties":false,"required":["request_id","timestamp","latency_ms","entry_form"],"properties":{"request_id":{"type":"string","description":"UUID v7."},"trace_id":{"type":"string","description":"Distributed tracing identifier"},"timestamp":{"type":"string","format":"date-time","description":"Unix timestamp of the data point"},"latency_ms":{"type":"integer","minimum":0,"description":"Latency of the operation in milliseconds"},"entry_form":{"description":"Entry point format (rest, mcp, sdk)"},"cost_usd":{"type":"number","minimum":0,"description":"Cost of this operation in USD"},"cost_cny":{"type":"number","minimum":0,"description":"Cost in CNY for this request"},"vendor":{"type":"string","description":"Adapter name; references VendorRegistry."},"vendor_region":{"enum":["china","western"],"description":"Vendor region where the request was processed"},"markup_pct":{"type":"number","description":"Markup percentage applied on top of vendor cost"},"mode":{"enum":["default_vendor","verified_domain"],"description":"Email delivery mode this send resolved to (email-specific field not present on the generic kernel ResultMetadata)."}}}}},"errors":["ACCOUNT_AUTORECHARGE_LIMIT","ACCOUNT_FROZEN","AUTH_RATE_LIMIT","AUTH_REFRESH_TOO_FREQUENT","DOMAIN_NOT_VERIFIED","EMAIL_ALREADY_HAS_ACCOUNT","EMAIL_BATCH_TOO_LARGE","EMAIL_CONFIRMATION_REQUIRED","EMAIL_EXPIRED","EMAIL_INVALID_RETENTION","EMAIL_INVALID_STATE","EMAIL_NOT_CONFIGURED","EMAIL_NOT_FOUND","EMAIL_PRO_REQUIRED","EMAIL_REPUTATION_SUSPENDED","EMAIL_SEND_FAILED","IDEMPOTENCY_KEY_CONFLICT","INSUFFICIENT_CREDIT","INTERNAL_ERROR","INVALID_ARGUMENT","INVALID_RECIPIENT","KEY_REVOKED","MAINTENANCE","NETWORK_ERROR","RATE_LIMIT_ACCOUNT","RATE_LIMIT_USER","RATE_LIMIT_VENDOR","SCOPE_INSUFFICIENT","SUPPRESSED_RECIPIENT","TEMPLATE_VAR_MISSING","TOO_MANY_RECIPIENTS","UNAUTHORIZED","VENDOR_AUTH_ERROR","VENDOR_DOWN","VENDOR_TIMEOUT","WALLET_EXPIRED"],"examples":{"curl":"curl -X POST https://api.infrai.cc/v1/email/send \\\n  -H \"Authorization: Bearer $INFRAI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"to\": \"sample\"}'","python":"# Zero-install REST call — no SDK required (short-term the API is REST-only).\nimport os, requests\n\nresp = requests.post(\n    \"https://api.infrai.cc/v1/email/send\",\n    headers={\n        \"Authorization\": f\"Bearer {os.environ['INFRAI_API_KEY']}\",\n    },\n    json={'to': 'sample'},\n)\nresp.raise_for_status()\nprint(resp.json())","javascript":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\nconst resp = await fetch(\n  \"https://api.infrai.cc/v1/email/send\",\n  {\n    method: \"POST\",\n    headers: {\n      \"Authorization\": `Bearer ${process.env.INFRAI_API_KEY}`,\n      \"Content-Type\": \"application/json\",\n    },\n    body: JSON.stringify({\"to\": \"sample\"}),\n  },\n);\nconsole.log(await resp.json());","typescript":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\nconst resp = await fetch(\n  \"https://api.infrai.cc/v1/email/send\",\n  {\n    method: \"POST\",\n    headers: {\n      \"Authorization\": `Bearer ${process.env.INFRAI_API_KEY}`,\n      \"Content-Type\": \"application/json\",\n    },\n    body: JSON.stringify({\"to\": \"sample\"}),\n  },\n);\nif (!resp.ok) throw new Error(`infrai ${resp.status}`);\nconst data: unknown = await resp.json();\nconsole.log(data);","go":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tbody := []byte(`{\"to\": \"sample\"}`)\n\treq, _ := http.NewRequest(\"POST\", \"https://api.infrai.cc/v1/email/send\", bytes.NewReader(body))\n\treq.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"INFRAI_API_KEY\"))\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\tresp, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\tfmt.Println(resp.Status)\n}","java":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\nimport java.net.URI;\nimport java.net.http.*;\n\nHttpRequest req = HttpRequest.newBuilder()\n    .uri(URI.create(\"https://api.infrai.cc/v1/email/send\"))\n    .header(\"Authorization\", \"Bearer \" + System.getenv(\"INFRAI_API_KEY\"))\n    .header(\"Content-Type\", \"application/json\")\n    .method(\"POST\", HttpRequest.BodyPublishers.ofString(\"{\\\"to\\\": \\\"sample\\\"}\"))\n    .build();\nHttpResponse<String> resp = HttpClient.newHttpClient()\n    .send(req, HttpResponse.BodyHandlers.ofString());\nSystem.out.println(resp.body());","csharp":"// Zero-install REST call — no SDK required (short-term the API is REST-only).\nusing System;\nusing System.Net.Http;\n\nvar client = new HttpClient();\nvar req = new HttpRequestMessage(new HttpMethod(\"POST\"), \"https://api.infrai.cc/v1/email/send\");\nvar key = Environment.GetEnvironmentVariable(\"INFRAI_API_KEY\");\nreq.Headers.Add(\"Authorization\", \"Bearer \" + key);\nreq.Content = new StringContent(\"{\\\"to\\\": \\\"sample\\\"}\", System.Text.Encoding.UTF8, \"application/json\");\nvar resp = await client.SendAsync(req);\nConsole.WriteLine(await resp.Content.ReadAsStringAsync());","php":"<?php\n// Zero-install REST call — no SDK required (short-term the API is REST-only).\n$ch = curl_init(\"https://api.infrai.cc/v1/email/send\");\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [\n    \"Authorization: Bearer \" . getenv(\"INFRAI_API_KEY\"),\n    \"Content-Type: application/json\",\n]);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, \"{\\\"to\\\": \\\"sample\\\"}\");\n$response = curl_exec($ch);\ncurl_close($ch);\necho $response;","ruby":"# Zero-install REST call — no SDK required (short-term the API is REST-only).\nrequire \"net/http\"\nrequire \"uri\"\n\nuri = URI(\"https://api.infrai.cc/v1/email/send\")\nhttp = Net::HTTP.new(uri.host, uri.port)\nhttp.use_ssl = true\nreq = Net::HTTP::Post.new(uri)\nreq[\"Authorization\"] = \"Bearer #{ENV['INFRAI_API_KEY']}\"\nreq[\"Content-Type\"] = \"application/json\"\nreq.body = '{\"to\": \"sample\"}'\nres = http.request(req)\nputs res.body","rust":"// Zero-install REST call — no SDK required (short-term the API is REST-only). (uses the reqwest + tokio crates)\nuse std::env;\n\n#[tokio::main]\nasync fn main() -> Result<(), Box<dyn std::error::Error>> {\n    let resp = reqwest::Client::new()\n        .post(\"https://api.infrai.cc/v1/email/send\")\n        .header(\"Authorization\", format!(\"Bearer {}\", env::var(\"INFRAI_API_KEY\")?))\n        .header(\"Content-Type\", \"application/json\")\n        .body(r#\"{\"to\": \"sample\"}\"#)\n        .send()\n        .await?;\n    println!(\"{}\", resp.text().await?);\n    Ok(())\n}","request":{"to":"sample"}},"billing":{"is_billable":true,"free":false,"billing_class":"service_markup","unit":"per_email","price_usd":0.00046,"currency":"USD","approximate":true,"new_account_trial_uses":4347,"note":"default vendor resend: $0.00046 per_email; other vendor prices may differ","price_vendor":"resend"}}