API v1
SDKs and examples
Integration examples in JavaScript, Python, PHP, and Go.
SDKs and examples
Elegovate Notify does not ship an official SDK yet. These samples cover POST /api/v1/send/ with the required headers.
Recommended environment variables
NOTIFY_API_KEY=evn_your_secret
NOTIFY_ORG_ID=1
NOTIFY_API_URL=https://api.notify.elegovate.com/api/v1JavaScript (fetch)
const response = await fetch(`${process.env.NOTIFY_API_URL}/send/`, {
method: "POST",
headers: {
Authorization: `Api-Key ${process.env.NOTIFY_API_KEY}`,
"X-Organization-ID": process.env.NOTIFY_ORG_ID,
"Content-Type": "application/json",
},
body: JSON.stringify({
template: "welcome",
to: "customer@example.com",
channel: "email",
data: { name: "Maria" },
}),
});
const body = await response.json();Node.js (axios)
import axios from "axios";
const { data, status } = await axios.post(
`${process.env.NOTIFY_API_URL}/send/`,
{
template: "welcome",
to: "customer@example.com",
channel: "email",
data: { name: "Maria" },
},
{
headers: {
Authorization: `Api-Key ${process.env.NOTIFY_API_KEY}`,
"X-Organization-ID": process.env.NOTIFY_ORG_ID,
},
},
);Python (requests)
import os
import requests
response = requests.post(
f"{os.environ['NOTIFY_API_URL']}/send/",
headers={
"Authorization": f"Api-Key {os.environ['NOTIFY_API_KEY']}",
"X-Organization-ID": os.environ["NOTIFY_ORG_ID"],
"Content-Type": "application/json",
},
json={
"template": "welcome",
"to": "customer@example.com",
"channel": "email",
"data": {"name": "Maria"},
},
timeout=30,
)
response.raise_for_status()PHP (Guzzle)
$client = new \GuzzleHttp\Client();
$response = $client->post(getenv('NOTIFY_API_URL') . '/send/', [
'headers' => [
'Authorization' => 'Api-Key ' . getenv('NOTIFY_API_KEY'),
'X-Organization-ID' => getenv('NOTIFY_ORG_ID'),
'Content-Type' => 'application/json',
],
'json' => [
'template' => 'welcome',
'to' => 'customer@example.com',
'channel' => 'email',
'data' => ['name' => 'Maria'],
],
]);Go (net/http)
payload := map[string]any{
"template": "welcome",
"to": "customer@example.com",
"channel": "email",
"data": map[string]string{"name": "Maria"},
}
body, _ := json.Marshal(payload)
req, _ := http.NewRequest(http.MethodPost, os.Getenv("NOTIFY_API_URL")+"/send/", bytes.NewReader(body))
req.Header.Set("Authorization", "Api-Key "+os.Getenv("NOTIFY_API_KEY"))
req.Header.Set("X-Organization-ID", os.Getenv("NOTIFY_ORG_ID"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)Idempotency
Send an Idempotency-Key header with a UUID. Repeating the same request within ~24 h returns the same response with idempotent_replay: true.
Next step
Review error codes and try endpoints in the API reference.