Within the Front UI, a custom field defines the name and type for an extra field of an API resource such as a contact, conversation, or account. Only listing all fields and updating the name and/or value of a custom field is allowed. If you need a custom field to change its type, you need to create a new one with the correct type in UI, as the API validates the value of a custom field based on its type.
Each custom field has a specified data type when created in the UI. Ensure the data you submit when updating a custom field's value is formatted correctly:
Type | Example name | Example values | Description |
---|---|---|---|
String | City | "London, UK" | String values |
Boolean | VIP? | true | Boolean true /false |
Datetime | Renewal date | 1525417200 | Epoch Timestamps |
Number | Loyalty points | 90 | Integers |
Teammate | Advocate | [email protected] | Email address of a teammate |
Inbox | Assigned inbox | "inb_55c8c149" | Inbox id |
Enum | Job title | [{"value": "firefighter", "label": "Firefighter"},...] | Array of values objects listing the possible enums |
Example Custom Field Object
{
"_links": {
"self": "https://api2.frontapp.com/conversations/fld_55c8c149"
},
"id": "fld_55c8c149",
"name": "job_title",
"description": "Job title",
"type": "string"
}
Example Custom Field Object of type enum
{
"_links": {
"self": "https://api2.frontapp.com/conversations/fld_55c8c149"
},
"id": "fld_55c8c149",
"name": "job_title",
"description": "Job title",
"type": "enum",
"values": [
{
"value": "firefighter",
"label": "Firefighter"
},
{
"value": "doctor",
"label": "Doctor"
},
{
"value": "airline_pilot",
"label": "Airline pilot"
},
]
}
Example of custom field object returned in API responses
{
"custom_fields": {
"City": "Austin, TX",
"Country": "US"
}
}