Submit to a Form Action URL
The form action URL behind every HTML form in Settings → Forms, and
behind the subscribe blocks in posts and landing pages. The full URL
is https://app.nashra.ai/api/subscribe/{identifier} — note there's
no /v1. Send a regular form post (application/x-www-form-urlencoded)
or JSON.
Accepts email (Email and EMAIL work too), first_name,
last_name, phone, phone_country, and any custom field by its
data_name. Leave out any field named website: it's a spam trap,
and a submission that fills it gets a normal-looking success with
nothing saved — unless your list has a custom field named website.
With the form's response type set to Redirect, a browser form post is sent to the form's Thank-you URL (or back to the page on an error). With JSON, or when you post a JSON body, you get the JSON below. Rate limited to 10 requests per minute per IP, and 10 attempts per 10 minutes for the same email address.
curl -X POST "https://app.nashra.ai/api/subscribe/example_string" \
-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"
}'
import requests
import json
url = "https://app.nashra.ai/api/subscribe/example_string"
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"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app.nashra.ai/api/subscribe/example_string", {
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"
})
});
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"
}`)
req, err := http.NewRequest("POST", "https://app.nashra.ai/api/subscribe/example_string", 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/subscribe/example_string')
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"
}'
response = http.request(request)
puts response.body
{
"data": {
"already_subscribed": true
},
"message": "Please check your email to confirm your subscription",
"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
}
/subscribe/{identifier}Target server for requests. Edit to use your own host.
The form's identifier — the last segment of its action URL
The media type of the request body
Request Preview
Response
Response will appear here after sending the request
Path Parameters
The form's identifier — the last segment of its action URL