Submit Resource Form
Subscribe through a Resource's form. Accepts the Resource's custom
fields alongside email, name, and phone — see the fields array from
the GET endpoint above for which it asks for and which are required.
Rate limited to 10 requests per minute per IP, and 10 attempts per
10 minutes for the same email address.
Submissions that look like spam still get a success response: the most blatant are dropped silently, and likely spam is saved with a risk mark that Audience's spam cleanup takes into account.
curl -X POST "https://app.nashra.ai/api/v1/tenants/example_string/magic-links/spring-sale" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"first_name": "John Doe",
"last_name": "John Doe",
"phone": "+1-555-0123",
"phone_country": "+1-555-0123",
"visitor_id": "123e4567-e89b-12d3-a456-426614174000",
"website": "example_string"
}'
import requests
import json
url = "https://app.nashra.ai/api/v1/tenants/example_string/magic-links/spring-sale"
headers = {
"Content-Type": "application/json"
}
data = {
"email": "user@example.com",
"first_name": "John Doe",
"last_name": "John Doe",
"phone": "+1-555-0123",
"phone_country": "+1-555-0123",
"visitor_id": "123e4567-e89b-12d3-a456-426614174000",
"website": "example_string"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app.nashra.ai/api/v1/tenants/example_string/magic-links/spring-sale", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"email": "user@example.com",
"first_name": "John Doe",
"last_name": "John Doe",
"phone": "+1-555-0123",
"phone_country": "+1-555-0123",
"visitor_id": "123e4567-e89b-12d3-a456-426614174000",
"website": "example_string"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"email": "user@example.com",
"first_name": "John Doe",
"last_name": "John Doe",
"phone": "+1-555-0123",
"phone_country": "+1-555-0123",
"visitor_id": "123e4567-e89b-12d3-a456-426614174000",
"website": "example_string"
}`)
req, err := http.NewRequest("POST", "https://app.nashra.ai/api/v1/tenants/example_string/magic-links/spring-sale", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://app.nashra.ai/api/v1/tenants/example_string/magic-links/spring-sale')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = '{
"email": "user@example.com",
"first_name": "John Doe",
"last_name": "John Doe",
"phone": "+1-555-0123",
"phone_country": "+1-555-0123",
"visitor_id": "123e4567-e89b-12d3-a456-426614174000",
"website": "example_string"
}'
response = http.request(request)
puts response.body
{
"data": {
"already_subscribed": true
},
"message": "Successfully subscribed",
"meta": {}
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
{
"error": "Unprocessable Entity",
"message": "The request was well-formed but contains semantic errors",
"code": 422,
"details": [
{
"field": "password",
"message": "Password must be at least 8 characters long"
}
]
}
{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Please try again later",
"code": 429,
"retryAfter": 3600
}
/tenants/{slug}/magic-links/{identifier}Target server for requests. Edit to use your own host.
Tenant's subdomain slug, or its verified custom domain
The Resource's identifier
The media type of the request body
Optional WhatsApp number — a full international number, or a national number with phone_country
Spam trap — leave it out or empty. A value here gets a normal-looking success, but nothing is saved (unless your list has a custom field named website).
Request Preview
Response
Response will appear here after sending the request
Path Parameters
Tenant's subdomain slug, or its verified custom domain
Body
Optional WhatsApp number — a full international number, or a national number with phone_country
Spam trap — leave it out or empty. A value here gets a normal-looking success, but nothing is saved (unless your list has a custom field named website).