Register a file
Attach a file to a Yarmill record by uploading it to file storage first, then registering its metadata.
Files take two steps. The Ingest API never receives the file itself — you upload it to Yarmill's file storage service, then tell ingest where it went and what it belongs to.
POST https://ingest.ms.yarmill.com/api/data/filesEvery request needs an AppToken and Content-Type: application/json.
How it works
Send the file to Yarmill's file storage service. It responds with a file descriptor — the id, name, type, URL, and timestamp of the stored file.
POST the descriptor to /api/data/files, together with the source object the file belongs
to. Ingest stores the metadata and queues the downstream notification.
Payload
{
"file": {
"fileId": "8f3bd0c4-1c2e-4a77-9a5e-2f1b6f0c9e11",
"fileName": "report.pdf",
"fileType": "application/pdf",
"fileUrl": "https://files.ms.yarmill.com/.../report.pdf",
"dateAdded": "2026-04-17T10:15:00Z"
},
"sourceType": 90,
"sourceCode": "external-record-id",
"sourceInstanceId": 123,
"sourceUserId": 456
}Fields
fileobjectrequiredThe file descriptor returned by the file storage upload — pass it through unchanged rather than rebuilding it. See File descriptor for its contents.
sourceTypeintegerrequiredWhich kind of Yarmill object this file is attached to, as a numeric reference type.
Accepted values are the integers 1, 10, 20, 30, 40, 50, 60, 70, 80 and 90 — ask Yarmill which one matches the object you're attaching to.
sourceCodestringrequiredYour identifier for the source object within its sourceType — the equivalent of originId
on Upload data.
Maximum 255 characters, and it can't be empty.
sourceInstanceIdintegerThe instance id of the source object in your system.
sourceUserIdintegerThe user id of the source object in your system.
File descriptor
What file storage returns, and what you pass through as file. You shouldn't need to construct these yourself:
file.fileIduuidThe storage id of the uploaded file.
file.fileNamestringThe file's name, including its extension.
file.fileTypestringThe file's MIME type, such as application/pdf.
file.fileUrlstringWhere the file is stored.
file.dateAddeddate-timeWhen the file was stored, as an ISO 8601 timestamp.
Responses
200 OK means the metadata was accepted and the downstream notification queued. There is no response body.
For the full status code list, see Responses and error handling.