curl --request PATCH \
--url https://api.affinity.co/v2/suggested-field-updates/{suggestedFieldUpdateId}/suggestions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operation": "apply-suggested-field-updates",
"decisions": [
{
"id": "0b1f5a2e-3c4d-4e5f-8a9b-1c2d3e4f5a6b",
"status": "accepted"
},
{
"id": "1c2a6b3f-4d5e-4f60-9bac-2d3e4f5a6b7c",
"status": "accepted",
"acceptedValue": {
"type": "text",
"data": "CFO"
}
},
{
"id": "2d3b7c40-5e6f-4071-8cbd-3e4f5a6b7c8d",
"status": "rejected"
}
]
}
'
{
"operation": "apply-suggested-field-updates",
"status": "done",
"outcomes": [
{
"id": "0b1f5a2e-3c4d-4e5f-8a9b-1c2d3e4f5a6b",
"status": "accepted",
"failureReason": null
},
{
"id": "1c2a6b3f-4d5e-4f60-9bac-2d3e4f5a6b7c",
"status": "edited",
"failureReason": null
},
{
"id": "2d3b7c40-5e6f-4071-8cbd-3e4f5a6b7c8d",
"status": "rejected",
"failureReason": null
}
]
}
Suggested Field Updates
Perform batch operations on suggestions in a set
| ⚠️ This endpoint is currently in BETA |
|---|
The endpoint returns 404 when AI agents access is not enabled for the organization.
Accept or reject suggestions in a set. Accepted values are written to the CRM.
apply-suggested-field-updates: decide everypendingsuggestion.acceptedValueoverrides the suggested value.dismiss: reject allpendingsuggestions.
Writes are not atomic: one suggestion failing does not stop the others. A failed outcome carries a failureReason. The set is done after either operation.
Returns 400, writing nothing, when the set is not open, a pending suggestion has no decision, or a decision names an unknown, duplicate, or decided suggestion, pairs acceptedValue with rejected, or has an acceptedValue type that does not match the field.
PATCH
/
v2
/
suggested-field-updates
/
{suggestedFieldUpdateId}
/
suggestions
curl --request PATCH \
--url https://api.affinity.co/v2/suggested-field-updates/{suggestedFieldUpdateId}/suggestions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"operation": "apply-suggested-field-updates",
"decisions": [
{
"id": "0b1f5a2e-3c4d-4e5f-8a9b-1c2d3e4f5a6b",
"status": "accepted"
},
{
"id": "1c2a6b3f-4d5e-4f60-9bac-2d3e4f5a6b7c",
"status": "accepted",
"acceptedValue": {
"type": "text",
"data": "CFO"
}
},
{
"id": "2d3b7c40-5e6f-4071-8cbd-3e4f5a6b7c8d",
"status": "rejected"
}
]
}
'
{
"operation": "apply-suggested-field-updates",
"status": "done",
"outcomes": [
{
"id": "0b1f5a2e-3c4d-4e5f-8a9b-1c2d3e4f5a6b",
"status": "accepted",
"failureReason": null
},
{
"id": "1c2a6b3f-4d5e-4f60-9bac-2d3e4f5a6b7c",
"status": "edited",
"failureReason": null
},
{
"id": "2d3b7c40-5e6f-4071-8cbd-3e4f5a6b7c8d",
"status": "rejected",
"failureReason": null
}
]
}
Authorizations
Path Parameters
Body
application/json
- SuggestedFieldUpdateBatchOperationApplySuggestedFieldUpdates
- SuggestedFieldUpdateBatchOperationDismiss
Accept or reject every pending suggestion in the set.
Response
OK
- SuggestedFieldUpdateBatchOperationApplySuggestedFieldUpdatesResult
- SuggestedFieldUpdateBatchOperationDismissResult
The outcome of an apply-suggested-field-updates operation
Was this page helpful?