Read a record in Trash
Reads one deleted record read only, as the Trash preview in the app shows it: its field values and related records as they were when it was deleted, the configuration of its type, and its Trash item with deletion and expiry dates, who deleted it and whether the caller can restore it. Find records with /v1/trash/query, where an item of kind record carries the typeId and its targetId is the recordId, and restore them with /v1/trash/restore. A record that is not in the caller's Trash answers 404.
Requires: delete access to the record's list and read access to the record (read all, or read own when it is assigned to the caller), the rule that shows it in Trash; field values stay filtered by field access.
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/trash/read" \ -H "Content-Type: application/json" \ -d '{ "typeId": "0b8c7d6e-5f4a-4b3c-9d2e-1f0a9b8c7d6e", "recordId": "5c6d7e8f-9a0b-4c1d-8e2f-3a4b5c6d7e8f" }'{
"typeId": "caab7c42-4ce7-4bd5-bbab-6017cec730b7",
"record": {
"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
}
]
},
"trash": {
"itemId": "f11b669d-7201-4c21-88af-d85092f0c005",
"deletedAt": "2019-08-24T14:15:22Z",
"expiresAt": "2019-08-24T14:15:22Z",
"daysLeft": 9007199254740991,
"deletedBy": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"firstName": "string",
"lastName": "string",
"avatarUrl": "string"
},
"canRestore": true
},
"model": {
"revision": 9007199254740991,
"types": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"label": "string",
"pluralLabel": "string",
"description": "string",
"icon": "string",
"color": "default",
"primaryFieldId": "764026b0-e599-4f21-b381-59306bbaefa6",
"parentRelationshipId": null,
"embedded": true,
"navigationVisible": true,
"archived": true,
"position": 9007199254740991,
"relationshipPaths": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"label": "string",
"path": [
{
"relationId": "4b4bc808-5132-481f-afc2-e3872bf12049",
"direction": "outgoing"
}
],
"archived": true
}
]
}
],
"fields": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"typeId": "caab7c42-4ce7-4bd5-bbab-6017cec730b7",
"label": "string",
"valueType": "text",
"behavior": {
"kind": "input",
"defaultValue": {
"kind": "text",
"value": "string"
}
},
"required": true,
"multiple": true,
"format": {
"color": "string",
"dateFormat": "string",
"currency": "string",
"decimalPlaces": 30,
"onClick": "open",
"providerAvatar": true
},
"archived": true,
"publishedSummary": true,
"options": [
{
"id": "string",
"label": "string",
"color": "string",
"attributes": [
{
"key": "string",
"value": {
"kind": "text",
"value": "string"
}
}
]
}
],
"position": 9007199254740991
}
],
"relationships": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"sourceTypeId": "a5fe7750-b892-4da9-b879-6c18a56c9c68",
"targetTypeId": "099a21b0-6d6a-4acf-bf0d-c60d38f08ee6",
"sourceLabel": "string",
"targetLabel": "string",
"sourceCardinality": "one",
"targetCardinality": "one",
"onSourceDelete": "unlink",
"onTargetDelete": "unlink",
"messagesOnSource": true,
"messagesOnTarget": true,
"archived": true
}
],
"accessPresets": [],
"capabilities": []
},
"permittedActions": [],
"canManageSchema": true,
"linkColors": {
"property1": "default",
"property2": "default"
},
"linkIcons": {
"property1": "string",
"property2": "string"
},
"linkLabels": {
"property1": "string",
"property2": "string"
},
"detailLayout": {
"typeId": "caab7c42-4ce7-4bd5-bbab-6017cec730b7",
"schemaRevision": 9007199254740991,
"hasPersonalization": true,
"layout": {
"pinnedFields": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"hiddenFields": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"fieldOrder": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
]
},
"fields": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"label": "string"
}
]
},
"formulaReferences": {
"fields": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"typeId": "caab7c42-4ce7-4bd5-bbab-6017cec730b7",
"label": "string",
"options": [
{
"id": "string",
"label": "string"
}
]
}
],
"types": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"label": "string",
"pluralLabel": "string",
"icon": "string"
}
],
"relationships": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"sourceTypeId": "a5fe7750-b892-4da9-b879-6c18a56c9c68",
"targetTypeId": "099a21b0-6d6a-4acf-bf0d-c60d38f08ee6",
"sourceLabel": "string",
"targetLabel": "string",
"sourceCardinality": "one",
"targetCardinality": "one",
"onSourceDelete": "unlink",
"onTargetDelete": "unlink",
"messagesOnSource": true,
"messagesOnTarget": true,
"archived": 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
}
}{
"error": {
"kind": "validation",
"issues": [
{
"code": "string",
"path": [
"string"
],
"message": "string",
"customCode": "recordNotFound",
"entitlement": "string"
}
],
"retryable": true
}
}