Contact fields

Create a contact field

Creates a custom contact field and returns it. Its id is made from the name in camelCase, with a digit appended when that id is taken; contacts take values for it in fields under that id.

The name needs at least three latin letters or digits, and the id made from it must fit 100 characters. It must differ, without case, from the names of the other fields of the site, system fields such as "Email" or "First name" included.

A field created with the name of a deleted one gets the same id and shows the values contacts kept for it.

post/v1/sites/{site_id}/contact-fields

Request

  • Base URL
    https://api.getsitecontrol.com
  • Auth
    HTTP bearer

Path parameters

site_idinteger required

Headers

Idempotency-Keystring

Makes a retry of a POST safe: a repeat with the same key, body and GSC-Version returns the stored response with Idempotency-Replayed: true instead of running again. The key protects against repeated execution while the key store works. Saving the change and storing the response under the key are not atomic: if the process or the key store fails between them, the change is kept, the key is released after 15 minutes and a retry runs the request again. After a timeout or a 5xx, read the resource to check the result before retrying. 5xx and 429 responses and responses over 256 KB are not stored, so a repeat runs the request again. A key is kept for 24 hours. The same key with another body or version is 422; a repeat while the first request runs is 409.

Request body

namestring required

Display name; the id is made from it

type'text' | 'number' | 'datetime'

text: a string; number: a number, decimals allowed; datetime: a moment, ISO 8601 in UTC.

Response

Successful Response

idstring required

Derived from the name on creation; kept on rename

namestring required

Display name

type'text' | 'integer' | 'number' | 'datetime' | 'date' | 'boolean' | 'other' required

text: a string; integer: a whole number; number: a number, decimals allowed; datetime: a moment, ISO 8601 in UTC; date: a day, YYYY-MM-DD; boolean: true or false; other: a field kept from older versions of the admin, read-only on contacts.

created_atstring date-time nullable

Null for fields created before the date was recorded

Changes

No recorded changes to this operation across all 1 revision of this API.