Skip to content

Commit 7657b7a

Browse files
authored
Merge pull request #189 from genestack/feature/user-guide-multipart-endpoints
Multipart form data endpoints description in user guide
2 parents 85a07cc + eeede9f commit 7657b7a

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

docs/user-guide/doc-odm-user-guide/import-data-using-api.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,76 @@ As soon as the import process will be completed, you will be able to get the Cel
318318
}
319319
```
320320

321+
### Multipart form-data upload endpoints
322+
The Jobs import API includes `multipart/form-data` endpoints for common ODM import workflows.
323+
These endpoints allow uploading import files directly as part of the request, without providing
324+
a `dataLink` to an external file location.
325+
326+
This simplifies import workflows where the source file is already available locally.
327+
Instead of uploading a file to external storage first and then passing its URL to the API, you can
328+
submit the file directly to the corresponding import endpoint.
329+
330+
#### Supported endpoints
331+
332+
The following multipart endpoints are available:
333+
334+
* `POST /api/v1/jobs/import/samples/multipart`
335+
Uploads **Sample metadata** in **TSV** format.
336+
337+
* `POST /api/v1/jobs/import/libraries/multipart`
338+
Uploads **Library metadata** in **TSV** format.
339+
340+
* `POST /api/v1/jobs/import/preparations/multipart`
341+
Uploads **Preparation metadata** in **TSV** format.
342+
343+
* `POST /api/v1/jobs/import/cells/multipart`
344+
Uploads **Cell metadata** in **TSV** format.
345+
346+
* `POST /api/v1/jobs/import/expression/multipart`
347+
Uploads **tabular expression data** in **TSV** or **GCT** format.
348+
349+
* `POST /api/v1/jobs/import/variant/multipart`
350+
Uploads **variation data or metadata** in **VCF** or **TSV** format.
351+
352+
* `POST /api/v1/jobs/import/flow-cytometry/multipart`
353+
Uploads **flow cytometry data or metadata** in **FACS** or **TSV** format.
354+
355+
* `POST /api/v1/jobs/import/file/multipart`
356+
Uploads a **file attachment** through the Jobs import workflow.
357+
358+
#### How these endpoints work
359+
360+
Each endpoint is designed for a specific import type and accepts the uploaded file as multipart form data.
361+
The API then creates and processes the corresponding import job in the same way as the existing Jobs import flow.
362+
363+
The main difference from the non-multipart import endpoints is how the source file is provided:
364+
365+
* **Multipart endpoints** accept the file directly in the HTTP request body via `file` parameter. Please note that
366+
**the `file` parameter must always be placed last in the list of request parameters.**
367+
* **Non-multipart endpoints** require a `dataLink` that points to the source file in external storage.
368+
369+
!!! tip "Data management"
370+
The files uploaded via multipart endpoints are copied into ODM internal S3 bucket.
371+
The files are maintained by ODM and can be deleted from the original storage.
372+
Additionally such files are marked with `File copy stored` technical metadata field.
373+
374+
#### When to use multipart endpoints
375+
376+
Use multipart upload endpoints when:
377+
378+
* you already has the file available locally
379+
* you want to avoid the extra step of uploading the file to external storage
380+
* you want a simpler, single-request import flow for supported import types
381+
382+
These endpoints are particularly useful for importing files dynamically at runtime.
383+
Interactive tools can submit files chosen by the user directly to the API, automation scripts can generate
384+
and upload supported files as part of a single automated workflow, and system integrations can collect data
385+
from external sources, convert it into a supported format, and submit it immediately.
386+
This approach eliminates the need for intermediate file hosting and simplifies direct file-based import flows.
387+
Such flows are also supported
388+
within **[Attachment transformation functionality](../doc-odm-user-guide/attachment-transformation.md)** in ODM.
389+
390+
321391
### Linking entities
322392

323393
#### Samples to Study

0 commit comments

Comments
 (0)