Working with Files
Many entities in Tribe CRM can have files attached to them — profile pictures, document templates, signed contracts, and more. All file content is stored via the File object and accessed through navigation properties on the parent entity.
Downloading Files
Option 1: Binary stream (recommended)
Use the /v1/odata-file/ endpoint to download the raw binary content directly. The response is the raw binary file with the appropriate Content-Type header — not JSON. Use the Download file button in the playground to save the file.
/v1/odata-file/{EntityType}/{id}/{FileProperty}The Url field on a File object contains the full /v1/odata-file/... URL ready to use.
Option 2: JSON with metadata
Use $expand on the standard OData endpoint to get file metadata (and optionally the base64-encoded content):
/v1/odata/Attachment({id})?$expand=FileList recent attachments with file metadata:
/v1/odata/Attachment?$expand=File&$top=5&$orderby=CreationDate descGet a person's picture metadata:
/v1/odata/Relation_Person({id})?$select=ID,FirstName,LastName&$expand=PictureUse this approach when you need file metadata (name, MIME type) alongside the content, or when you want to inspect the file URL before downloading.
Uploading Files
Upload files by including a File object in the JSON body of a POST or PUT request. The file content must be base64-encoded in the Data field.
Upload an attachment to an entity
/v1/odata/AttachmentEntity.ID— The entity to attach the file to (any entity that has anAttachmentsnavigation property)File.Data— Base64-encoded file contentFile.MimeType— Must match the actual file typeFile.Name— The file name including extension
Upload a file to a specific field
Some entities accept files directly on specific navigation properties (e.g. a profile picture):
/v1/odata/Relation_Person({id})File Size Limits
File uploads are subject to the general API request size limit. For large files, consider compressing or splitting them before upload.
The File Object
A File has four fields:
| Field | Type | Description |
|---|---|---|
Name | String | File name (e.g. contract.pdf) |
MimeType | String | MIME type (e.g. application/pdf, image/png) |
Url | String | Download URL (points to /v1/odata-file/...) |
Data | Binary | The binary file content (base64-encoded in JSON responses) |
File does not have its own OData EntitySet — it is always accessed through a navigation property on a parent entity.
Entities That Have Files
Files appear across different entity types under different navigation property names:
| Navigation Property | Used By | Purpose |
|---|---|---|
File | Attachment, Import, Resource, Template | Generic file storage |
Picture | Relation, Relationship, Activity, Involved | Profile / entity picture |
Logo | Application, Connector | App or connector logo |
Favicon / Logo | Portal | Portal branding assets |
TemplateFile | Activity_Document, Activity_Invoice, Activity_Offer, Activity_WorkOrder | Document generation template |
FinalizedDocument | Activity_Offer, Activity_WorkOrder, Document | Generated output document |
SignedDocument | Activity_WorkOrder, DigitalSignature | Digitally signed document |
WorkspaceBackground | Relation_Person | User workspace background |
Flag | Datastore_Language | Language flag icon |