GET/api/resources
Files for contacts and deals, newest first.
Auth: SessionPermission: contacts:read
Query parameters
| page | number | 1-based page number. |
| limit | number | Records per page, up to 100. |
| searchQuery | string | Matches the file name, description, email recipient or subject, or the linked contact or deal. |
| filters | json | A JSON array of filter rows on month, type, source, link or addedBy. |
| contactId | string | Only the files of this contact, including its deals' files. |
| dealId | string | Only the files of this deal. |
Returns. { resources, totalPages, currentPage, totalResources }. Each resource has its name, type, size, description, source (upload or email), linked contact and deal, who added it and when.
- Everyone sees files that aren't linked to a contact; otherwise members see the files they added and the files of the leads they can see.
- Deleting a contact or deal keeps its files and only removes the link.
POST/api/resources
Upload files.
Auth: SessionPermission: contacts:write
Body
| files* | file[] | Up to 10 files, each up to 5 MB. Send the request as multipart/form-data. |
| description | string | Applied to every file, up to 2,000 characters. |
| contactId | string | Contact the files belong to. |
| dealId | string | Deal the files belong to. Its contact is linked too. |
Returns. { resources }
GET/api/resources/{resourceId}
A single resource and its details.
Auth: SessionPermission: contacts:read
PATCH/api/resources/{resourceId}
Rename a file, change its description, or link it to another contact or deal.
Auth: SessionPermission: contacts:write
Body
| name | string | New name. The file keeps its extension. |
| description | string | New description; an empty string removes it. |
| contactId | string | null | Contact to link; null removes the link. |
| dealId | string | null | Deal to link; null removes it. |
- Admins can change any file; members only the files they added.
DELETE/api/resources/{resourceId}
Delete a file.
Auth: SessionPermission: contacts:write
- Admins can delete any file; members only the files they added.
GET/api/resources/{resourceId}/content
The file itself.
Auth: SessionPermission: contacts:read
Query parameters
| download | 1 | Download the file instead of showing it in the browser. |
- PDFs, images, audio and video open in the browser; other files download.
- Supports byte ranges, so audio and video can be seeked.
GET/api/resources/link-targets
Contacts and deals a file can be linked to.
Auth: SessionPermission: contacts:read
Query parameters
| q | string | Searches contact names, companies and emails, and deal titles. |
| contactId | string | Lists that contact's deals instead. |
Returns. { contacts, deals }