Save a schema-aware widget
Configurable CRM record contract. Record references contain both typeId and recordId. Workspace scope comes from authentication. Decimal values are strings. Writes require their documented revision and idempotency preconditions; pending results refer to a durable operation. kind chart (the default for new widgets) aggregates a measure, activityTimeline lists activity, calendar shows the records of one date or date-time field as the upcoming days or as a month heat grid, and map places records at the location stored with an address field. A saved widget keeps its kind.
Requires: an active workspace member; widgets are personal and show only readable values.
Authorization
apiKeyAuth API key authentication. Create an API key in your user profile and include it in the x-api-key header.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://customermates.com/api/v1/widgets/save" \ -H "Content-Type: application/json" \ -d '{ "expectedRevision": 9007199254740991, "idempotencyKey": "stringst" }'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"kind": "chart",
"version": 9007199254740991,
"userId": "string",
"companyId": "string",
"name": "string",
"measure": {
"source": {
"typeId": "caab7c42-4ce7-4bd5-bbab-6017cec730b7",
"locale": "en",
"includeIdentities": true,
"search": "string",
"filters": [],
"relatedFilters": [
{
"path": [
{
"relationId": "4b4bc808-5132-481f-afc2-e3872bf12049",
"direction": "outgoing"
}
],
"operator": "any",
"filters": [
{
"fieldId": "84922011-b03d-4966-bc95-c5b49bc2e342",
"operator": "eq",
"value": {
"kind": "text",
"value": "string"
},
"values": [
{
"kind": "text",
"value": "string"
}
]
}
],
"relationships": [],
"search": "string",
"recordIds": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
]
}
],
"relationships": []
},
"aggregation": "count",
"valueFieldId": "bc0e5b6c-a198-4e47-86fe-48164e1a20ac",
"groupBy": {
"path": [
{
"relationId": "4b4bc808-5132-481f-afc2-e3872bf12049",
"direction": "incoming"
}
],
"fieldId": "84922011-b03d-4966-bc95-c5b49bc2e342",
"dateInterval": "day",
"timeZone": "string",
"filter": {
"search": "string",
"filters": [],
"relationships": [],
"relatedFilters": [
{
"path": [
{
"relationId": "4b4bc808-5132-481f-afc2-e3872bf12049",
"direction": "outgoing"
}
],
"operator": "any",
"filters": [
{
"fieldId": "84922011-b03d-4966-bc95-c5b49bc2e342",
"operator": "eq",
"value": {
"kind": "text",
"value": "string"
},
"values": [
{
"kind": "text",
"value": "string"
}
]
}
],
"relationships": [],
"search": "string",
"recordIds": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
]
}
]
}
},
"groupLimit": 100
},
"displayOptions": {
"barColors": [
"default1"
],
"displayType": "verticalBarChart",
"reverseXAxis": true,
"reverseYAxis": true,
"useGroupColors": true,
"showLegend": true,
"showFilters": true
},
"layout": {
"xs": {
"i": "string",
"x": 0,
"y": 0,
"w": 0,
"h": 0,
"minW": 0,
"maxW": 0,
"minH": 0,
"maxH": 0
},
"sm": {
"i": "string",
"x": 0,
"y": 0,
"w": 0,
"h": 0,
"minW": 0,
"maxW": 0,
"minH": 0,
"maxH": 0
},
"md": {
"i": "string",
"x": 0,
"y": 0,
"w": 0,
"h": 0,
"minW": 0,
"maxW": 0,
"minH": 0,
"maxH": 0
},
"lg": {
"i": "string",
"x": 0,
"y": 0,
"w": 0,
"h": 0,
"minW": 0,
"maxW": 0,
"minH": 0,
"maxH": 0
}
},
"viewId": "5aa272a5-73e4-4f9c-8123-4bac998fdb73",
"isTemplate": true,
"createdAt": "string",
"updatedAt": "string",
"data": {
"schemaRevision": -9007199254740991,
"attribution": "full",
"total": {
"count": -9007199254740991,
"result": {
"state": "value",
"value": {
"kind": "text",
"value": "string"
}
}
},
"groups": [
{
"record": {
"typeId": "caab7c42-4ce7-4bd5-bbab-6017cec730b7",
"recordId": "0470cfd4-dcf3-4d8c-ac28-58c6deeff25f"
},
"fieldId": "84922011-b03d-4966-bc95-c5b49bc2e342",
"label": {
"state": "value",
"value": {
"kind": "text",
"value": "string"
}
},
"count": -9007199254740991,
"result": {
"state": "value",
"value": {
"kind": "text",
"value": "string"
}
}
}
]
},
"status": "ready",
"decimalPlaces": 30,
"groupOptions": [
{
"id": "string",
"label": "string",
"color": "string",
"probability": "string"
}
]
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}