Deal Fields API
Deal Fields store the actual data of the deal. When you need to know what a deal is about—the loan amount, asset details, applicant income, evaluation scores—you'll find that information in deal fields. When workflows execute against a deal, they write their results as deal fields.
Each field has a key, a label, a value, and a dataType. Fields are defined through Data Models with entityType="deal_field", where you specify the field's type, label, and path. The path determines how fields are grouped and allows you to subcategorize fields into segments.
Each field tracks its value history. When updated, the system records a referenceId identifying the source of the change.
Fields support five data types: string, number, date, boolean, and money.
Money Data Type
The money data type represents monetary values with an amount and currency. The amount is stored as a string to maintain precision and avoid floating-point rounding errors. The currency must be a 3-letter ISO currency code (e.g., "USD", "EUR", "MXN").
When creating or updating a money field, you can provide the amount as either a number or a string—the API will automatically convert numeric amounts to strings. The value structure is:
The DealField Object
The DealField object represents a custom field associated with a deal in the system.
Attributes
| Attribute | Description | Type |
|---|---|---|
id | Unique identifier of the field | String |
dealId | Associated deal's ID | String |
key | Key identifier of the field | String |
label | Display label of the field | String |
value | Value of the field | Any |
dataType | Data type of the value (string, number, date, boolean, money) | String |
tags | Tags associated with the field | Array of String |
history | History of field value changes | Array of Object |
createdAt | Date and time of field creation | String (ISO 8601) |
updatedAt | Date and time of the last field update | String (ISO 8601) |
Nested Objects
Money
When dataType is money, the value field contains a Money object:
| Attribute | Description | Type |
|---|---|---|
amount | Monetary amount as a string (e.g., "1234.56") | String |
currency | 3-letter ISO currency code (e.g., "USD", "EUR") | String |
The amount is stored as a string to maintain precision. Numeric amounts provided in API requests are automatically converted to strings.
Historic Value
| Attribute | Description | Type |
|---|---|---|
referenceId | Identifier of the source of the change (typically points to an execution or workflow, e.g., execution-550e8400-e29b-41d4-a716-446655440000) | String |
value | Value at this point in history (for money fields, this will be a Money object) | Any |
updatedAt | Date and time when this value was set | String (ISO 8601) |
Endpoints
Create a Deal Field
Creates a new deal field in the system.
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
dealId | Deal's ID | String | Yes |
key | Field key | String | Yes |
value | Field value | Any | Yes |
dataType | Data type (string, number, date, boolean, money) | String | No (inferred if omitted) |
referenceId | Source reference ID | String | No |
tags | Tags | Array of String | No |
Example Request - Money Field:
Note: The amount can be provided as a number or string—both are accepted and converted to string for storage.
Example Request - Money Field (Type Inferred):
If dataType is omitted, the API will infer it as money based on the value structure.
Successful Response:
Status code: 201 (Created)
Get a Deal Field
Retrieves information of a specific deal field.
Path Parameters:
| Parameter | Description |
|---|---|
field_id | ID of the field to retrieve |
Successful Response:
The response will be the complete DealField object.
Update a Deal Field
Updates an existing deal field.
Path Parameters:
| Parameter | Description |
|---|---|
field_id | ID of the field to update |
Input Parameters:
| Parameter | Description | Type | Required |
|---|---|---|---|
dealId | Deal's ID | String | Yes |
value | New value | Any | Yes |
referenceId | Source reference ID | String | No |
tags | New tags | Array of String | No |
Example Request - Update Money Field:
The update will create a new history entry unless the referenceId matches the most recent history entry, in which case it updates that entry.
Successful Response:
The response will be the updated DealField object.
Delete a Deal Field
Deletes a deal field from the system.
Path Parameters:
| Parameter | Description |
|---|---|
field_id | ID of the field to delete |
Successful Response:
Status code 204 (No Content) if the deletion was successful.
List Deal Fields
Retrieves a paginated list of deal fields with filtering and sorting options.
Query Parameters:
| Parameter | Description | Type |
|---|---|---|
deal-id | Filter by deal ID | String |
key | Filter by field key | String |
search | Text to search | String |
page | Page number (default: 1) | Integer |
per-page | Items per page (default: 10) | Integer |
Successful Response:
The response will be a paginated list of DealField objects with an X-Total-Count header indicating the total number of matching fields.
Data Type Examples
String Type
Number Type
Date Type
Boolean Type
Money Type
Error Handling
The API may return the following error codes:
| Code | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Server Error |
Errors will include a descriptive message in the response body.