---
title: "Declare a contact property"
method: POST
path: "/contact-properties"
tags: ["Contact properties"]
---

# Declare a contact property

`POST /contact-properties`

## Request

- Base URL: `https://api.eusend.dev`
- URL: `https://api.eusend.dev/contact-properties`
- Auth: HTTP bearer

Declaring a property is optional — one that arrives on a contact write without ever being declared registers itself as a `string`. Declaring it is what gives it a type and a fallback value. The key and type are fixed at creation.

## Request body

- CreateContactPropertyRequest
  - `key` string, required: Lowercase letters, digits and underscores, starting with a letter. `email`, `name`, `first_name`, `last_name` and `full_name` are built in and are rejected here. Cannot be changed after creation.
  - `type` 'string' | 'number': Checked when a contact is written. Values are carried and rendered as strings either way — `number` is a validation rule, not a formatting instruction. Cannot be changed after creation.
  - `fallback_value` string, nullable

## Response `201`

Created.

- ContactProperty
  - `id` string, uuid, required
  - `key` string, required
  - `type` 'string' | 'number', required
  - `fallbackValue` string, nullable, required: Substituted into `{{key}}` for contacts carrying no value of their own. `null` renders empty.
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, nullable

## Other responses

- `400`: The request body or query failed validation (`VALIDATION_ERROR`).
- `401`: Missing, malformed, or revoked API key (`UNAUTHORIZED`).
- `403`: The key exists but may not reach this resource — a `sending_access` key outside the send paths, a test-mode key writing live state, or an account on hold (`FORBIDDEN`, `ACCOUNT_RESTRICTED`).
- `409`: A property with that name already exists (`CONFLICT`).
- `429`: Rate limit exceeded (`RATE_LIMITED`).
- `500`: Unexpected server error (`INTERNAL_ERROR`). Carries `request_id`.

---

[API](https://skmtc.dev/eusend/apis/eusend-api.md) · [All operations](https://skmtc.dev/eusend/apis/eusend-api/llms.txt) · [OpenAPI document](https://skmtc.dev/eusend/apis/eusend-api/revisions/bec561f55488?raw)
