Request a presigned upload URL.
Start a document upload by requesting a presigned upload URL for one file. The upload
itself is then a single HTTP PUT of the raw file content to the returned
presignedUrl, with exactly the headers listed in requiredHeaders. The file
content travels directly into Galilea, never through this API, which
is why uploads are not limited to the 10 MB request size of the API.
After the PUT succeeds, no further call is needed: Galilea detects the finished
upload, creates the document in the target directory on behalf of the calling user
and starts the processing chain (parsing, indexing). The new document appears in the
Galilea application like a manually uploaded file.
An upload has no state of its own: it lasts as long as the PUT, and the caller is
online for that. What it produces is a document, named after the file without its
extension, and that name is unique within the directory. A caller that wants to know
what became of its upload reads GET /documents?directory=…&name=…; the document
appears there within seconds of the PUT, in state processing, and ends in ready,
rejected or error.
A taken name is a conflict: if the directory already holds a document of that name, the answer is 409 and nothing is prepared. A caller that may have run before lists the directory first and skips what is there. Should a file still arrive for a name that was taken in the meantime, Galilea creates no second document; before 1.9.0 it created one with a counter in its name, that behaviour is gone for API uploads.
The calling user needs edit permission on the target directory, and must not be a
viewer or light — the two roles that may read documents but not add any. The
tenant also needs credits left, since the processing that follows the upload consumes
them. Both are answered here, at the only moment at which a caller is still listening:
everything after the PUT happens without it.
Uploading into a project. A project's documents live in its project directory, so
the target is named the same way: pass the directoryId from GET /projects as
directory. The rights of that directory mirror the project: the calling user needs
the permission edit or manage in the project, and a role of editor or above in the
tenant. A member with view, or with the role viewer, reads the project's documents but
adds none. A project directory has no subdirectories, so a project's documents always
land directly in it.
apiKeyX-API-Key<token>API key issued in the Galilea settings.
application/json- body
Request for a presigned upload URL.
filename*stringName of the file to upload, including its extension. Must not contain path
separators (/ or \). The content type of the upload is derived from the
extension; files with unknown extensions are treated as application/octet-stream.
length <= 255directory*stringID of the target directory. The directory must belong to the caller's tenant and
the calling user must have edit permission on it. Directory IDs are obtained from
the directory listing operation; the directory of a project is the directoryId of
the project in GET /projects, since the directory listing never includes it.
uuidThe presigned upload target was created.
application/json- response
A presigned upload target. The client uploads the file with a single HTTP PUT of the
raw file content to presignedUrl, sending exactly the headers listed in
requiredHeaders. The URL is only valid for expiresIn seconds and only for the
filename the presigning was requested for.
uploadId*stringIdentifier of this upload, assigned by Galilea. It is embedded in the stored file so the created document can be traced back to this presigning request.
uuidpresignedUrl*stringPresigned upload URL for the upload. Upload the file with PUT directly to this URL;
the file content does not travel through the Galilea API.
expiresIn*integerSeconds until the presigned URL expires.
requiredHeaders*Headers the PUT request MUST include, exactly as given. They carry the
content type and the metadata that links the upload to its target
directory and the uploading user; the upload is rejected if they are missing or
altered.
curl -X POST "https://example.com/uploads" \ -H "Content-Type: application/json" \ -d '{ "filename": "quarterly-report-2026-Q2.pdf", "directory": "7d9030b3-4c0f-4051-9d54-79a6802a0c22" }'{ "uploadId": "3f2b8c04-9b1e-4f7a-8c25-c1a06e1b2f4d", "presignedUrl": "https://upload.example.com/3f2b8c04/quarterly-report-2026-Q2.pdf?expires=900&signature=...", "expiresIn": 900, "requiredHeaders": { "Content-Type": "application/pdf" }}