Create Contact Property
Create a new custom contact property. Properties can be used to store additional data about contacts and used for personalization in templates.
POST
/contact-propertiesRequires a full_access API key.
Body Parameters
keystringrequiredThe property key. Max 50 characters. Must contain only alphanumeric characters and underscores (a-z, A-Z, 0-9, _).
typestringrequiredThe property type: "string" or "number". Cannot be changed after creation.
fallback_valuestring | numberA default value used in templates when the contact has no value for this property. Must match the declared type.
Response Fields
objectstringAlways "contact_property".
idstringThe ID of the newly created property.
curl -X POST 'https://api.postflare.app/contact-properties' \
-H 'Authorization: Bearer re_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{
"key": "plan",
"type": "string",
"fallback_value": "free"
}'const response = await fetch('https://api.postflare.app/contact-properties', {
method: 'POST',
headers: {
'Authorization': 'Bearer re_xxxxxxxxx',
'Content-Type': 'application/json',
},
body: JSON.stringify({
key: 'plan',
type: 'string',
fallback_value: 'free',
}),
});
const data = await response.json();Response
{
"object": "contact_property",
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012"
}