Skip to main content

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

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.

GET/v1/odata-file/{EntityType}/{id}/{FileProperty}
tip

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):

GET/v1/odata/Attachment({id})?$expand=File

List recent attachments with file metadata:

GET/v1/odata/Attachment?$expand=File&$top=5&$orderby=CreationDate desc

Get a person's picture metadata:

GET/v1/odata/Relation_Person({id})?$select=ID,FirstName,LastName&$expand=Picture

Use 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

POST/v1/odata/Attachment
  • Entity.ID — The entity to attach the file to (any entity that has an Attachments navigation property)
  • File.Data — Base64-encoded file content
  • File.MimeType — Must match the actual file type
  • File.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):

PUT/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:

FieldTypeDescription
NameStringFile name (e.g. contract.pdf)
MimeTypeStringMIME type (e.g. application/pdf, image/png)
UrlStringDownload URL (points to /v1/odata-file/...)
DataBinaryThe 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 PropertyUsed ByPurpose
FileAttachment, Import, Resource, TemplateGeneric file storage
PictureRelation, Relationship, Activity, InvolvedProfile / entity picture
LogoApplication, ConnectorApp or connector logo
Favicon / LogoPortalPortal branding assets
TemplateFileActivity_Document, Activity_Invoice, Activity_Offer, Activity_WorkOrderDocument generation template
FinalizedDocumentActivity_Offer, Activity_WorkOrder, DocumentGenerated output document
SignedDocumentActivity_WorkOrder, DigitalSignatureDigitally signed document
WorkspaceBackgroundRelation_PersonUser workspace background
FlagDatastore_LanguageLanguage flag icon