Skip to content
YarmillYarmill

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.

ForDevelopers integrating an external systemWhereJSON HTTPS API
POST https://ingest.ms.yarmill.com/api/data/files

Every request needs an AppToken and Content-Type: application/json.

How it works

Upload the file to file storage

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.

Register that descriptor with ingest

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

Register an uploaded file
{
  "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

fileobjectrequired

The file descriptor returned by the file storage upload — pass it through unchanged rather than rebuilding it. See File descriptor for its contents.

sourceTypeintegerrequired

Which 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.

sourceCodestringrequired

Your identifier for the source object within its sourceType — the equivalent of originId on Upload data.

Maximum 255 characters, and it can't be empty.

sourceInstanceIdinteger

The instance id of the source object in your system.

sourceUserIdinteger

The 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.fileIduuid

The storage id of the uploaded file.

file.fileNamestring

The file's name, including its extension.

file.fileTypestring

The file's MIME type, such as application/pdf.

file.fileUrlstring

Where the file is stored.

file.dateAddeddate-time

When 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.