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

# Declare a contact property

`POST /v1/contact-properties`

## Request

- Base URL: `https://smtpfa.st/api`
- URL: `https://smtpfa.st/api/v1/contact-properties`
- Auth: HTTP bearer

Declare a custom field. Declaring is optional: contacts may carry undeclared properties, and those keep working. Declaring gives the field a default used when a contact has no value, and opts writes to it into type checking.

## Request body

- object
  - `key` string, required
  - `type` 'string' | 'number', required
  - `fallback_value` union: Used when a contact has no value
    - string
    - number

## Response `201`

The declared property

- object
  - `contact_property` ContactProperty, required
    - `id` string, required
    - `key` string, required
    - `type` 'string' | 'number', required
    - `fallback_value` union, required: Used when a contact has no value. A number for a number property; null when unset.
      - string
      - number
    - `created_at` string, date-time, required

## Other responses

- `400`: Invalid key, type or default
- `409`: Already declared

---

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