Create Property
Define a custom contact property. Once defined, you can store values for it on any contact via the properties field on Create Contact and reference it in personalization.
Endpoint
POST /properties
Returns: 201 Created
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <your-api-key> | Yes |
Content-Type | application/json | Yes |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
field_key | string | Yes | Internal identifier used in contact.properties. Lowercase letters, digits, and underscores. Must start with a letter. Max 100 characters. Immutable after creation. |
display_name | string | Yes | Human-readable label shown in the dashboard. Max 255 characters. |
data_type | string | No | One of string (default), number, boolean, date. Immutable after creation. |
description | string | No | Optional description. Max 500 characters. |
fallback_value | string | No | Default used in merge tags when a contact has no value. Max 2000 characters. |
Reserved field keys
The following keys conflict with built-in contact columns and are rejected: id, firstName, lastName, email, phoneNumber, unsubscribed, createdAt, updatedAt, deletedAt, organizationId.
Response
{
"id": "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a",
"field_key": "lifetime_value",
"display_name": "Lifetime Value",
"data_type": "number",
"description": "Aggregate revenue from this contact across all orders.",
"fallback_value": "0",
"created_at": "2026-03-08T12:00:00.000Z",
"updated_at": "2026-03-08T12:00:00.000Z"
}
| Field | Type | Description |
|---|---|---|
id | string | Property ID |
field_key | string | Internal identifier — use this as a key in contact.properties |
display_name | string | Human-readable label |
data_type | string | string, number, boolean, or date |
description | string | null | Description |
fallback_value | string | null | Default value for merge tags |
created_at | string | ISO 8601 timestamp |
updated_at | string | ISO 8601 timestamp |
Examples
- cURL
- JavaScript
- Python
- C#
- PHP
curl -X POST "https://api.arsel.sa/v1/properties" \
-H "Authorization: Bearer be_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"field_key": "lifetime_value",
"display_name": "Lifetime Value",
"data_type": "number",
"fallback_value": "0"
}'
const response = await fetch("https://api.arsel.sa/v1/properties", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer be_your_api_key",
},
body: JSON.stringify({
field_key: "lifetime_value",
display_name: "Lifetime Value",
data_type: "number",
fallback_value: "0",
}),
});
const property = await response.json();
console.log(property.id);
import requests
response = requests.post(
"https://api.arsel.sa/v1/properties",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer be_your_api_key",
},
json={
"field_key": "lifetime_value",
"display_name": "Lifetime Value",
"data_type": "number",
"fallback_value": "0",
},
)
print(response.json())
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer be_your_api_key");
var payload = new
{
field_key = "lifetime_value",
display_name = "Lifetime Value",
data_type = "number",
fallback_value = "0"
};
var json = System.Text.Json.JsonSerializer.Serialize(payload);
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.arsel.sa/v1/properties", content);
Console.WriteLine(await response.Content.ReadAsStringAsync());
<?php
$ch = curl_init("https://api.arsel.sa/v1/properties");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer be_your_api_key"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"field_key" => "lifetime_value",
"display_name" => "Lifetime Value",
"data_type" => "number",
"fallback_value" => "0"
]));
$response = curl_exec($ch);
echo $response;
curl_close($ch);
Error Responses
- 409 Conflict
- 422 Reserved Key
- 422 Validation Error
{
"status_code": 409,
"name": "conflict",
"message": "Property with field_key \"lifetime_value\" already exists"
}
{
"status_code": 422,
"name": "validation_error",
"message": "Field key \"email\" is reserved for built-in contact columns."
}
{
"status_code": 422,
"name": "validation_error",
"message": "field_key must start with a lowercase letter and contain only lowercase letters, digits, and underscores"
}