curl --request POST \
--url 'https://demo.notifuse.com/subscribe' \
--header 'Content-Type: application/json' \
--data '{
"workspace_id": "ws_1234567890",
"contact": {
"email": "user@example.com",
"email_hmac": "a1b2c3d4e5f6...",
"external_id": "user_12345",
"timezone": "America/New_York",
"language": "en-US",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"phone": "+15551234567",
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"country": "US",
"postcode": "10001",
"state": "NY",
"job_title": "Software Engineer",
"tracking_opens_consent": "granted",
"tracking_clicks_consent": "granted",
"custom_string_1": "Premium tier",
"custom_string_2": "<string>",
"custom_string_3": "<string>",
"custom_string_4": "<string>",
"custom_string_5": "<string>",
"custom_number_1": 42,
"custom_number_2": 123.45,
"custom_number_3": 123.45,
"custom_number_4": 123.45,
"custom_number_5": 123.45,
"custom_datetime_1": "2023-06-01T09:00:00Z",
"custom_datetime_2": "2026-01-15T09:30:00Z",
"custom_datetime_3": "2026-01-15T09:30:00Z",
"custom_datetime_4": "2026-01-15T09:30:00Z",
"custom_datetime_5": "2026-01-15T09:30:00Z",
"custom_json_1": {
"preferences": {
"theme": "dark",
"notifications": true
}
},
"custom_json_2": {},
"custom_json_3": {},
"custom_json_4": {},
"custom_json_5": {}
},
"list_ids": [
"newsletter",
"product_updates"
]
}'
const response = await fetch('https://demo.notifuse.com/subscribe', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"workspace_id": "ws_1234567890",
"contact": {
"email": "user@example.com",
"email_hmac": "a1b2c3d4e5f6...",
"external_id": "user_12345",
"timezone": "America/New_York",
"language": "en-US",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"phone": "+15551234567",
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"country": "US",
"postcode": "10001",
"state": "NY",
"job_title": "Software Engineer",
"tracking_opens_consent": "granted",
"tracking_clicks_consent": "granted",
"custom_string_1": "Premium tier",
"custom_string_2": "<string>",
"custom_string_3": "<string>",
"custom_string_4": "<string>",
"custom_string_5": "<string>",
"custom_number_1": 42,
"custom_number_2": 123.45,
"custom_number_3": 123.45,
"custom_number_4": 123.45,
"custom_number_5": 123.45,
"custom_datetime_1": "2023-06-01T09:00:00Z",
"custom_datetime_2": "2026-01-15T09:30:00Z",
"custom_datetime_3": "2026-01-15T09:30:00Z",
"custom_datetime_4": "2026-01-15T09:30:00Z",
"custom_datetime_5": "2026-01-15T09:30:00Z",
"custom_json_1": {
"preferences": {
"theme": "dark",
"notifications": true
}
},
"custom_json_2": {},
"custom_json_3": {},
"custom_json_4": {},
"custom_json_5": {}
},
"list_ids": [
"newsletter",
"product_updates"
]
})
});
const data = await response.json();
console.log(data);
import requests
url = "https://demo.notifuse.com/subscribe"
payload = {
"workspace_id": "ws_1234567890",
"contact": {
"email": "user@example.com",
"email_hmac": "a1b2c3d4e5f6...",
"external_id": "user_12345",
"timezone": "America/New_York",
"language": "en-US",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"phone": "+15551234567",
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"country": "US",
"postcode": "10001",
"state": "NY",
"job_title": "Software Engineer",
"tracking_opens_consent": "granted",
"tracking_clicks_consent": "granted",
"custom_string_1": "Premium tier",
"custom_string_2": "<string>",
"custom_string_3": "<string>",
"custom_string_4": "<string>",
"custom_string_5": "<string>",
"custom_number_1": 42,
"custom_number_2": 123.45,
"custom_number_3": 123.45,
"custom_number_4": 123.45,
"custom_number_5": 123.45,
"custom_datetime_1": "2023-06-01T09:00:00Z",
"custom_datetime_2": "2026-01-15T09:30:00Z",
"custom_datetime_3": "2026-01-15T09:30:00Z",
"custom_datetime_4": "2026-01-15T09:30:00Z",
"custom_datetime_5": "2026-01-15T09:30:00Z",
"custom_json_1": {
"preferences": {
"theme": "dark",
"notifications": True
}
},
"custom_json_2": {},
"custom_json_3": {},
"custom_json_4": {},
"custom_json_5": {}
},
"list_ids": [
"newsletter",
"product_updates"
]
}
response = requests.request("POST", url, json=payload)
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
payload := strings.NewReader(`{
"workspace_id": "ws_1234567890",
"contact": {
"email": "user@example.com",
"email_hmac": "a1b2c3d4e5f6...",
"external_id": "user_12345",
"timezone": "America/New_York",
"language": "en-US",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"phone": "+15551234567",
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"country": "US",
"postcode": "10001",
"state": "NY",
"job_title": "Software Engineer",
"tracking_opens_consent": "granted",
"tracking_clicks_consent": "granted",
"custom_string_1": "Premium tier",
"custom_string_2": "<string>",
"custom_string_3": "<string>",
"custom_string_4": "<string>",
"custom_string_5": "<string>",
"custom_number_1": 42,
"custom_number_2": 123.45,
"custom_number_3": 123.45,
"custom_number_4": 123.45,
"custom_number_5": 123.45,
"custom_datetime_1": "2023-06-01T09:00:00Z",
"custom_datetime_2": "2026-01-15T09:30:00Z",
"custom_datetime_3": "2026-01-15T09:30:00Z",
"custom_datetime_4": "2026-01-15T09:30:00Z",
"custom_datetime_5": "2026-01-15T09:30:00Z",
"custom_json_1": {
"preferences": {
"theme": "dark",
"notifications": true
}
},
"custom_json_2": {},
"custom_json_3": {},
"custom_json_4": {},
"custom_json_5": {}
},
"list_ids": [
"newsletter",
"product_updates"
]
}`)
req, _ := http.NewRequest("POST", "https://demo.notifuse.com/subscribe", payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}