Emma API Documentation

Fields

These endpoints let you create, edit, update and delete all of the custom fields in your account. Of particular interest is the /#account_id/fields/#field_id/clear endpoint which lets you clear out all the data in a single field for all members in your account. This makes it easy to re-initialize a dataset if you’re looking to correct an import error or syncing issue.

GET /#account_id/fields

Gets a list of this account’s defined fields.

Parameters:
  • deleted (boolean) – Accepts True or 1. Optional flag to include deleted fields.
Returns :

An array of fields.

Sample Response [showhide]
GET /100/fields

[
  {
    "shortcut_name": "first_name",
    "display_name": "First Name",
    "account_id": 100,
    "field_type": "text",
    "required": false,
    "field_id": 200,
    "widget_type": "text",
    "short_display_name": null,
    "column_order": 1,
    "deleted_at": null,
    "options": null
  },
  {
    "shortcut_name": "last_name",
    "display_name": "Last Name",
    "account_id": 100,
    "field_type": "text",
    "required": false,
    "field_id": 201,
    "widget_type": "text",
    "short_display_name": null,
    "column_order": 2,
    "deleted_at": null,
    "options": null
  },
  {
    "shortcut_name": "favorite_food",
    "display_name": "Favorite Food",
    "account_id": 100,
    "field_type": "text",
    "required": false,
    "field_id": 202,
    "widget_type": "text",
    "short_display_name": null,
    "column_order": 3,
    "deleted_at": null,
    "options": null
  },
  {
    "shortcut_name": "birthday",
    "display_name": "Birthday",
    "account_id": 100,
    "field_type": "date",
    "required": false,
    "field_id": 203,
    "widget_type": "date",
    "short_display_name": null,
    "column_order": 4,
    "deleted_at": null,
    "options": null
  }
]

GET /#account_id/fields/#field_id

Gets the detailed information about a particular field.

Parameters:
  • deleted (boolean) – Accepts True or 1. Optionally show a field even if it has been deleted.
Returns :

A field.

Raises :

Http404 if the field does not exist.

Sample Response [showhide]
GET /100/fields/200

{
  "shortcut_name": "first_name",
  "display_name": "First Name",
  "account_id": 100,
  "field_type": "text",
  "required": false,
  "field_id": 200,
  "widget_type": "text",
  "short_display_name": null,
  "column_order": 1,
  "deleted_at": null,
  "options": null
}

POST /#account_id/fields

Create a new field field.

There must not already be a field with this name.

Parameters:
  • shortcut_name (string) – The internal name for this field.
  • display_name (string) – Display name, used for forms and reports.
  • field_type (string) – The type of value this field will contain. Accepts one of text, text[], numeric, boolean, date, timestamp.
  • widget_type (string) – The widget used to accept field input. Valid values are based on field_type.
    text => text, long, radio, select one.
    text[] => select multiple, check_multiple.
    numeric => number.
    boolean => checkbox.
    date and timestamp => date.
  • options (array) – Options for a check_multiple, select multiple, select one, or radio widget.
  • column_order (integer) – Order of this column in lists.
Returns :

A reference to the new field.

Sample Response [showhide]
POST /100/fields
{
  "shortcut_name": "new_dropdown",
  "column_order": 3,
  "display_name": "A New Select Box Field",
  "field_type": "text",
  "widget_type": "select one",
  "options": ["first", "second", "third"]
}

1024

DELETE /#account_id/fields/#field_id

Deletes a field.

Returns :True if the field is deleted.
Raises :Http404 if the field does not exist.

Sample Response [showhide]
DELETE /100/fields/200

true

POST /#account_id/fields/#field_id/clear

Clear the member data for the specified field.

Returns :True if all of the member field data is deleted

Sample Response [showhide]
POST /100/fields/200/clear
{}

true

PUT /#account_id/fields/#field_id

Updates an existing field.

Returns :A reference to the updated field.

Sample Response [showhide]
PUT /100/fields/202
{
  "display_name": "Your Birthday"
}

202

Conditional Field Relationships

These endpoints let you create, edit, update and delete all of the field relationships in your account. A field relationship links a primary field to a dependent field where the selected value of the primary field determines the available options in the dependent field. For example, a “State” field could be linked to a “City” field such that when “Texas” is selected in the “State” field, only cities in Texas are available in the “City” field. A field can only be part of one relationship as either a primary or dependent field.

GET /#account_id/fields/relationships

Get a list of this account's field relationships.

Returns :An array of field relationships.

Sample Response [showhide]
GET /100/fields/relationships

[
  {
    "relationship_id": 123456,
    "relationship_name": "Location",
    "account_id": 100,
    "parent_field": {
      "field_id": 1234,
      "shortcut_name": "states",
      "display_name": "States",
      "options": [
        "ME",
        "TN",
        "CA"
      ],
      "widget_type": "select one"
    },
    "child_field": {
      "field_id": 4321,
      "shortcut_name": "cities",
      "display_name": "Cities",
      "options": [
        "Bangor",
        "Portland",
        "Nashville",
        "Memphis",
        "Los Angeles",
        "San Francisco"
      ],
      "widget_type": "select one"
    },
    "created_at": "@D:2025-10-23T09:36:33",
    "options": {
      "ME": [
        "Bangor",
        "Portland"
      ],
      "TN": [
        "Nashville",
        "Memphis"
      ],
      "CA": [
        "Los Angeles",
        "San Francisco"
      ]
    }
  }
]

GET /#account_id/fields/relationships/#relationship_id

Get a field relationship in this account by ID.

Returns :A field relationship.
Raises :Http404 if the field relationship does not exist.

Sample Response [showhide]
GET /100/fields/relationships/123456

{
  "relationship_id": 123456,
  "relationship_name": "Location",
  "account_id": 100,
  "parent_field": {
    "field_id": 1234,
    "shortcut_name": "states",
    "display_name": "States",
    "options": [
      "ME",
      "TN",
      "CA"
    ],
    "widget_type": "select one"
  },
  "child_field": {
    "field_id": 4321,
    "shortcut_name": "cities",
    "display_name": "Cities",
    "options": [
      "Bangor",
      "Portland",
      "Nashville",
      "Memphis",
      "Los Angeles",
      "San Francisco"
    ],
    "widget_type": "select one"
  },
  "created_at": "@D:2025-10-23T09:36:33",
  "options": {
    "ME": [
      "Bangor",
      "Portland"
    ],
    "TN": [
      "Nashville",
      "Memphis"
    ],
    "CA": [
      "Los Angeles",
      "San Francisco"
    ]
  }
}

POST /#account_id/fields/relationships

Create a new field relationship.

There must not already be a field relationship with the provided name.

Parameters:
  • relationship_name (string) – The display name for this field relationshiop.
  • parent_field_id (integer) – The primary field id.
  • child_field_id (integer) – The dependent field id.
  • options (dictionary) – A mapping of parent options to available options in the child field. Keys must be options in the parent field, and values must be arrays of options in the child field.
Returns :

The new field relationship.

Raises :Http400 for duplicate name or invalid options.

Sample Response [showhide]
POST /100/fields/relationships
{
  "relationship_name": "Location",
  "parent_field_id": 1234,
  "child_field_id": 4321,
  "options": {
    "ME": [
      "Bangor",
      "Portland"
    ],
    "TN": [
      "Nashville",
      "Memphis"
    ],
    "CA": [
      "Los Angeles",
      "San Francisco"
    ]
  }
}

{
  "relationship_id": 123456,
  "relationship_name": "Location",
  "account_id": 100,
  "parent_field": {
    "field_id": 1234,
    "shortcut_name": "states",
    "display_name": "States",
    "options": [
      "ME",
      "TN",
      "CA"
    ],
    "widget_type": "select one"
  },
  "child_field": {
    "field_id": 4321,
    "shortcut_name": "cities",
    "display_name": "Cities",
    "options": [
      "Bangor",
      "Portland",
      "Nashville",
      "Memphis",
      "Los Angeles",
      "San Francisco"
    ],
    "widget_type": "select one"
  },
  "created_at": "@D:2025-10-23T09:36:33",
  "options": {
    "ME": [
      "Bangor",
      "Portland"
    ],
    "TN": [
      "Nashville",
      "Memphis"
    ],
    "CA": [
      "Los Angeles",
      "San Francisco"
    ]
  }
}

DELETE /#account_id/fields/relationships/#relationship_id

Deletes a field relationship.

Returns :True if the field relationship is deleted.
Raises :Http404 if the field relationship does not exist.

Sample Response [showhide]
DELETE /100/fields/relationships/123456

true

PUT /#account_id/fields/relationships/#relationship_id

Updates an existing field relationship. Can take any of the same parameters as the POST endpoint.

Returns :The updated field relationship.
Raises :Http400 if an invalid configuration is detected.

Sample Response [showhide]
PUT /100/fields/123456
{
  "relatinship_name": "States and Cities"
}

{
  "relationship_id": 123456,
  "relationship_name": "States and Cities",
  "account_id": 100,
  "parent_field": {
    "field_id": 1234,
    "shortcut_name": "states",
    "display_name": "States",
    "options": [
      "ME",
      "TN",
      "CA"
    ],
    "widget_type": "select one"
  },
  "child_field": {
    "field_id": 4321,
    "shortcut_name": "cities",
    "display_name": "Cities",
    "options": [
      "Bangor",
      "Portland",
      "Nashville",
      "Memphis",
      "Los Angeles",
      "San Francisco"
    ],
    "widget_type": "select one"
  },
  "created_at": "@D:2025-10-23T09:36:33",
  "options": {
    "ME": [
      "Bangor",
      "Portland"
    ],
    "TN": [
      "Nashville",
      "Memphis"
    ],
    "CA": [
      "Los Angeles",
      "San Francisco"
    ]
  }
}

Related Topics

Interested in Emma?

Emma's email marketing makes communicating simple and stylish. Get started today.