Custom Fields
Create Custom Field
Create a new custom field to store additional contact attributes using the AutoSend API.
POST
/
custom-fields
curl --request POST \
--url https://api.autosend.com/v1/custom-fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"fieldName": "company",
"fieldType": "string"
}'
import requests
url = "https://api.autosend.com/v1/custom-fields"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"fieldName": "company",
"fieldType": "string"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://api.autosend.com/v1/custom-fields", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
fieldName: "company",
fieldType: "string",
}),
});
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.autosend.com/v1/custom-fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
"fieldName" => "company",
"fieldType" => "string",
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"io/ioutil"
)
func main() {
payload, _ := json.Marshal(map[string]string{
"fieldName": "company",
"fieldType": "string",
})
req, _ := http.NewRequest("POST", "https://api.autosend.com/v1/custom-fields", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String body = """
{
"fieldName": "company",
"fieldType": "string"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.autosend.com/v1/custom-fields"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require "net/http"
require "uri"
require "json"
uri = URI.parse("https://api.autosend.com/v1/custom-fields")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
fieldName: "company",
fieldType: "string"
})
response = http.request(request)
puts response.body
{
"success": true,
"message": "Custom field created successfully",
"data": {
"id": "6960953e729f65f154369408",
"fieldName": "company",
"fieldType": "string",
"projectId": "229f1f77bcf86cd9273048038",
"createdAt": "2026-01-09T05:42:22.171Z",
"updatedAt": "2026-01-09T05:42:22.171Z"
}
}
Deprecated. Custom fields are now called contact properties. This
/custom-fields endpoint still works as an alias, but new integrations should use Create Contact Property. The new endpoint accepts name/type; the legacy fieldName/fieldType are still accepted.curl --request POST \
--url https://api.autosend.com/v1/custom-fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"fieldName": "company",
"fieldType": "string"
}'
import requests
url = "https://api.autosend.com/v1/custom-fields"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"fieldName": "company",
"fieldType": "string"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://api.autosend.com/v1/custom-fields", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
fieldName: "company",
fieldType: "string",
}),
});
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.autosend.com/v1/custom-fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
"fieldName" => "company",
"fieldType" => "string",
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"io/ioutil"
)
func main() {
payload, _ := json.Marshal(map[string]string{
"fieldName": "company",
"fieldType": "string",
})
req, _ := http.NewRequest("POST", "https://api.autosend.com/v1/custom-fields", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String body = """
{
"fieldName": "company",
"fieldType": "string"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.autosend.com/v1/custom-fields"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require "net/http"
require "uri"
require "json"
uri = URI.parse("https://api.autosend.com/v1/custom-fields")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
fieldName: "company",
fieldType: "string"
})
response = http.request(request)
puts response.body
{
"success": true,
"message": "Custom field created successfully",
"data": {
"id": "6960953e729f65f154369408",
"fieldName": "company",
"fieldType": "string",
"projectId": "229f1f77bcf86cd9273048038",
"createdAt": "2026-01-09T05:42:22.171Z",
"updatedAt": "2026-01-09T05:42:22.171Z"
}
}
Authorizations
string | header
required
Bearer authentication header of the form Bearer
<token>, where <token> is your auth token.Body Parameters
string
required
The programmatic name for the custom field. Must be unique within the project. Cannot be one of the reserved names:
firstName, first_name, lastName, last_name, email, mobile, unsubscribed, unsubscribe, unsubscribe_groups, unsubscribe_preferences, userId, externalId, createdAt, updatedAt, contactLists, address, address_line_1, address_line_2, city, state, zip, country.string
required
The data type of the custom field. Must be one of:
string, number, boolean, date.string
A human-readable description of what the field represents.
string
A fallback value used when a contact does not have an explicit value for this field.
Response
Custom field created successfullyboolean
Indicates whether the request was successful.
string
Confirmation message.Example:
"Custom field created successfully"object
The created custom field.
Show data
Show data
string
Unique identifier of the custom field.
string
The programmatic name of the custom field.
string
The data type:
string, number, boolean, or date.string
The project this custom field belongs to.
string
ISO 8601 timestamp when the field was created.
string
ISO 8601 timestamp when the field was last updated.
Was this page helpful?
⌘I
curl --request POST \
--url https://api.autosend.com/v1/custom-fields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"fieldName": "company",
"fieldType": "string"
}'
import requests
url = "https://api.autosend.com/v1/custom-fields"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
payload = {
"fieldName": "company",
"fieldType": "string"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const response = await fetch("https://api.autosend.com/v1/custom-fields", {
method: "POST",
headers: {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
},
body: JSON.stringify({
fieldName: "company",
fieldType: "string",
}),
});
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.autosend.com/v1/custom-fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
"fieldName" => "company",
"fieldType" => "string",
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"io/ioutil"
)
func main() {
payload, _ := json.Marshal(map[string]string{
"fieldName": "company",
"fieldType": "string",
})
req, _ := http.NewRequest("POST", "https://api.autosend.com/v1/custom-fields", bytes.NewBuffer(payload))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String body = """
{
"fieldName": "company",
"fieldType": "string"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.autosend.com/v1/custom-fields"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require "net/http"
require "uri"
require "json"
uri = URI.parse("https://api.autosend.com/v1/custom-fields")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = JSON.dump({
fieldName: "company",
fieldType: "string"
})
response = http.request(request)
puts response.body
{
"success": true,
"message": "Custom field created successfully",
"data": {
"id": "6960953e729f65f154369408",
"fieldName": "company",
"fieldType": "string",
"projectId": "229f1f77bcf86cd9273048038",
"createdAt": "2026-01-09T05:42:22.171Z",
"updatedAt": "2026-01-09T05:42:22.171Z"
}
}