Documents
Query, create and delete the document history records.
Table Specific Information
Select
- Id supports the '=' operator.
SELECT * FROM Documents SELECT * FROM Documents WHERE Id = '12345'
Insert
To insert a document, you must specify at least one typeid, contact, start time and end time.
INSERT INTO Documents (TypeID, StartTime, EndTime, ContactsAggregate) VALUES ('-1', '2026-07-07T05:20:00.000-04:00', '2026-07-07T05:25:00.000-04:00', '[{\"id\":\"972df268-a4db-41db-bc32-4af89ab3034b\"}]')
Delete
Documents can be deleted by providing an Id and issuing a DELETE statement.
DELETE FROM Documents WHERE Id = 'f2e74900-c3a9-4dbd-89f6-3a3603d94802'
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | True |
Id of the history item created |
| AttachmentDisplayName | String | True |
Name of the attachment related to a history |
| AttachmentFileExtension | String | True |
FileExtension of the attachment related to a history |
| AttachmentFileName | String | True |
FileName of the attachment related to a history |
| AttachmentFileSize | Integer | True |
File Size of the attachment related to a history |
| AttachmentFileSizeDisplay | String | True |
File Size Display of the attachment related to a history |
| AttachmentFileType | String | True |
FileType of the attachment related to a history |
| AttachmentLastModified | Datetime | True |
File Last Modified date of the attachment related to a history |
| AttachmentPersonal | Boolean | True |
Attachment Personal |
| CompaniesAggregate | String | False |
Companies associated with a history |
| ContactsAggregate | String | False |
Contacts associated with a history |
| Created | Datetime | True |
The datetime when history was created |
| CreateUserID | String | True |
User Id of the user who created the history |
| Details | String | False |
Details of history |
| Duration | String | False |
Duration |
| Edited | Datetime | True |
Datetime when history was last edited |
| EndTime | Datetime | False |
End Time of history |
| GroupsAggregate | String | False |
Groups associated with history |
| HistoryTypeDescription | String | True |
Description of the type of history |
| HistoryTypeId | Integer | True |
History Type ID |
| HistoryTypeName | String | True |
Name of history type |
| HistoryTypeActivityTypeId | Integer | True |
Activity type ID of the history type |
| HistoryTypeActivityTypeName | String | True |
Activity type name of the history type |
| TypeID | Integer | False |
Id of history type |
| IsPrivate | Boolean | False |
Indicates whether history is private or not |
| ManageUserID | String | True |
User Id of manager |
| OpportunitiesAggregate | String | False |
Opportunities associated with history |
| OutlookID | String | True |
Outlook Id |
| RecordManager | String | False |
Record Manager |
| RecordManagerID | String | False |
Id of Record Manager |
| Regarding | String | False |
Tells what history is about |
| StartTime | Datetime | False |
Start Time |
| ContactCompany | String | True |
The company of the contact associated with this document. |
| ContactEmail | String | True |
The email of the contact associated with this document. |
| ContactPhone | String | True |
The phone number of the contact associated with this document. |
| ContactPhoneExt | String | True |
The phone extension of the contact associated with this document. |
| CreateUserName | String | True |
The username of the user who created this document. |
| EditUserID | String | True |
The ID of the user who last edited this document. |
| EditUserName | String | True |
The username of the user who last edited this document. |