Mailrelay API Reference

Update a custom field

PATCH https://{account}/api/v1/custom_fields/{id}

Authentication

Requires an API key sent in the X-AUTH-TOKEN header.

In order to update an existing custom field option, you must provide the id of the field. If you don't provide an id, it will create a new option.

If you want to remove an option, provide the id and an attribute called _destroy. Example:

[
  {
    id: 9,
    _destroy: true
  }
]

This would remove the custom field option with id 9.

Parameters

NameTypeRequiredDescription
id integer Yes ID of the record
label string No Label
tag_name string No Tag name
required boolean No Required
default_value string No Default value
custom_field_options_attributes array No An array of custom field options. This is required if the field type is select, select_multiple or radio_buttons.

Responses

StatusDescription
200 Success
400 The request is invalid. Check if the field names in the request and the request data is valid.
422 A validation error occurred. Check the response body for more information.
401 The API key wasn't sent or is invalid
429 Too many requests. You have exceeded the rate limit, wait and try again later.
500 An internal error happened. Try again later.

Response fields

NameTypeDescription
id integer ID
label string Label
tag_name string Tag name
field_type string Field type
required boolean Required
default_value string Default value
created_at string Created at
updated_at string Updated at
custom_field_options array Custom field options