Query records

Configurable CRM record contract. Record references contain both typeId and recordId. Workspace scope comes from authentication. Decimal values are strings. Reads change nothing and return only what the caller may read.

Requires: read access to the list; only readable records and values are returned.

POST
/v1/records/query

Authorization

apiKeyAuth
x-api-key<token>

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/records/query" \  -H "Content-Type: application/json" \  -d '{    "typeId": "0b6f3c1e-8a52-4c39-9d7e-2f4a6b8c1d01",    "fields": [      "9a4c2e61-3b5d-4f7a-8c9e-1d2b3a4c5e21",      "c7e1a3b5-2d4f-4a6c-9e8b-0f1a2b3c4d31"    ],    "filters": [      {        "fieldId": "9a4c2e61-3b5d-4f7a-8c9e-1d2b3a4c5e21",        "operator": "contains",        "value": {          "kind": "text",          "value": "Acme"        }      }    ],    "sort": [      {        "fieldId": "system:updatedAt",        "direction": "desc"      }    ],    "page": 1,    "pageSize": 25  }'
{
  "records": [
    {
      "ref": {
        "typeId": "caab7c42-4ce7-4bd5-bbab-6017cec730b7",
        "recordId": "0470cfd4-dcf3-4d8c-ac28-58c6deeff25f"
      },
      "version": 9007199254740991,
      "schemaRevision": -9007199254740991,
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z",
      "fields": [
        {
          "fieldId": "84922011-b03d-4966-bc95-c5b49bc2e342",
          "result": {
            "state": "value",
            "value": {
              "kind": "text",
              "value": "string"
            }
          }
        }
      ],
      "assignedUserIds": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ],
      "assignedUsers": [],
      "memberUsers": [],
      "relationships": [],
      "relationshipPaths": [
        {
          "records": [
            {
              "ref": {
                "typeId": "caab7c42-4ce7-4bd5-bbab-6017cec730b7",
                "recordId": "0470cfd4-dcf3-4d8c-ac28-58c6deeff25f"
              },
              "title": {
                "state": "value",
                "value": {
                  "kind": "text",
                  "value": "string"
                }
              },
              "pictureUrl": "string"
            }
          ],
          "readableCount": 9007199254740991,
          "hasMore": true,
          "pathId": "fdfc0ab2-49fe-4a01-b8e7-363fd2ea9121"
        }
      ],
      "identities": [
        {
          "provider": "google",
          "value": "string",
          "messagingId": "string",
          "displayName": "string",
          "profileUrl": "string",
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "aliases": [
            "string"
          ],
          "channelClass": "string",
          "createdAt": "2019-08-24T14:15:22Z",
          "updatedAt": "2019-08-24T14:15:22Z"
        }
      ],
      "files": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "string",
          "mimeType": "string",
          "size": 9007199254740991,
          "uploadedAt": "2019-08-24T14:15:22Z",
          "uploadedById": "e4e90afa-33ee-4f3f-ba8f-3fb33b13c87d",
          "pageCount": 9007199254740991
        }
      ]
    }
  ],
  "total": -9007199254740991,
  "page": -9007199254740991,
  "pageSize": -9007199254740991,
  "schemaRevision": -9007199254740991,
  "grouping": {
    "timeZone": "UTC",
    "grouping": {
      "field": "string",
      "bucket": "day",
      "hidden": [
        "string"
      ],
      "hideEmpty": true,
      "summaries": [
        {
          "fieldId": "84922011-b03d-4966-bc95-c5b49bc2e342",
          "aggregation": "sum"
        }
      ]
    },
    "kind": "customSingleSelect",
    "supportsDragWriteBack": true,
    "columnId": "string",
    "total": 9007199254740991,
    "membershipTotal": 9007199254740991,
    "partial": true,
    "groups": [
      {
        "key": "string",
        "count": 9007199254740991,
        "labelKind": "value",
        "label": "string",
        "labelKey": "string",
        "color": "default",
        "weight": 0,
        "avatarUrl": "string",
        "bucketStart": "string",
        "bucketRole": "window",
        "isNoValue": true,
        "materialised": true,
        "itemIds": [
          "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ],
        "hasMore": true,
        "writable": true,
        "summaries": [
          {
            "fieldId": "84922011-b03d-4966-bc95-c5b49bc2e342",
            "aggregation": "sum",
            "label": "string",
            "decimalPlaces": 30,
            "result": {
              "state": "value",
              "value": {
                "kind": "text",
                "value": "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
  }
}
Empty