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-properties

Requires a full_access API key.

Body Parameters

keystringrequired

The property key. Max 50 characters. Must contain only alphanumeric characters and underscores (a-z, A-Z, 0-9, _).

typestringrequired

The property type: "string" or "number". Cannot be changed after creation.

fallback_valuestring | number

A default value used in templates when the contact has no value for this property. Must match the declared type.

Response Fields

objectstring

Always "contact_property".

idstring

The 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

Response
{
  "object": "contact_property",
  "id": "c3d4e5f6-a7b8-9012-cdef-123456789012"
}